mmodular: 8kb nvram for everyone (nw)

This commit is contained in:
hap 2019-12-30 19:07:33 +01:00
parent a1ca420802
commit 0c900c5fb3
2 changed files with 119 additions and 66 deletions

View File

@ -93,14 +93,12 @@ void berlin_state::berlin_mem(address_map &map)
void berlin_state::berlinp_mem(address_map &map)
{
map(0x000000, 0x03ffff).rom();
map(0x400000, 0x4fffff).ram();
map(0x800000, 0x800000).r(FUNC(berlin_state::input_r));
map(0x900000, 0x900000).w(m_board, FUNC(mephisto_board_device::mux_w));
map(0xa00000, 0xa00000).w(m_board, FUNC(mephisto_board_device::led_w));
map(0xb00000, 0xb00000).w("display", FUNC(mephisto_display_modul_device::io_w));
map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_modul_device::latch_w));
map(0x400000, 0x4fffff).ram();
map(0xd00000, 0xd07fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000);
}
@ -148,7 +146,7 @@ void berlin_state::berlinp(machine_config &config)
berlin(config);
/* basic machine hardware */
M68020(config.replace(), m_maincpu, 24.576_MHz_XTAL);
M68EC020(config.replace(), m_maincpu, 24.576_MHz_XTAL); // M68EC020RP25
m_maincpu->set_addrmap(AS_PROGRAM, &berlin_state::berlinp_mem);
m_maincpu->set_periodic_int(FUNC(berlin_state::irq2_line_hold), attotime::from_hz(750));
}
@ -171,7 +169,7 @@ ROM_END
ROM_START( berlinp )
ROM_REGION32_BE( 0x40000, "maincpu", 0 )
ROM_LOAD("berlin_020.u2", 0x00000, 0x40000, CRC(82fbaf6e) SHA1(729b7cef3dfaecc4594a6178fc4ba6015afa6202) )
ROM_LOAD("berlin_020_v400.u2", 0x00000, 0x40000, CRC(82fbaf6e) SHA1(729b7cef3dfaecc4594a6178fc4ba6015afa6202) )
ROM_END
ROM_START( berl16l )

View File

