diff options
Diffstat (limited to 'src/mess/drivers/univac.c')
-rw-r--r-- | src/mess/drivers/univac.c | 124 |
1 files changed, 82 insertions, 42 deletions
diff --git a/src/mess/drivers/univac.c b/src/mess/drivers/univac.c index cc50188df77..e714ba731a9 100644 --- a/src/mess/drivers/univac.c +++ b/src/mess/drivers/univac.c @@ -13,64 +13,87 @@ buttons. Thus the user can have two sessions open at once, to different mainframes or applications. + Sound is a beeper. + + This driver is all guesswork; Unisys never released technical info + to customers. All parts on the PCBs have internal Unisys part numbers + instead of the manufacturer's numbers. + ****************************************************************************/ #include "emu.h" #include "cpu/z80/z80.h" +#include "cpu/z80/z80daisy.h" +#include "machine/nvram.h" +#include "machine/z80ctc.h" +#include "machine/z80dart.h" class univac_state : public driver_device { public: univac_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_p_videoram(*this, "videoram") + , m_nvram(*this, "nvram") + , m_ctc(*this, "ctc") + , m_dart(*this, "dart") { } - required_device<cpu_device> m_maincpu; - DECLARE_READ8_MEMBER( uts20_vram_r ); - DECLARE_WRITE8_MEMBER( uts20_vram_w ); - DECLARE_WRITE8_MEMBER( uts20_43_w ); + DECLARE_READ8_MEMBER(vram_r); + DECLARE_WRITE8_MEMBER(vram_w); + DECLARE_WRITE8_MEMBER(port43_w); + INTERRUPT_GEN_MEMBER(vblank_irq); + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +private: const UINT8 *m_p_chargen; bool m_screen_num; UINT8 m_framecnt; + virtual void machine_start(); virtual void machine_reset(); - virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_device<cpu_device> m_maincpu; + required_shared_ptr<UINT8> m_p_videoram; + required_device<nvram_device> m_nvram; + required_device<z80ctc_device> m_ctc; + required_device<z80dart_device> m_dart; }; -WRITE8_MEMBER( univac_state::uts20_43_w ) +WRITE8_MEMBER( univac_state::port43_w ) { - m_screen_num = data & 1; + m_screen_num = BIT(data, 0); } -READ8_MEMBER( univac_state::uts20_vram_r ) +READ8_MEMBER( univac_state::vram_r ) { - UINT8 *RAM = memregion("maincpu")->base(); - return RAM[offset | ((m_screen_num) ? 0xe000 : 0xc000)]; + offs_t offs = (offset & 0x1fff) ^ (BIT(offset, 13) ? 0x2000 : 0) ^ (m_screen_num ? 0x2000 : 0); + return m_p_videoram[offs]; } -WRITE8_MEMBER( univac_state::uts20_vram_w ) +WRITE8_MEMBER( univac_state::vram_w ) { - UINT8 *RAM = memregion("maincpu")->base(); - RAM[offset | ((m_screen_num) ? 0xe000 : 0xc000)] = data; + offs_t offs = (offset & 0x1fff) ^ (BIT(offset, 13) ? 0x2000 : 0) ^ (m_screen_num ? 0x2000 : 0); + m_p_videoram[offs] = data; } static ADDRESS_MAP_START(uts20_mem, AS_PROGRAM, 8, univac_state) ADDRESS_MAP_UNMAP_HIGH - AM_RANGE( 0x0000, 0x4fff ) AM_ROM - AM_RANGE( 0x5000, 0x7fff ) AM_RAM AM_REGION("maincpu", 0x5000) - AM_RANGE( 0x8000, 0x9fff ) AM_READWRITE(uts20_vram_r,uts20_vram_w) - AM_RANGE( 0xa000, 0xffff ) AM_RAM AM_REGION("maincpu", 0xa000) + AM_RANGE( 0x0000, 0x4fff ) AM_ROM AM_REGION("roms", 0) + AM_RANGE( 0x8000, 0xbfff ) AM_READWRITE(vram_r,vram_w) + AM_RANGE( 0xc000, 0xffff ) AM_RAM AM_SHARE("videoram") ADDRESS_MAP_END static ADDRESS_MAP_START( uts20_io, AS_IO, 8, univac_state) ADDRESS_MAP_GLOBAL_MASK(0xff) ADDRESS_MAP_UNMAP_HIGH - AM_RANGE( 0x43, 0x43 ) AM_WRITE(uts20_43_w) + //AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("dart", z80dart_device, ba_cd_r, ba_cd_w) + AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("dart", z80dart_device, cd_ba_r, cd_ba_w) // ?? no idea + AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("ctc", z80ctc_device, read, write) + AM_RANGE(0x43, 0x43) AM_WRITE(port43_w) + AM_RANGE(0x80, 0xbf) AM_RAM AM_SHARE("nvram") ADDRESS_MAP_END /* Input ports */ @@ -78,21 +101,29 @@ static INPUT_PORTS_START( uts20 ) INPUT_PORTS_END -void univac_state::machine_reset() +void univac_state::machine_start() { - m_screen_num = 0; +// D7DC and D7DD are checked for valid RID and SID (usually 21 and 51) if not valid then NVRAM gets initialised. } -void univac_state::video_start() +void univac_state::machine_reset() { + m_screen_num = 0; m_p_chargen = memregion("chargen")->base(); } UINT32 univac_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { + // this is used to get the ctc to pass the test + bool state = BIT(m_framecnt,0); + m_ctc->trg0(state); + m_ctc->trg1(state); + m_ctc->trg2(state); + m_ctc->trg3(state); + UINT8 y,ra,chr,gfx; UINT16 sy=0,ma=0,x; - UINT8 *videoram = memregion("maincpu")->base()+((m_screen_num) ? 0xe000 : 0xc000); + UINT8 *videoram = m_p_videoram;//+(m_screen_num ? 0x2000 : 0); m_framecnt++; @@ -104,20 +135,13 @@ UINT32 univac_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, for (x = ma; x < ma + 80; x++) { - gfx = 0; - - if (ra < 9) - { - chr = videoram[x]; + chr = videoram[x]; - /* Take care of flashing characters */ - if ((chr & 0x80) && (m_framecnt & 8)) - chr = 0x20; + /* Take care of 'corner' characters */ + if (((chr == 0x1c) || (chr == 0x1d)) && (m_framecnt & 16)) + chr = 0x20; - chr &= 0x7f; - - gfx = m_p_chargen[(chr<<4) | ra ]; - } + gfx = (ra ? m_p_chargen[((chr & 0x7f)<<4) | (ra-1) ] : 0) ^ (BIT(chr, 7) ? 0xff : 0); /* Display a scanline of a character */ *p++ = BIT(gfx, 7); @@ -135,11 +159,19 @@ UINT32 univac_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, return 0; } +static const z80_daisy_config daisy_chain[] = +{ + { "dart" }, + { "ctc" }, + { NULL } +}; + static MACHINE_CONFIG_START( uts20, univac_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz) + MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz) // unknown clock MCFG_CPU_PROGRAM_MAP(uts20_mem) MCFG_CPU_IO_MAP(uts20_io) + MCFG_CPU_CONFIG(daisy_chain) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -149,19 +181,27 @@ static MACHINE_CONFIG_START( uts20, univac_state ) MCFG_SCREEN_SIZE(640, 250) MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249) MCFG_SCREEN_PALETTE("palette") + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") - MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") + MCFG_NVRAM_ADD_1FILL("nvram") + MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL_4MHz) + MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) + MCFG_Z80DART_ADD("dart", XTAL_4MHz, 0, 0, 0, 0 ) + MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) MACHINE_CONFIG_END /* ROM definition */ ROM_START( uts20 ) - ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x5000, "roms", ROMREGION_ERASEFF ) ROM_LOAD( "uts20a.rom", 0x0000, 0x1000, CRC(1a7b4b4e) SHA1(c3732e25b4b7c7a80172e3fe55c77b923cf511eb) ) ROM_LOAD( "uts20b.rom", 0x1000, 0x1000, CRC(7f8de87b) SHA1(a85f404ad9d560df831cc3e651a4b45e4ed30130) ) ROM_LOAD( "uts20c.rom", 0x2000, 0x1000, CRC(4e334705) SHA1(ff1a730551b42f29d20af8ecc4495fd30567d35b) ) ROM_LOAD( "uts20d.rom", 0x3000, 0x1000, CRC(76757cf7) SHA1(b0509d9a35366b21955f83ec3685163844c4dbf1) ) ROM_LOAD( "uts20e.rom", 0x4000, 0x1000, CRC(0dfc8062) SHA1(cd681020bfb4829d4cebaf1b5bf618e67b55bda3) ) + ROM_FILL(0x2bd,1,0xaf) // test 2 + ROM_FILL(0x3c1,2,0xaf) // test 5 + ROM_FILL(0x928,1,0) /* character generator not dumped, using the one from 'c10' for now */ ROM_REGION( 0x2000, "chargen", 0 ) @@ -170,5 +210,5 @@ ROM_END /* Driver */ -/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ -COMP( 198?, uts20, 0, 0, uts20, uts20, driver_device, 0, "Sperry Univac", "UTS-20", GAME_NOT_WORKING | GAME_NO_SOUND) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP( 1980, uts20, 0, 0, uts20, uts20, driver_device, 0, "Sperry Univac", "UTS-20", GAME_NOT_WORKING | GAME_NO_SOUND) |