src/mess/drivers/univac.c
| r11047 | r11048 | |
| 17 | 17 | #include "emu.h" |
| 18 | 18 | #include "cpu/z80/z80.h" |
| 19 | 19 | |
| 20 | | #define UTS20_MACHINE_RESET void univac_state::machine_reset() |
| 21 | | #define UTS20_VIDEO_START void univac_state::video_start() |
| 22 | | #define UTS20_SCREEN_UPDATE bool univac_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 20 | #define MACHINE_RESET_MEMBER(name) void name::machine_reset() |
| 21 | #define VIDEO_START_MEMBER(name) void name::video_start() |
| 22 | #define SCREEN_UPDATE_MEMBER(name) bool name::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 23 | 23 | |
| 24 | 24 | class univac_state : public driver_device |
| 25 | 25 | { |
| r11047 | r11048 | |
| 33 | 33 | DECLARE_READ8_MEMBER( uts20_vram_r ); |
| 34 | 34 | DECLARE_WRITE8_MEMBER( uts20_vram_w ); |
| 35 | 35 | DECLARE_WRITE8_MEMBER( uts20_43_w ); |
| 36 | | const UINT8 *m_FNT; |
| 37 | | UINT8 m_uts20_screen; |
| 36 | const UINT8 *m_p_chargen; |
| 37 | bool m_screen_num; |
| 38 | 38 | UINT8 m_framecnt; |
| 39 | 39 | virtual void machine_reset(); |
| 40 | 40 | virtual void video_start(); |
| r11047 | r11048 | |
| 45 | 45 | |
| 46 | 46 | WRITE8_MEMBER( univac_state::uts20_43_w ) |
| 47 | 47 | { |
| 48 | | m_uts20_screen = data & 1; |
| 48 | m_screen_num = data & 1; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | READ8_MEMBER( univac_state::uts20_vram_r ) |
| 52 | 52 | { |
| 53 | 53 | UINT8 *RAM = machine().region("maincpu")->base(); |
| 54 | | return RAM[offset | ((m_uts20_screen) ? 0xe000 : 0xc000)]; |
| 54 | return RAM[offset | ((m_screen_num) ? 0xe000 : 0xc000)]; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | WRITE8_MEMBER( univac_state::uts20_vram_w ) |
| 58 | 58 | { |
| 59 | 59 | UINT8 *RAM = machine().region("maincpu")->base(); |
| 60 | | RAM[offset | ((m_uts20_screen) ? 0xe000 : 0xc000)] = data; |
| 60 | RAM[offset | ((m_screen_num) ? 0xe000 : 0xc000)] = data; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| r11047 | r11048 | |
| 80 | 80 | INPUT_PORTS_END |
| 81 | 81 | |
| 82 | 82 | |
| 83 | | UTS20_MACHINE_RESET |
| 83 | MACHINE_RESET_MEMBER(univac_state) |
| 84 | 84 | { |
| 85 | | m_uts20_screen = 0; |
| 85 | m_screen_num = 0; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | | UTS20_VIDEO_START |
| 88 | VIDEO_START_MEMBER(univac_state) |
| 89 | 89 | { |
| 90 | | m_FNT = m_machine.region("chargen")->base(); |
| 90 | m_p_chargen = m_machine.region("chargen")->base(); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | | UTS20_SCREEN_UPDATE |
| 93 | SCREEN_UPDATE_MEMBER(univac_state) |
| 94 | 94 | { |
| 95 | 95 | UINT8 y,ra,chr,gfx; |
| 96 | 96 | UINT16 sy=0,ma=0,x; |
| 97 | | UINT8 *videoram = machine().region("maincpu")->base()+((m_uts20_screen) ? 0xe000 : 0xc000); |
| 97 | UINT8 *videoram = machine().region("maincpu")->base()+((m_screen_num) ? 0xe000 : 0xc000); |
| 98 | 98 | |
| 99 | 99 | m_framecnt++; |
| 100 | 100 | |
| r11047 | r11048 | |
| 118 | 118 | |
| 119 | 119 | chr &= 0x7f; |
| 120 | 120 | |
| 121 | | gfx = m_FNT[(chr<<4) | ra ]; |
| 121 | gfx = m_p_chargen[(chr<<4) | ra ]; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /* Display a scanline of a character */ |
| r11047 | r11048 | |
| 166 | 166 | |
| 167 | 167 | /* character generator not dumped, using the one from 'c10' for now */ |
| 168 | 168 | ROM_REGION( 0x2000, "chargen", 0 ) |
| 169 | | ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, BAD_DUMP CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf)) |
| 169 | ROM_LOAD("c10_char.bin", 0x0000, 0x2000, BAD_DUMP CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf) ) |
| 170 | 170 | ROM_END |
| 171 | 171 | |
| 172 | 172 | /* Driver */ |