@ -25,9 +25,8 @@ No Mephisto modules were released anymore after Saitek took over H+G, engine is
to be same as Saitek's 1996 Mephisto London 68030 (limited release TM version).
TODO:
- add Bavaria sensor support (unknown1,2,3 handlers in current driver)
- custom handler to read/write the Battery RAM so 68000 can share files with 020/030 (real modular machine can do this)
- add the missing machines.. including the very rare overclocked 'TM' Tournament Machines
- add Bavaria sensor support
- add the missing very rare 'TM' Tournament Machines
- match I/S= diag speed test with real hardware (good test for proper waitstates)
- remove gen32/gen32l ROM patch
@ -40,6 +39,7 @@ Undocumented buttons:
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "machine/bankdev.h"
#include "machine/nvram.h"
#include "machine/mmboard.h"
@ -57,42 +57,81 @@ class mmodular_state : public driver_device
public:
mmodular_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
{ }
void alm32(machine_config &config);
void van32(machine_config &config);
void van16(machine_config &config);
void alm16(machine_config &config);
void alm32(machine_config &config);
void port16(machine_config &config);
void port32(machine_config &config);
void van16(machine_config &config);
void van32(machine_config &config);
void gen32(machine_config &config);
void init_gen32();
private:
DECLARE_WRITE8_MEMBER(bavaria_w);
DECLARE_READ8_MEMBER(bavaria1_r);
DECLARE_READ8_MEMBER(bavaria2_r);
void alm16_mem(address_map &map);
void alm32_mem(address_map &map);
void gen32_mem(address_map &map);
void port16_mem(address_map &map);
void port32_mem(address_map &map);
void van16_mem(address_map &map);
void van32_mem(address_map &map);
void gen32_mem(address_map &map);
void nvram_map(address_map &map);
required_device<cpu_device> m_maincpu;
};
void mmodular_state::init_gen32()
{
// patch LCD delay loop
uint8_t *rom = memregion("maincpu")->base();
if(rom[0x870] == 0x0c && rom[0x871] == 0x78)
if (rom[0x870] == 0x0c && rom[0x871] == 0x78)
rom[0x870] = 0x38;
}
/******************************************************************************
I/O
******************************************************************************/
WRITE8_MEMBER(mmodular_state::bavaria_w)
{
}
READ8_MEMBER(mmodular_state::bavaria1_r)
{
return 0;
}
READ8_MEMBER(mmodular_state::bavaria2_r)
{
return 0;
}
/******************************************************************************
Address Maps
******************************************************************************/
void mmodular_state::nvram_map(address_map &map)
{
// nvram is 8-bit (8KB)
map(0x0000, 0x1fff).ram().share("nvram");
}
void mmodular_state::alm16_mem(address_map &map)
{
map(0x000000, 0x01ffff).rom();
map(0x400000, 0x47ffff).ram();
map(0x800000, 0x803fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask16(0xff00);
map(0xc00000, 0xc00000).r("board", FUNC(mephisto_board_device::input_r));
map(0xc80000, 0xc80000).w("board", FUNC(mephisto_board_device::mux_w));
map(0xd00000, 0xd00000).w("board", FUNC(mephisto_board_device::led_w));
@ -101,72 +140,74 @@ void mmodular_state::alm16_mem(address_map &map)
map(0xf00008, 0xf0000b).portr("KEY3");
map(0xd80000, 0xd80000).w("display", FUNC(mephisto_display_modul_device::latch_w));
map(0xd80008, 0xd80008).w("display", FUNC(mephisto_display_modul_device::io_w));
}
map(0x400000, 0x47ffff).ram();
map(0x800000, 0x803fff).ram().share("nvram");
void mmodular_state::port16_mem(address_map &map)
{
alm16_mem(map);
map(0xe80004, 0xe80005).w(FUNC(mmodular_state::bavaria_w));
map(0xe80002, 0xe80003).r(FUNC(mmodular_state::bavaria1_r));
map(0xe80006, 0xe80007).r(FUNC(mmodular_state::bavaria2_r));
}
void mmodular_state::van16_mem(address_map &map)
{
alm16_mem(map);
port16_mem(map);
map(0x000000, 0x03ffff).rom();
// map(0xe80004, 0xe80005).w(FUNC(mmodular_state::write_unknown2)); // Bavaria sensors
// map(0xe80002, 0xe80003).r(FUNC(mmodular_state::read_unknown1)); // Bavaria sensors
// map(0xe80006, 0xe80007).r(FUNC(mmodular_state::read_unknown3)); // Bavaria sensors
}
void mmodular_state::alm32_mem(address_map &map)
{
map(0x00000000, 0x0001ffff).rom();
map(0x800000fc, 0x800000fc).r("board", FUNC(mephisto_board_device::input_r));
map(0x88000000, 0x88000007).w("board", FUNC(mephisto_board_device::mux_w)).umask32(0xff000000);
map(0x90000000, 0x90000007).w("board", FUNC(mephisto_board_device::led_w)).umask32(0xff000000);
map(0x40000000, 0x400fffff).ram();
map(0x800000ec, 0x800000ef).portr("KEY1");
map(0x800000f4, 0x800000f7).portr("KEY2");
map(0x800000f8, 0x800000fb).portr("KEY3");
map(0x800000fc, 0x800000fc).r("board", FUNC(mephisto_board_device::input_r));
map(0x88000000, 0x88000007).w("board", FUNC(mephisto_board_device::mux_w)).umask32(0xff000000);
map(0x90000000, 0x90000007).w("board", FUNC(mephisto_board_device::led_w)).umask32(0xff000000);
map(0xa0000000, 0xa0000000).w("display", FUNC(mephisto_display_modul_device::latch_w));
map(0xa0000010, 0xa0000010).w("display", FUNC(mephisto_display_modul_device::io_w));
map(0xa8000000, 0xa8007fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000);
}
map(0x40000000, 0x400fffff).ram();
map(0xa8000000, 0xa8007fff).ram().share("nvram");
void mmodular_state::port32_mem(address_map &map)
{
alm32_mem(map);
map(0x98000008, 0x9800000b).w(FUNC(mmodular_state::bavaria_w));
map(0x98000004, 0x98000007).r(FUNC(mmodular_state::bavaria1_r));
map(0x9800000c, 0x9800000f).r(FUNC(mmodular_state::bavaria2_r));
}
void mmodular_state::van32_mem(address_map &map)
{
alm32_mem(map);
port32_mem(map);
map(0x00000000, 0x0003ffff).rom();
// map(0x98000008, 0x9800000b).w(FUNC(mmodular_state::write_unknown2)); // Bavaria sensors
// map(0x98000004, 0x98000007).r(FUNC(mmodular_state::read_unknown1)); // Bavaria sensors
// map(0x9800000c, 0x9800000f).r(FUNC(mmodular_state::read_unknown3)); // Bavaria sensors
}
void mmodular_state::gen32_mem(address_map &map)
{
map(0x00000000, 0x0003ffff).rom();
map(0x40000000, 0x4007ffff).ram();
map(0x80000000, 0x8003ffff).ram();
map(0xc0000000, 0xc0000000).r("board", FUNC(mephisto_board_device::input_r));
map(0xc8000004, 0xc8000004).w("board", FUNC(mephisto_board_device::mux_w));
map(0xd0000004, 0xd0000004).w("board", FUNC(mephisto_board_device::led_w));
map(0xc0000000, 0xc0000000).r("board", FUNC(mephisto_board_device::input_r));
map(0xd8000008, 0xd800000b).w(FUNC(mmodular_state::bavaria_w));
map(0xd8000004, 0xd8000007).r(FUNC(mmodular_state::bavaria1_r));
map(0xd800000c, 0xd800000f).r(FUNC(mmodular_state::bavaria2_r));
map(0xe0000000, 0xe0000000).w("display", FUNC(mephisto_display_modul_device::latch_w));
map(0xe0000010, 0xe0000010).w("display", FUNC(mephisto_display_modul_device::io_w));
map(0xe8000000, 0xe8007fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000);
map(0xf0000004, 0xf0000007).portr("KEY1");
map(0xf0000008, 0xf000000b).portr("KEY2");
map(0xf0000010, 0xf0000013).portr("KEY3");
map(0xe0000000, 0xe0000000).w("display", FUNC(mephisto_display_modul_device::latch_w));
map(0xe0000010, 0xe0000010).w("display", FUNC(mephisto_display_modul_device::io_w));
// map(0xd8000008, 0xd800000b).w(FUNC(mmodular_state::write_unknown2)); // Bavaria sensors
// map(0xd8000004, 0xd8000007).r(FUNC(mmodular_state::read_unknown1)); // Bavaria sensors
// map(0xd800000c, 0xd800000f).r(FUNC(mmodular_state::read_unknown3)); // Bavaria sensors
map(0x40000000, 0x4007ffff).ram();
map(0x80000000, 0x8003ffff).ram();
map(0xe8000000, 0xe8007fff).ram().share("nvram");
}
@ -225,52 +266,66 @@ INPUT_PORTS_END
void mmodular_state::alm16(machine_config &config)
{
m68000_device &maincpu(M68000(config, "maincpu", XTAL(12'000'000)));
maincpu.set_addrmap(AS_PROGRAM, &mmodular_state::alm16_mem);
maincpu.set_periodic_int(FUNC(mmodular_state::irq2_line_hold), attotime::from_hz(600));
/* basic machine hardware */
M68000(config, m_maincpu, 12_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::alm16_mem);
m_maincpu->set_periodic_int(FUNC(mmodular_state::irq2_line_hold), attotime::from_hz(600));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
ADDRESS_MAP_BANK(config, "nvram_map").set_map(&mmodular_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13);
MEPHISTO_SENSORS_BOARD(config, "board");
MEPHISTO_DISPLAY_MODUL(config, "display");
config.set_default_layout(layout_mephisto_alm16);
}
void mmodular_state::van16(machine_config &config)
void mmodular_state::port16(machine_config &config)
{
alm16(config);
subdevice<m68000_device>("maincpu")->set_addrmap(AS_PROGRAM, &mmodular_state::van16_mem);
m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::port16_mem);
}
void mmodular_state::van16(machine_config &config)
{
port16(config);
m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::van16_mem);
}
void mmodular_state::alm32(machine_config &config)
{
m68020_device &maincpu(M68020(config, "maincpu", XTAL(12'000'000)));
maincpu.set_addrmap(AS_PROGRAM, &mmodular_state::alm32_mem);
maincpu.set_periodic_int(FUNC(mmodular_state::irq6_line_hold), attotime::from_hz(750));
alm16(config);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* basic machine hardware */
M68020(config.replace(), m_maincpu, 12_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::alm32_mem);
m_maincpu->set_periodic_int(FUNC(mmodular_state::irq6_line_hold), attotime::from_hz(750));
MEPHISTO_SENSORS_BOARD(config, "board");
MEPHISTO_DISPLAY_MODUL(config, "display");
config.set_default_layout(layout_mephisto_alm32);
}
void mmodular_state::port32(machine_config &config)
{
alm32(config);
m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::port32_mem);
}
void mmodular_state::van32(machine_config &config)
{
alm32(config);
subdevice<m68020_device>("maincpu")->set_addrmap(AS_PROGRAM, &mmodular_state::van32_mem);
port32(config);
m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::van32_mem);
}
void mmodular_state::gen32(machine_config &config)
{
m68030_device &maincpu(M68030(config, "maincpu", XTAL(33'333'000)));
maincpu.set_addrmap(AS_PROGRAM, &mmodular_state::gen32_mem);
maincpu.set_periodic_int(FUNC(mmodular_state::irq2_line_hold), attotime::from_hz(375));
van32(config);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* basic machine hardware */
M68EC030(config.replace(), m_maincpu, 33.333_MHz_XTAL); // M68EC030RP40B
m_maincpu->set_addrmap(AS_PROGRAM, &mmodular_state::gen32_mem);
const attotime irq_period = attotime::from_hz(6.144_MHz_XTAL / 0x4000); // through 4060, 375Hz
m_maincpu->set_periodic_int(FUNC(mmodular_state::irq2_line_hold), irq_period);
MEPHISTO_SENSORS_BOARD(config, "board");
MEPHISTO_DISPLAY_MODUL(config, "display");
config.set_default_layout(layout_mephisto_gen32);
}
@ -360,8 +415,8 @@ ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
CONS( 1988, alm32, 0, 0, alm32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Almeria 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1988, alm16, alm32, 0, alm16, alm16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Almeria 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, port32, 0, 0, alm32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Portorose 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, port16, port32, 0, alm16, alm16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Portorose 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, port32, 0, 0, port32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Portorose 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1989, port16, port32, 0, port16, alm16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Portorose 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, lyon32, 0, 0, alm32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Lyon 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, lyon16, lyon32, 0, alm16, alm16, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Lyon 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1991, van32, 0, 0, van32, alm32, mmodular_state, empty_init, "Hegener + Glaser", "Mephisto Vancouver 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK )