summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2019-01-19 17:32:53 -0500
committer AJR <ajrhacker@users.noreply.github.com>2019-01-19 17:32:53 -0500
commitd09ca5ca30e6368de572ffb97b49e371f630b7ce (patch)
tree1dc866dc78970a6edeae0b9c86a3d3d9018b1a51
parentdc3a9f87ab72c434ef5e6a78e61fd0da62b2327e (diff)
freeway: Separate from amusco.cpp into its own skeleton driver (nw)
pit8253, pic8259: Default input clocks to zero (nw)
-rw-r--r--scripts/target/mame/arcade.lua1
-rw-r--r--src/devices/machine/pic8259.h4
-rw-r--r--src/devices/machine/pit8253.h6
-rw-r--r--src/mame/arcade.flt1
-rw-r--r--src/mame/drivers/amusco.cpp50
-rw-r--r--src/mame/drivers/freeway.cpp107
-rw-r--r--src/mame/mame.lst4
7 files changed, 123 insertions, 50 deletions
diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua
index 68086de2aa5..f92138f11cc 100644
--- a/scripts/target/mame/arcade.lua
+++ b/scripts/target/mame/arcade.lua
@@ -4651,6 +4651,7 @@ files {
MAME_DIR .. "src/mame/drivers/freekick.cpp",
MAME_DIR .. "src/mame/includes/freekick.h",
MAME_DIR .. "src/mame/video/freekick.cpp",
+ MAME_DIR .. "src/mame/drivers/freeway.cpp",
MAME_DIR .. "src/mame/drivers/fungames.cpp",
MAME_DIR .. "src/mame/drivers/funkball.cpp",
MAME_DIR .. "src/mame/drivers/gambl186.cpp",
diff --git a/src/devices/machine/pic8259.h b/src/devices/machine/pic8259.h
index 0b85efd9ac1..298ef1debea 100644
--- a/src/devices/machine/pic8259.h
+++ b/src/devices/machine/pic8259.h
@@ -31,7 +31,7 @@
class pic8259_device : public device_t
{
public:
- pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
auto out_int_callback() { return m_out_int_func.bind(); } // Interrupt request output to CPU or master 8259 (active high)
auto in_sp_callback() { return m_in_sp_func.bind(); } // Slave program select (VCC = master; GND = slave; pin becomes EN output in buffered mode)
@@ -118,7 +118,7 @@ private:
class v5x_icu_device : public pic8259_device
{
public:
- v5x_icu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ v5x_icu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
protected:
virtual bool is_x86() const override { return true; }
diff --git a/src/devices/machine/pit8253.h b/src/devices/machine/pit8253.h
index eebee4edbb3..77f0bf552f9 100644
--- a/src/devices/machine/pit8253.h
+++ b/src/devices/machine/pit8253.h
@@ -104,7 +104,7 @@ class pit8253_device : public device_t
public:
// construction/destruction
- pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
// configuration helpers
template <unsigned N> void set_clk(double clk) { m_clk[N] = clk; }
@@ -157,7 +157,7 @@ DECLARE_DEVICE_TYPE(PIT8253, pit8253_device)
class pit8254_device : public pit8253_device
{
public:
- pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
protected:
virtual void readback_command(uint8_t data) override;
@@ -168,7 +168,7 @@ DECLARE_DEVICE_TYPE(PIT8254, pit8254_device)
class fe2010_pit_device : public pit8253_device
{
public:
- fe2010_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ fe2010_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
};
DECLARE_DEVICE_TYPE(FE2010_PIT, fe2010_pit_device)
diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt
index b8f412fb2b5..104dd51c42f 100644
--- a/src/mame/arcade.flt
+++ b/src/mame/arcade.flt
@@ -399,6 +399,7 @@ foodf.cpp
forte2.cpp
fortecar.cpp
freekick.cpp
+freeway.cpp
fresh.cpp
fromanc2.cpp
fromance.cpp
diff --git a/src/mame/drivers/amusco.cpp b/src/mame/drivers/amusco.cpp
index 7ce94b6a86a..85bc8c13be9 100644
--- a/src/mame/drivers/amusco.cpp
+++ b/src/mame/drivers/amusco.cpp
@@ -117,7 +117,6 @@ public:
void amusco(machine_config &config);
void draw88pkr(machine_config &config);
- void freeway(machine_config &config);
DECLARE_WRITE_LINE_MEMBER(coin_irq);
@@ -140,9 +139,8 @@ private:
MC6845_UPDATE_ROW(update_row);
void amusco_palette(palette_device &palette) const;
- void amusco_mem_map(address_map &map);
- void amusco_io_map(address_map &map);
- void freeway_mem_map(address_map &map);
+ void mem_map(address_map &map);
+ void io_map(address_map &map);
std::unique_ptr<uint8_t []> m_videoram;
tilemap_t *m_bg_tilemap;
@@ -211,18 +209,12 @@ void amusco_state::machine_start()
* Memory Map Information *
*************************/
-void amusco_state::amusco_mem_map(address_map &map)
+void amusco_state::mem_map(address_map &map)
{
map(0x00000, 0x0ffff).ram();
map(0xf8000, 0xfffff).rom().region("maincpu", 0);
}
-void amusco_state::freeway_mem_map(address_map &map)
-{
- map(0x00000, 0x0ffff).ram();
- map(0xf0000, 0xfffff).rom().region("maincpu", 0);
-}
-
READ8_MEMBER( amusco_state::mc6845_r)
{
if(offset & 1)
@@ -373,7 +365,7 @@ WRITE8_MEMBER(amusco_state::rtc_control_w)
m_rtc->read_w(BIT(data, 4));
}
-void amusco_state::amusco_io_map(address_map &map)
+void amusco_state::io_map(address_map &map)
{
map(0x0000, 0x0001).rw(FUNC(amusco_state::mc6845_r), FUNC(amusco_state::mc6845_w));
map(0x0010, 0x0011).w(m_pic, FUNC(pic8259_device::write));
@@ -544,8 +536,8 @@ MACHINE_CONFIG_START(amusco_state::amusco)
/* basic machine hardware */
I8088(config, m_maincpu, CPU_CLOCK); // 5 MHz ?
- m_maincpu->set_addrmap(AS_PROGRAM, &amusco_state::amusco_mem_map);
- m_maincpu->set_addrmap(AS_IO, &amusco_state::amusco_io_map);
+ m_maincpu->set_addrmap(AS_PROGRAM, &amusco_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &amusco_state::io_map);
m_maincpu->set_irq_acknowledge_callback("pic8259", FUNC(pic8259_device::inta_cb));
PIC8259(config, m_pic, 0);
@@ -613,14 +605,6 @@ void amusco_state::draw88pkr(machine_config &config)
//MCFG_DEVICE_MODIFY("ppi_outputs") // Some bits are definitely different
}
-void amusco_state::freeway(machine_config &config)
-{
- amusco(config);
- m_maincpu->set_addrmap(AS_PROGRAM, &amusco_state::freeway_mem_map);
-
- //TODO: everything
-}
-
/*************************
* Rom Load *
*************************/
@@ -663,27 +647,6 @@ ROM_START( draw88pkr )
ROM_LOAD( "u37.bin", 0x8000, 0x4000, CRC(6e23b9f2) SHA1(6916828d84d1ecb44dc454e6786f97801a8550c7) )
ROM_END
-// this might better fit another driver
-// 8088 CPU
-// Intel 8254 Programmable Interval Timer
-// Intel 8259
-// 2x 8k SRAM
-// 1x 32k SRAM
-// 6845 video chip
-// 5 roms
-// Oscillator 10 MHz
-
-ROM_START( freeway )
- ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "vip88.bin", 0x00000, 0x10000, CRC(aeba6d5e) SHA1(bb84f7040bf1b6976cb2c50b1ffdc59ae88df223) )
-
- ROM_REGION( 0x20000, "gfx1", 0 ) // loading might be wrong
- ROM_LOAD( "sb_51.bin", 0x00000, 0x8000, CRC(d25bd328) SHA1(b8c692298f6dc5fd5ae2f9e7701e14b0436a95bb) ) // xxx0xxxxxxxxxxx = 0xFF
- ROM_LOAD( "sb_52.bin", 0x08000, 0x8000, CRC(f2b33acd) SHA1(e4786b4f00871d771aadacd9d6ec767691f4d939) )
- ROM_LOAD( "sb_53.bin", 0x10000, 0x8000, CRC(50407ae6) SHA1(2c6c4803905bed5f27c6783f99a24f8dee62c19b) )
- ROM_LOAD( "sb_cor.bin", 0x18000, 0x8000, CRC(5f86a160) SHA1(f21b7e0e6a407371c252d6fde6fcb32a2682824c) ) // 00000xxxxxxxxxx = 0xFF
-ROM_END
-
/*************************
* Game Drivers *
*************************/
@@ -691,4 +654,3 @@ ROM_END
/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS LAYOUT */
GAMEL( 1987, amusco, 0, amusco, amusco, amusco_state, empty_init, ROT0, "Amusco", "American Music Poker (V1.4)", MACHINE_IMPERFECT_COLORS | MACHINE_NODEVICE_PRINTER, layout_amusco ) // palette totally wrong
GAMEL( 1988, draw88pkr, 0, draw88pkr, draw88pkr, amusco_state, empty_init, ROT0, "BTE, Inc.", "Draw 88 Poker (V2.0)", MACHINE_IMPERFECT_COLORS | MACHINE_NODEVICE_PRINTER, layout_amusco ) // palette totally wrong
-GAMEL( 1999, freeway, 0, draw88pkr, draw88pkr, amusco_state, empty_init, ROT0, "NVC Electronica", "FreeWay (V5.12)", MACHINE_IS_SKELETON | MACHINE_NODEVICE_PRINTER, layout_amusco ) // might need an own driver
diff --git a/src/mame/drivers/freeway.cpp b/src/mame/drivers/freeway.cpp
new file mode 100644
index 00000000000..6974341add8
--- /dev/null
+++ b/src/mame/drivers/freeway.cpp
@@ -0,0 +1,107 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/*********************************************************************
+
+ FreeWay (c) 1999 NVC Electronica Ltd.
+
+ Skeleton driver.
+
+*********************************************************************/
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "video/mc6845.h"
+#include "screen.h"
+
+class freeway_state : public driver_device
+{
+public:
+ freeway_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_pic(*this, "pic")
+ {
+ }
+
+ void freeway(machine_config &config);
+
+private:
+ MC6845_UPDATE_ROW(update_row);
+
+ void mem_map(address_map &map);
+ void io_map(address_map &map);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<pic8259_device> m_pic;
+};
+
+MC6845_UPDATE_ROW(freeway_state::update_row)
+{
+}
+
+void freeway_state::mem_map(address_map &map)
+{
+ map(0x00000, 0x07fff).ram();
+ map(0xa0000, 0xa0fff).ram(); // video RAM?
+ map(0xa4000, 0xa4fff).ram(); // video RAM?
+ map(0xf0000, 0xfffff).rom().region("program", 0);
+}
+
+void freeway_state::io_map(address_map &map)
+{
+ map(0x0020, 0x0021).rw(m_pic, FUNC(pic8259_device::read), FUNC(pic8259_device::write));
+ map(0x0030, 0x0033).w("pit", FUNC(pit8254_device::write));
+ map(0x03d0, 0x03d0).w("crtc", FUNC(mc6845_device::address_w));
+ map(0x03d1, 0x03d1).w("crtc", FUNC(mc6845_device::register_w));
+}
+
+static INPUT_PORTS_START(freeway)
+INPUT_PORTS_END
+
+void freeway_state::freeway(machine_config &config)
+{
+ I8088(config, m_maincpu, 10_MHz_XTAL / 2); // divider unknown
+ m_maincpu->set_addrmap(AS_PROGRAM, &freeway_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &freeway_state::io_map);
+ m_maincpu->set_irq_acknowledge_callback("pic", FUNC(pic8259_device::inta_cb));
+
+ PIC8259(config, m_pic);
+ m_pic->out_int_callback().set_inputline(m_maincpu, 0);
+
+ PIT8254(config, "pit");
+
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_raw(10_MHz_XTAL / 2, 320, 0, 256, 312, 0, 256);
+ screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update));
+
+ mc6845_device &crtc(MC6845(config, "crtc", 10_MHz_XTAL / 16));
+ crtc.set_char_width(8);
+ crtc.set_show_border_area(false);
+ crtc.set_screen("screen");
+ crtc.set_update_row_callback(FUNC(freeway_state::update_row), this);
+}
+
+// 8088 CPU
+// Intel 8254 Programmable Interval Timer
+// Intel 8259
+// 2x 8k SRAM
+// 1x 32k SRAM
+// 6845 video chip
+// 5 roms
+// Oscillator 10 MHz
+
+ROM_START(freeway)
+ ROM_REGION(0x10000, "program", 0)
+ ROM_LOAD("vip88.bin", 0x00000, 0x10000, CRC(aeba6d5e) SHA1(bb84f7040bf1b6976cb2c50b1ffdc59ae88df223))
+
+ ROM_REGION(0x20000, "gfx", 0) // loading might be wrong
+ ROM_LOAD("sb_51.bin", 0x00000, 0x8000, CRC(d25bd328) SHA1(b8c692298f6dc5fd5ae2f9e7701e14b0436a95bb)) // xxx0xxxxxxxxxxx = 0xFF
+ ROM_LOAD("sb_52.bin", 0x08000, 0x8000, CRC(f2b33acd) SHA1(e4786b4f00871d771aadacd9d6ec767691f4d939))
+ ROM_LOAD("sb_53.bin", 0x10000, 0x8000, CRC(50407ae6) SHA1(2c6c4803905bed5f27c6783f99a24f8dee62c19b))
+ ROM_LOAD("sb_cor.bin", 0x18000, 0x8000, CRC(5f86a160) SHA1(f21b7e0e6a407371c252d6fde6fcb32a2682824c)) // 00000xxxxxxxxxx = 0xFF
+ROM_END
+
+
+GAME(1999, freeway, 0, freeway, freeway, freeway_state, empty_init, ROT0, "NVC Electronica", "FreeWay (V5.12)", MACHINE_IS_SKELETON)
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index b3034f59e44..b6fd0f01bc9 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -1268,7 +1268,6 @@ kccomp // VEB KC compact
@source:amusco.cpp
amusco // 1987, Amusco.
draw88pkr // 1988, BTE, Inc.
-freeway
@source:amust.cpp
amust //
@@ -13063,6 +13062,9 @@ pbillrd // (c) 1987 Nihon System
pbillrds // (c) 1987 Nihon System (Sega license?)
pbillrdsa // (c) 1987 Nihon System (Sega license?)
+@source:freeway.cpp
+freeway
+
@source:fresh.cpp
fresh // (c) Chain Leisure