src/mess/drivers/univac.c
| r9574 | r9575 | |
| 7 | 7 | |
| 8 | 8 | 25/05/2009 Skeleton driver [Robbbert]. |
| 9 | 9 | |
| 10 | The terminal has 2 screens selectable by the operator with the Fn + 1-2 |
| 11 | buttons. Thus the user can have two sessions open at once, to different |
| 12 | mainframes or applications. |
| 13 | |
| 10 | 14 | ****************************************************************************/ |
| 11 | 15 | |
| 12 | 16 | #include "emu.h" |
| 13 | 17 | #include "cpu/z80/z80.h" |
| 14 | 18 | |
| 19 | static const UINT8 *FNT; |
| 20 | static UINT8 uts20_screen; |
| 21 | |
| 22 | static WRITE8_HANDLER( uts20_43_w ) |
| 23 | { |
| 24 | uts20_screen = data & 1; |
| 25 | } |
| 26 | |
| 27 | static READ8_HANDLER( uts20_vram_r ) |
| 28 | { |
| 29 | UINT8 *RAM = memory_region(space->machine, "maincpu"); |
| 30 | return RAM[offset | ((uts20_screen) ? 0xe000 : 0xc000)]; |
| 31 | } |
| 32 | |
| 33 | static WRITE8_HANDLER( uts20_vram_w ) |
| 34 | { |
| 35 | UINT8 *RAM = memory_region(space->machine, "maincpu"); |
| 36 | RAM[offset | ((uts20_screen) ? 0xe000 : 0xc000)] = data; |
| 37 | } |
| 38 | |
| 39 | |
| 15 | 40 | static ADDRESS_MAP_START(uts20_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 16 | 41 | ADDRESS_MAP_UNMAP_HIGH |
| 17 | 42 | AM_RANGE( 0x0000, 0x4fff ) AM_ROM |
| 18 | | AM_RANGE( 0x5000, 0xffff ) AM_RAM |
| 43 | AM_RANGE( 0x5000, 0x7fff ) AM_RAM AM_REGION("maincpu", 0x5000) |
| 44 | AM_RANGE( 0x8000, 0x9fff ) AM_READWRITE(uts20_vram_r,uts20_vram_w) |
| 45 | AM_RANGE( 0xa000, 0xffff ) AM_RAM AM_REGION("maincpu", 0xa000) |
| 19 | 46 | ADDRESS_MAP_END |
| 20 | 47 | |
| 21 | | static ADDRESS_MAP_START( uts20_io , ADDRESS_SPACE_IO, 8) |
| 48 | static ADDRESS_MAP_START( uts20_io, ADDRESS_SPACE_IO, 8) |
| 49 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 22 | 50 | ADDRESS_MAP_UNMAP_HIGH |
| 51 | AM_RANGE( 0x43, 0x43 ) AM_WRITE(uts20_43_w) |
| 23 | 52 | ADDRESS_MAP_END |
| 24 | 53 | |
| 25 | 54 | /* Input ports */ |
| r9574 | r9575 | |
| 29 | 58 | |
| 30 | 59 | static MACHINE_RESET(uts20) |
| 31 | 60 | { |
| 61 | uts20_screen = 0; |
| 32 | 62 | } |
| 33 | 63 | |
| 34 | 64 | static VIDEO_START( uts20 ) |
| 35 | 65 | { |
| 66 | FNT = memory_region(machine, "chargen"); |
| 36 | 67 | } |
| 37 | 68 | |
| 38 | 69 | static VIDEO_UPDATE( uts20 ) |
| 39 | 70 | { |
| 40 | | return 0; |
| 71 | static UINT8 framecnt=0; |
| 72 | UINT8 y,ra,chr,gfx; |
| 73 | UINT16 sy=0,ma=0,x; |
| 74 | UINT8 *videoram = memory_region(screen->machine, "maincpu")+((uts20_screen) ? 0xe000 : 0xc000); |
| 75 | |
| 76 | framecnt++; |
| 77 | |
| 78 | for (y = 0; y < 25; y++) |
| 79 | { |
| 80 | for (ra = 0; ra < 10; ra++) |
| 81 | { |
| 82 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 83 | |
| 84 | for (x = ma; x < ma + 80; x++) |
| 85 | { |
| 86 | gfx = 0; |
| 87 | |
| 88 | if (ra < 9) |
| 89 | { |
| 90 | chr = videoram[x]; |
| 91 | |
| 92 | /* Take care of flashing characters */ |
| 93 | if ((chr & 0x80) && (framecnt & 0x08)) |
| 94 | chr = 0x20; |
| 95 | |
| 96 | chr &= 0x7f; |
| 97 | |
| 98 | gfx = FNT[(chr<<4) | ra ]; |
| 99 | } |
| 100 | |
| 101 | /* Display a scanline of a character */ |
| 102 | *p = ( gfx & 0x80 ) ? 1 : 0; p++; |
| 103 | *p = ( gfx & 0x40 ) ? 1 : 0; p++; |
| 104 | *p = ( gfx & 0x20 ) ? 1 : 0; p++; |
| 105 | *p = ( gfx & 0x10 ) ? 1 : 0; p++; |
| 106 | *p = ( gfx & 0x08 ) ? 1 : 0; p++; |
| 107 | *p = ( gfx & 0x04 ) ? 1 : 0; p++; |
| 108 | *p = ( gfx & 0x02 ) ? 1 : 0; p++; |
| 109 | *p = ( gfx & 0x01 ) ? 1 : 0; p++; |
| 110 | } |
| 111 | } |
| 112 | ma+=80; |
| 113 | } |
| 114 | return 0; |
| 41 | 115 | } |
| 42 | 116 | |
| 43 | 117 | static MACHINE_CONFIG_START( uts20, driver_device ) |
| r9574 | r9575 | |
| 53 | 127 | MDRV_SCREEN_REFRESH_RATE(50) |
| 54 | 128 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 55 | 129 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 56 | | MDRV_SCREEN_SIZE(640, 480) |
| 57 | | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 130 | MDRV_SCREEN_SIZE(640, 250) |
| 131 | MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 249) |
| 58 | 132 | MDRV_PALETTE_LENGTH(2) |
| 59 | 133 | MDRV_PALETTE_INIT(black_and_white) |
| 60 | 134 | |
| r9574 | r9575 | |
| 62 | 136 | MDRV_VIDEO_UPDATE(uts20) |
| 63 | 137 | MACHINE_CONFIG_END |
| 64 | 138 | |
| 139 | |
| 65 | 140 | /* ROM definition */ |
| 66 | 141 | ROM_START( uts20 ) |
| 67 | 142 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| r9574 | r9575 | |
| 71 | 146 | ROM_LOAD( "uts20d.rom", 0x3000, 0x1000, CRC(76757cf7) SHA1(b0509d9a35366b21955f83ec3685163844c4dbf1) ) |
| 72 | 147 | ROM_LOAD( "uts20e.rom", 0x4000, 0x1000, CRC(0dfc8062) SHA1(cd681020bfb4829d4cebaf1b5bf618e67b55bda3) ) |
| 73 | 148 | |
| 74 | | /* Character generator rom not dumped */ |
| 149 | /* character generator not dumped, using the one from 'c10' for now */ |
| 150 | ROM_REGION( 0x2000, "chargen", 0 ) |
| 151 | ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, NO_DUMP CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf)) |
| 75 | 152 | ROM_END |
| 76 | 153 | |
| 77 | 154 | /* Driver */ |
| 78 | 155 | |
| 79 | 156 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 80 | | COMP( 198?, uts20, 0, 0, uts20, uts20, 0, "Sperry Univac", "UTS-20", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 157 | COMP( 198?, uts20, 0, 0, uts20, uts20, 0, "Sperry Univac", "UTS-20", GAME_NOT_WORKING | GAME_NO_SOUND) |