mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
v550: Add baud rate generators and SCN2672 independent buffer access (nw)
This commit is contained in:
parent
a0f5fd65b2
commit
aa67baf334
@ -15,7 +15,8 @@
|
||||
#include "emu.h"
|
||||
//include "bus/rs232/rs232.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
//#include "machine/com8116.h"
|
||||
#include "machine/com8116.h"
|
||||
#include "machine/input_merger.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/i8251.h"
|
||||
#include "machine/i8255.h"
|
||||
@ -30,6 +31,7 @@ public:
|
||||
v550_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_brg(*this, "brg%u", 1U)
|
||||
, m_screen(*this, "screen")
|
||||
, m_chargen(*this, "chargen")
|
||||
{ }
|
||||
@ -38,17 +40,26 @@ public:
|
||||
|
||||
u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; }
|
||||
private:
|
||||
DECLARE_WRITE8_MEMBER(baud_rate_w);
|
||||
void mem_map(address_map &map);
|
||||
void io_map(address_map &map);
|
||||
void pvtc_map(address_map &map);
|
||||
|
||||
virtual void machine_start() override;
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device_array<com8116_device, 2> m_brg;
|
||||
required_device<screen_device> m_screen;
|
||||
required_region_ptr<u8> m_chargen;
|
||||
};
|
||||
|
||||
|
||||
WRITE8_MEMBER(v550_state::baud_rate_w)
|
||||
{
|
||||
m_brg[offset >> 6]->write_stt(data >> 4);
|
||||
m_brg[offset >> 6]->write_str(data & 0x0f);
|
||||
}
|
||||
|
||||
void v550_state::mem_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x7bff).rom().region("maincpu", 0);
|
||||
@ -60,6 +71,7 @@ void v550_state::io_map(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
map(0x00, 0x01).rw("gdc", FUNC(upd7220_device::read), FUNC(upd7220_device::write));
|
||||
map(0x10, 0x10).select(0x40).w(FUNC(v550_state::baud_rate_w));
|
||||
map(0x20, 0x23).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write));
|
||||
map(0x30, 0x30).rw("usart", FUNC(i8251_device::data_r), FUNC(i8251_device::data_w));
|
||||
map(0x31, 0x31).rw("usart", FUNC(i8251_device::status_r), FUNC(i8251_device::control_w));
|
||||
@ -68,7 +80,13 @@ void v550_state::io_map(address_map &map)
|
||||
map(0x48, 0x48).rw("mpsc", FUNC(upd7201_new_device::db_r), FUNC(upd7201_new_device::db_w));
|
||||
map(0x49, 0x49).rw("mpsc", FUNC(upd7201_new_device::cb_r), FUNC(upd7201_new_device::cb_w));
|
||||
map(0x60, 0x67).rw("pvtc", FUNC(scn2672_device::read), FUNC(scn2672_device::write));
|
||||
map(0x70, 0x70).nopw(); // DRAM refresh address?
|
||||
map(0x70, 0x70).rw("pvtc", FUNC(scn2672_device::buffer_r), FUNC(scn2672_device::buffer_w));
|
||||
map(0x71, 0x71).noprw(); // TODO: attribute buffer
|
||||
}
|
||||
|
||||
void v550_state::pvtc_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x0fff).ram();
|
||||
}
|
||||
|
||||
|
||||
@ -94,18 +112,30 @@ MACHINE_CONFIG_START(v550_state::v550)
|
||||
MCFG_DEVICE_ADD("ppi", I8255, 0) // NEC D8255AC-5
|
||||
|
||||
MCFG_DEVICE_ADD("usart", I8251, 4'000'000) // NEC D8251AC
|
||||
MCFG_I8251_RXRDY_HANDLER(WRITELINE("mainint", input_merger_device, in_w<1>))
|
||||
|
||||
MCFG_DEVICE_ADD("mpsc", UPD7201_NEW, 4'000'000) // NEC D7201C
|
||||
MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
|
||||
MCFG_Z80SIO_OUT_INT_CB(WRITELINE("mainint", input_merger_device, in_w<0>))
|
||||
|
||||
//MCFG_DEVICE_ADD("brg1", COM8116_020, 5068800)
|
||||
//MCFG_DEVICE_ADD("brg2", COM8116_020, 5068800)
|
||||
MCFG_INPUT_MERGER_ANY_HIGH("mainint")
|
||||
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
|
||||
|
||||
MCFG_DEVICE_ADD("brg1", COM8116, 5068800) // actually SMC COM8116T-020 (unknown clock)
|
||||
MCFG_COM8116_FT_HANDLER(WRITELINE("mpsc", upd7201_new_device, txca_w))
|
||||
MCFG_COM8116_FR_HANDLER(WRITELINE("mpsc", upd7201_new_device, rxca_w))
|
||||
|
||||
MCFG_DEVICE_ADD("brg2", COM8116, 5068800) // actually SMC COM8116T-020
|
||||
MCFG_COM8116_FT_HANDLER(WRITELINE("mpsc", upd7201_new_device, txcb_w))
|
||||
MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("mpsc", upd7201_new_device, rxcb_w))
|
||||
MCFG_COM8116_FR_HANDLER(WRITELINE("usart", i8251_device, write_txc))
|
||||
MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("usart", i8251_device, write_rxc))
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(16'248'600, 918, 0, 720, 295, 0, 272)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(v550_state, screen_update)
|
||||
|
||||
MCFG_DEVICE_ADD("pvtc", SCN2672, 1'805'400)
|
||||
MCFG_DEVICE_ADDRESS_MAP(0, pvtc_map)
|
||||
MCFG_SCN2672_CHARACTER_WIDTH(9)
|
||||
MCFG_SCN2672_INTR_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||
MCFG_VIDEO_SET_SCREEN("screen")
|
||||
|
Loading…
Reference in New Issue
Block a user