mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
freeway: Add lamps and another device (nw)
This commit is contained in:
parent
32703cfa5a
commit
8385ab282f
@ -12,6 +12,7 @@
|
|||||||
#include "cpu/i86/i86.h"
|
#include "cpu/i86/i86.h"
|
||||||
#include "machine/pit8253.h"
|
#include "machine/pit8253.h"
|
||||||
#include "machine/pic8259.h"
|
#include "machine/pic8259.h"
|
||||||
|
#include "machine/timekpr.h"
|
||||||
#include "video/mc6845.h"
|
#include "video/mc6845.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
@ -24,14 +25,20 @@ public:
|
|||||||
, m_pic(*this, "pic")
|
, m_pic(*this, "pic")
|
||||||
, m_charram(*this, "charram")
|
, m_charram(*this, "charram")
|
||||||
, m_colorram(*this, "colorram")
|
, m_colorram(*this, "colorram")
|
||||||
|
, m_lamps(*this, "lamp%u", 1U)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void freeway(machine_config &config);
|
void freeway(machine_config &config);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void machine_start() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MC6845_UPDATE_ROW(update_row);
|
MC6845_UPDATE_ROW(update_row);
|
||||||
|
|
||||||
|
void lamps_w(u8 data);
|
||||||
|
|
||||||
void mem_map(address_map &map);
|
void mem_map(address_map &map);
|
||||||
void io_map(address_map &map);
|
void io_map(address_map &map);
|
||||||
|
|
||||||
@ -40,15 +47,29 @@ private:
|
|||||||
|
|
||||||
required_shared_ptr<u8> m_charram;
|
required_shared_ptr<u8> m_charram;
|
||||||
required_shared_ptr<u8> m_colorram;
|
required_shared_ptr<u8> m_colorram;
|
||||||
|
|
||||||
|
output_finder<3> m_lamps;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void freeway_state::machine_start()
|
||||||
|
{
|
||||||
|
m_lamps.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
MC6845_UPDATE_ROW(freeway_state::update_row)
|
MC6845_UPDATE_ROW(freeway_state::update_row)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void freeway_state::lamps_w(u8 data)
|
||||||
|
{
|
||||||
|
for (int n = 0; n < 3; n++)
|
||||||
|
m_lamps[n] = BIT(data, n);
|
||||||
|
}
|
||||||
|
|
||||||
void freeway_state::mem_map(address_map &map)
|
void freeway_state::mem_map(address_map &map)
|
||||||
{
|
{
|
||||||
map(0x00000, 0x07fff).ram();
|
map(0x00000, 0x07fff).ram();
|
||||||
|
map(0x08000, 0x09fff).rw("timekpr", FUNC(timekeeper_device::read), FUNC(timekeeper_device::write));
|
||||||
map(0xa0000, 0xa0fff).ram().share("charram");
|
map(0xa0000, 0xa0fff).ram().share("charram");
|
||||||
map(0xa4000, 0xa4fff).ram().share("colorram");
|
map(0xa4000, 0xa4fff).ram().share("colorram");
|
||||||
map(0xf0000, 0xfffff).rom().region("program", 0);
|
map(0xf0000, 0xfffff).rom().region("program", 0);
|
||||||
@ -58,6 +79,7 @@ void freeway_state::io_map(address_map &map)
|
|||||||
{
|
{
|
||||||
map(0x0020, 0x0021).rw(m_pic, FUNC(pic8259_device::read), FUNC(pic8259_device::write));
|
map(0x0020, 0x0021).rw(m_pic, FUNC(pic8259_device::read), FUNC(pic8259_device::write));
|
||||||
map(0x0030, 0x0033).w("pit", FUNC(pit8254_device::write));
|
map(0x0030, 0x0033).w("pit", FUNC(pit8254_device::write));
|
||||||
|
map(0x00a3, 0x00a3).w(FUNC(freeway_state::lamps_w));
|
||||||
map(0x00d0, 0x00d0).portr("CONFIG");
|
map(0x00d0, 0x00d0).portr("CONFIG");
|
||||||
map(0x03d0, 0x03d0).w("crtc", FUNC(mc6845_device::address_w));
|
map(0x03d0, 0x03d0).w("crtc", FUNC(mc6845_device::address_w));
|
||||||
map(0x03d1, 0x03d1).w("crtc", FUNC(mc6845_device::register_w));
|
map(0x03d1, 0x03d1).w("crtc", FUNC(mc6845_device::register_w));
|
||||||
@ -85,6 +107,8 @@ void freeway_state::freeway(machine_config &config)
|
|||||||
pit8254_device &pit(PIT8254(config, "pit"));
|
pit8254_device &pit(PIT8254(config, "pit"));
|
||||||
pit.out_handler<0>().set(m_pic, FUNC(pic8259_device::ir0_w));
|
pit.out_handler<0>().set(m_pic, FUNC(pic8259_device::ir0_w));
|
||||||
|
|
||||||
|
M48T58(config, "timekpr");
|
||||||
|
|
||||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||||
screen.set_raw(10_MHz_XTAL / 2, 320, 0, 256, 312, 0, 256);
|
screen.set_raw(10_MHz_XTAL / 2, 320, 0, 256, 312, 0, 256);
|
||||||
screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update));
|
screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update));
|
||||||
|
Loading…
Reference in New Issue
Block a user