src/mess/video/vtvideo.c
| r13859 | r13860 | |
| 286 | 286 | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | |
| 290 | void rainbow_video_update(device_t *device, bitmap_t &bitmap, const rectangle &cliprect) |
| 291 | { |
| 292 | vt_video_t *vt = get_safe_token(device); |
| 293 | |
| 294 | UINT16 addr = 0; |
| 295 | UINT16 attr_addr = 0; |
| 296 | int line = 0; |
| 297 | int xpos = 0; |
| 298 | int ypos = 0; |
| 299 | UINT8 code; |
| 300 | int x = 0; |
| 301 | UINT8 scroll_region = 1; // binary 1 |
| 302 | UINT8 display_type = 3; // binary 11 |
| 303 | UINT16 temp =0; |
| 304 | |
| 305 | while(line < (vt->height + vt->skip_lines)) { |
| 306 | code = vt->in_ram_func(addr + xpos); |
| 307 | if (code == 0xff) { |
| 308 | // end of line, fill empty till end of line |
| 309 | if (line >= vt->skip_lines) { |
| 310 | for(x = xpos; x < ((display_type==2) ? (vt->columns / 2) : vt->columns); x++ ) |
| 311 | { |
| 312 | vt_video_display_char(device,bitmap,code,x,ypos,scroll_region,display_type); |
| 313 | } |
| 314 | } |
| 315 | // move to new data |
| 316 | temp = vt->in_ram_func(addr+xpos+2)*256 + vt->in_ram_func(addr+xpos+1); |
| 317 | addr = (temp) & 0x0fff; |
| 318 | attr_addr = ((temp) & 0x1fff) - 2; |
| 319 | // if A12 is 1 then it is 0x2000 block, if 0 then 0x4000 (AVO) |
| 320 | if (temp & 0x1000) attr_addr &= 0xfff; else attr_addr |= 0x1000; |
| 321 | temp = vt->in_ram_func(attr_addr); |
| 322 | scroll_region = (temp) & 1; |
| 323 | display_type = (temp>> 1) & 3; |
| 324 | if (line >= vt->skip_lines) { |
| 325 | ypos++; |
| 326 | } |
| 327 | xpos=0; |
| 328 | line++; |
| 329 | } else { |
| 330 | // display regular char |
| 331 | if (line >= vt->skip_lines) { |
| 332 | vt_video_display_char(device,bitmap,code,xpos,ypos,scroll_region,display_type); |
| 333 | } |
| 334 | xpos++; |
| 335 | if (xpos > vt->columns) { |
| 336 | line++; |
| 337 | xpos=0; |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | } |
| 289 | 343 | /*------------------------------------------------- |
| 290 | 344 | DEVICE_START( vt_video ) |
| 291 | 345 | -------------------------------------------------*/ |
src/mess/drivers/rainbow.c
| r13859 | r13860 | |
| 5 | 5 | 04/01/2012 Skeleton driver. |
| 6 | 6 | |
| 7 | 7 | ****************************************************************************/ |
| 8 | | |
| 8 | #define ADDRESS_MAP_MODERN |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "cpu/i86/i86.h" |
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | #include "video/vtvideo.h" |
| 12 | 13 | |
| 13 | 14 | class rainbow_state : public driver_device |
| 14 | 15 | { |
| 15 | 16 | public: |
| 16 | 17 | rainbow_state(const machine_config &mconfig, device_type type, const char *tag) |
| 17 | | : driver_device(mconfig, type, tag) { } |
| 18 | : driver_device(mconfig, type, tag), |
| 19 | m_crtc(*this, "vt100_video") |
| 20 | { } |
| 21 | required_device<device_t> m_crtc; |
| 22 | UINT8 *m_p_ram; |
| 23 | |
| 24 | DECLARE_READ8_MEMBER(read_video_ram_r); |
| 25 | DECLARE_WRITE8_MEMBER(clear_video_interrupt); |
| 18 | 26 | }; |
| 19 | 27 | |
| 20 | 28 | |
| 21 | | static ADDRESS_MAP_START( rainbow8088_map, AS_PROGRAM, 8 ) |
| 29 | static ADDRESS_MAP_START( rainbow8088_map, AS_PROGRAM, 8, rainbow_state) |
| 22 | 30 | ADDRESS_MAP_UNMAP_HIGH |
| 23 | 31 | AM_RANGE(0x00000, 0x1ffff) AM_RAM |
| 24 | | AM_RANGE(0xec000, 0xeffff) AM_RAM |
| 32 | AM_RANGE(0xec000, 0xedfff) AM_RAM |
| 33 | AM_RANGE(0xee000, 0xeffff) AM_RAM AM_BASE(m_p_ram) |
| 25 | 34 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 26 | 35 | ADDRESS_MAP_END |
| 27 | 36 | |
| 28 | | static ADDRESS_MAP_START( rainbow8088_io , AS_IO, 8) |
| 37 | static ADDRESS_MAP_START( rainbow8088_io , AS_IO, 8, rainbow_state) |
| 29 | 38 | ADDRESS_MAP_UNMAP_HIGH |
| 39 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 40 | // 0x04 Video processor DC011 |
| 41 | AM_RANGE (0x04, 0x04) AM_DEVWRITE_LEGACY("vt100_video", vt_video_dc011_w) |
| 42 | // 0x0C Video processor DC012 |
| 43 | AM_RANGE (0x0c, 0x0c) AM_DEVWRITE_LEGACY("vt100_video", vt_video_dc012_w) |
| 30 | 44 | ADDRESS_MAP_END |
| 31 | 45 | |
| 32 | | static ADDRESS_MAP_START(rainbowz80_mem, AS_PROGRAM, 8) |
| 46 | static ADDRESS_MAP_START(rainbowz80_mem, AS_PROGRAM, 8, rainbow_state) |
| 33 | 47 | ADDRESS_MAP_UNMAP_HIGH |
| 34 | 48 | AM_RANGE( 0x0000, 0xffff ) AM_RAM |
| 35 | 49 | ADDRESS_MAP_END |
| 36 | 50 | |
| 37 | | static ADDRESS_MAP_START( rainbowz80_io , AS_IO, 8) |
| 51 | static ADDRESS_MAP_START( rainbowz80_io , AS_IO, 8, rainbow_state) |
| 38 | 52 | ADDRESS_MAP_UNMAP_HIGH |
| 53 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 39 | 54 | ADDRESS_MAP_END |
| 40 | 55 | |
| 41 | 56 | /* Input ports */ |
| r13859 | r13860 | |
| 47 | 62 | { |
| 48 | 63 | } |
| 49 | 64 | |
| 50 | | static VIDEO_START( rainbow ) |
| 65 | static SCREEN_UPDATE( rainbow ) |
| 51 | 66 | { |
| 67 | device_t *devconf = screen.machine().device("vt100_video"); |
| 68 | rainbow_video_update( devconf, bitmap, cliprect); |
| 69 | return 0; |
| 52 | 70 | } |
| 53 | 71 | |
| 54 | | static SCREEN_UPDATE( rainbow ) |
| 72 | READ8_MEMBER( rainbow_state::read_video_ram_r ) |
| 55 | 73 | { |
| 56 | | return 0; |
| 74 | return m_p_ram[offset]; |
| 57 | 75 | } |
| 58 | 76 | |
| 77 | WRITE8_MEMBER( rainbow_state::clear_video_interrupt ) |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | static const vt_video_interface video_interface = |
| 82 | { |
| 83 | "screen", |
| 84 | "chargen", |
| 85 | DEVCB_DRIVER_MEMBER(rainbow_state, read_video_ram_r), |
| 86 | DEVCB_DRIVER_MEMBER(rainbow_state, clear_video_interrupt) |
| 87 | }; |
| 88 | |
| 59 | 89 | static MACHINE_CONFIG_START( rainbow, rainbow_state ) |
| 60 | 90 | /* basic machine hardware */ |
| 61 | 91 | MCFG_CPU_ADD("maincpu",I8088, 4772720) |
| r13859 | r13860 | |
| 69 | 99 | |
| 70 | 100 | MCFG_MACHINE_RESET(rainbow) |
| 71 | 101 | |
| 72 | | /* video hardware */ |
| 73 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 74 | | MCFG_SCREEN_REFRESH_RATE(50) |
| 75 | | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 76 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 77 | | MCFG_SCREEN_SIZE(640, 480) |
| 78 | | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 79 | | MCFG_SCREEN_UPDATE(rainbow) |
| 80 | | MCFG_PALETTE_LENGTH(2) |
| 81 | | MCFG_PALETTE_INIT(black_and_white) |
| 102 | /* video hardware */ |
| 103 | MCFG_SCREEN_ADD("screen", RASTER) |
| 104 | MCFG_SCREEN_REFRESH_RATE(60) |
| 105 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 106 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 107 | MCFG_SCREEN_SIZE(80*10, 25*10) |
| 108 | MCFG_SCREEN_VISIBLE_AREA(0, 80*10-1, 0, 25*10-1) |
| 109 | MCFG_SCREEN_UPDATE(rainbow) |
| 82 | 110 | |
| 83 | | MCFG_VIDEO_START(rainbow) |
| 111 | MCFG_PALETTE_LENGTH(2) |
| 112 | MCFG_PALETTE_INIT(monochrome_green) |
| 113 | |
| 114 | MCFG_VT100_VIDEO_ADD("vt100_video", video_interface) |
| 84 | 115 | MACHINE_CONFIG_END |
| 85 | 116 | |
| 86 | 117 | /* ROM definition */ |
| r13859 | r13860 | |
| 90 | 121 | ROM_RELOAD(0xf4000,0x4000) |
| 91 | 122 | ROM_LOAD( "rbhigh.16k", 0xf8000, 0x4000, CRC(8638712f) SHA1(8269b0d95dc6efbe67d500dac3999df4838625d8)) |
| 92 | 123 | ROM_RELOAD(0xfc000,0x4000) |
| 124 | ROM_REGION(0x1000, "chargen", 0) |
| 125 | // Taken from VT100 but it's 4KB by documentation |
| 126 | ROM_LOAD( "23-018e2-00.e4", 0x0000, 0x0800, BAD_DUMP CRC(6958458b) SHA1(103429674fc01c215bbc2c91962ae99231f8ae53)) |
| 93 | 127 | ROM_END |
| 94 | 128 | |
| 95 | 129 | /* Driver */ |
| 96 | 130 | |
| 97 | 131 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 98 | | COMP( ????, rainbow, 0, 0, rainbow, rainbow, 0, "Digital Equipment Corporation", "Rainbow 100B", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 132 | COMP( 1982, rainbow, 0, 0, rainbow, rainbow, 0, "Digital Equipment Corporation", "Rainbow 100B", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 99 | 133 | |