trunk/src/emu/video/upd3301.h
| r17839 | r17840 | |
| 66 | 66 | |
| 67 | 67 | // ======================> upd3301_display_pixels_func |
| 68 | 68 | |
| 69 | | typedef void (*upd3301_display_pixels_func)(device_t *device, bitmap_ind16 &bitmap, int y, int sx, UINT8 cc, UINT8 lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa); |
| 70 | | #define UPD3301_DISPLAY_PIXELS(name) void name(device_t *device, bitmap_ind16 &bitmap, int y, int sx, UINT8 cc, UINT8 lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa) |
| 69 | typedef void (*upd3301_display_pixels_func)(device_t *device, bitmap_rgb32 &bitmap, int y, int sx, UINT8 cc, UINT8 lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa); |
| 70 | #define UPD3301_DISPLAY_PIXELS(name) void name(device_t *device, bitmap_rgb32 &bitmap, int y, int sx, UINT8 cc, UINT8 lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa) |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | // ======================> upd3301_interface |
| r17839 | r17840 | |
| 103 | 103 | DECLARE_READ_LINE_MEMBER( hrtc_r ); |
| 104 | 104 | DECLARE_READ_LINE_MEMBER( vrtc_r ); |
| 105 | 105 | |
| 106 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 106 | UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 107 | 107 | |
| 108 | 108 | protected: |
| 109 | 109 | // device-level overrides |
| r17839 | r17840 | |
| 136 | 136 | screen_device *m_screen; |
| 137 | 137 | |
| 138 | 138 | // screen drawing |
| 139 | | bitmap_ind16 *m_bitmap; // bitmap |
| 139 | bitmap_rgb32 *m_bitmap; // bitmap |
| 140 | 140 | int m_y; // current scanline |
| 141 | 141 | int m_hrtc; // horizontal retrace |
| 142 | 142 | int m_vrtc; // vertical retrace |
trunk/src/emu/sound/cdp1869.c
| r17839 | r17840 | |
| 461 | 461 | |
| 462 | 462 | for (i = 0; i < 8; i++) |
| 463 | 463 | { |
| 464 | | palette_set_color(machine(), i, get_rgb(i, i, 15)); |
| 464 | m_palette[i] = get_rgb(i, i, 15); |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | // tone-on-tone display (CFC=1) |
| r17839 | r17840 | |
| 469 | 469 | { |
| 470 | 470 | for (int l = 0; l < 8; l++) |
| 471 | 471 | { |
| 472 | | palette_set_color(machine(), i, get_rgb(i, c, l)); |
| 472 | m_palette[i] = get_rgb(i, c, l); |
| 473 | 473 | i++; |
| 474 | 474 | } |
| 475 | 475 | } |
| r17839 | r17840 | |
| 544 | 544 | // draw_line - draw character line |
| 545 | 545 | //------------------------------------------------- |
| 546 | 546 | |
| 547 | | void cdp1869_device::draw_line(bitmap_ind16 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color) |
| 547 | void cdp1869_device::draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color) |
| 548 | 548 | { |
| 549 | 549 | int i; |
| 550 | 550 | |
| r17839 | r17840 | |
| 554 | 554 | { |
| 555 | 555 | if (data & 0x80) |
| 556 | 556 | { |
| 557 | | bitmap.pix16(y, x) = color; |
| 557 | bitmap.pix32(y, x) = m_palette[color]; |
| 558 | 558 | |
| 559 | 559 | if (!m_fresvert) |
| 560 | 560 | { |
| 561 | | bitmap.pix16(y + 1, x) = color; |
| 561 | bitmap.pix32(y + 1, x) = m_palette[color]; |
| 562 | 562 | } |
| 563 | 563 | |
| 564 | 564 | if (!m_freshorz) |
| 565 | 565 | { |
| 566 | | bitmap.pix16(y, x + 1) = color; |
| 566 | bitmap.pix32(y, x + 1) = m_palette[color]; |
| 567 | 567 | |
| 568 | 568 | if (!m_fresvert) |
| 569 | 569 | { |
| 570 | | bitmap.pix16(y + 1, x + 1) = color; |
| 570 | bitmap.pix32(y + 1, x + 1) = m_palette[color]; |
| 571 | 571 | } |
| 572 | 572 | } |
| 573 | 573 | } |
| r17839 | r17840 | |
| 588 | 588 | // draw_char - draw character |
| 589 | 589 | //------------------------------------------------- |
| 590 | 590 | |
| 591 | | void cdp1869_device::draw_char(bitmap_ind16 &bitmap, const rectangle &rect, int x, int y, UINT16 pma) |
| 591 | void cdp1869_device::draw_char(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT16 pma) |
| 592 | 592 | { |
| 593 | 593 | UINT8 pmd = read_page_ram_byte(pma); |
| 594 | 594 | |
| r17839 | r17840 | |
| 912 | 912 | // update_screen - update screen |
| 913 | 913 | //------------------------------------------------- |
| 914 | 914 | |
| 915 | | UINT32 cdp1869_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 915 | UINT32 cdp1869_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 916 | 916 | { |
| 917 | 917 | rectangle screen_rect, outer; |
| 918 | 918 | |
trunk/src/emu/sound/cdp1869.h
| r17839 | r17840 | |
| 145 | 145 | #define MCFG_CDP1869_SCREEN_PAL_ADD(_cdptag, _tag, _clock) \ |
| 146 | 146 | MCFG_SCREEN_ADD(_tag, RASTER) \ |
| 147 | 147 | MCFG_SCREEN_UPDATE_DEVICE(_cdptag, cdp1869_device, screen_update) \ |
| 148 | | MCFG_SCREEN_RAW_PARAMS(_clock, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL) \ |
| 149 | | MCFG_PALETTE_LENGTH(8+64) |
| 148 | MCFG_SCREEN_RAW_PARAMS(_clock, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL) |
| 150 | 149 | |
| 151 | 150 | #define MCFG_CDP1869_SCREEN_NTSC_ADD(_cdptag, _tag, _clock) \ |
| 152 | 151 | MCFG_SCREEN_ADD(_tag, RASTER) \ |
| 153 | 152 | MCFG_SCREEN_UPDATE_DEVICE(_cdptag, cdp1869_device, screen_update) \ |
| 154 | | MCFG_SCREEN_RAW_PARAMS(_clock, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_NTSC, CDP1869_SCANLINE_VBLANK_END_NTSC, CDP1869_SCANLINE_VBLANK_START_NTSC) \ |
| 155 | | MCFG_PALETTE_LENGTH(8+64) |
| 153 | MCFG_SCREEN_RAW_PARAMS(_clock, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_NTSC, CDP1869_SCANLINE_VBLANK_END_NTSC, CDP1869_SCANLINE_VBLANK_START_NTSC) |
| 156 | 154 | |
| 157 | 155 | #define CDP1869_INTERFACE(_name) \ |
| 158 | 156 | const cdp1869_interface (_name) = |
| r17839 | r17840 | |
| 231 | 229 | DECLARE_READ_LINE_MEMBER( predisplay_r ); |
| 232 | 230 | DECLARE_READ_LINE_MEMBER( pal_ntsc_r ); |
| 233 | 231 | |
| 234 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 232 | UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 235 | 233 | |
| 236 | 234 | protected: |
| 237 | 235 | // device-level overrides |
| r17839 | r17840 | |
| 260 | 258 | inline int get_pen(int ccb0, int ccb1, int pcb); |
| 261 | 259 | |
| 262 | 260 | void initialize_palette(); |
| 263 | | void draw_line(bitmap_ind16 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color); |
| 264 | | void draw_char(bitmap_ind16 &bitmap, const rectangle &rect, int x, int y, UINT16 pma); |
| 261 | void draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color); |
| 262 | void draw_char(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT16 pma); |
| 265 | 263 | |
| 266 | 264 | private: |
| 267 | 265 | devcb_resolved_read_line m_in_pal_ntsc_func; |
| r17839 | r17840 | |
| 276 | 274 | sound_stream *m_stream; |
| 277 | 275 | |
| 278 | 276 | // video state |
| 277 | rgb_t m_palette[8+64]; |
| 279 | 278 | int m_prd; // predisplay |
| 280 | 279 | int m_dispoff; // display off |
| 281 | 280 | int m_fresvert; // full resolution vertical |
trunk/src/mess/machine/wangpc_mvc.c
| r17839 | r17840 | |
| 47 | 47 | #define ATTR_SUBSCRIPT BIT(attr, 6) |
| 48 | 48 | #define ATTR_SUPERSCRIPT BIT(attr, 7) |
| 49 | 49 | |
| 50 | static const rgb_t PALETTE[] = |
| 51 | { |
| 52 | RGB_BLACK, |
| 53 | MAKE_RGB(0x00, 0x80, 0x00), |
| 54 | MAKE_RGB(0x00, 0xff, 0x00) |
| 55 | }; |
| 50 | 56 | |
| 51 | 57 | |
| 58 | |
| 52 | 59 | //************************************************************************** |
| 53 | 60 | // DEVICE DEFINITIONS |
| 54 | 61 | //************************************************************************** |
| r17839 | r17840 | |
| 62 | 69 | |
| 63 | 70 | void wangpc_mvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 64 | 71 | { |
| 65 | | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 66 | | |
| 67 | 72 | for (int sx = 0; sx < 50; sx++) |
| 68 | 73 | { |
| 69 | 74 | offs_t addr = (y * 50) + sx; |
| r17839 | r17840 | |
| 74 | 79 | int x = (sx * 16) + bit; |
| 75 | 80 | int color = BIT(data, 15); |
| 76 | 81 | |
| 77 | | bitmap.pix32(y, x) = palette[color]; |
| 82 | bitmap.pix32(y, x) = PALETTE[color]; |
| 78 | 83 | |
| 79 | 84 | data <<= 1; |
| 80 | 85 | } |
| r17839 | r17840 | |
| 110 | 115 | int color = ((BIT(data, 9) & !ATTR_BLANK) ^ ATTR_REVERSE); |
| 111 | 116 | |
| 112 | 117 | if ((color | bitmap.pix32(y, x)) & ATTR_BOLD) color = 2; |
| 113 | | if (color) bitmap.pix32(y, x) = palette[color]; |
| 118 | if (color) bitmap.pix32(y, x) = PALETTE[color]; |
| 114 | 119 | |
| 115 | 120 | data <<= 1; |
| 116 | 121 | } |
| r17839 | r17840 | |
| 159 | 164 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 160 | 165 | MCFG_SCREEN_REFRESH_RATE(60) |
| 161 | 166 | |
| 162 | | MCFG_PALETTE_LENGTH(3) |
| 163 | | |
| 164 | 167 | MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, XTAL_14_31818MHz/16, crtc_intf) |
| 165 | 168 | MACHINE_CONFIG_END |
| 166 | 169 | |
| r17839 | r17840 | |
| 223 | 226 | m_char_ram = auto_alloc_array(machine(), UINT16, CHAR_RAM_SIZE); |
| 224 | 227 | m_bitmap_ram = auto_alloc_array(machine(), UINT16, BITMAP_RAM_SIZE); |
| 225 | 228 | |
| 226 | | // initialize palette |
| 227 | | palette_set_color_rgb(machine(), 0, 0, 0, 0); |
| 228 | | palette_set_color_rgb(machine(), 1, 0, 0x80, 0); |
| 229 | | palette_set_color_rgb(machine(), 2, 0, 0xff, 0); |
| 230 | | |
| 231 | 229 | // state saving |
| 232 | 230 | save_pointer(NAME(m_video_ram), VIDEO_RAM_SIZE); |
| 233 | 231 | save_pointer(NAME(m_char_ram), CHAR_RAM_SIZE); |
trunk/src/mess/video/pc1512.c
| r17839 | r17840 | |
| 9 | 9 | #define LOG 0 |
| 10 | 10 | |
| 11 | 11 | |
| 12 | static const rgb_t PALETTE[] = |
| 13 | { |
| 14 | RGB_BLACK, |
| 15 | MAKE_RGB(0x00, 0x00, 0xaa), |
| 16 | MAKE_RGB(0x00, 0xaa, 0x00), |
| 17 | MAKE_RGB(0x00, 0xaa, 0xaa), |
| 18 | MAKE_RGB(0xaa, 0x00, 0x00), |
| 19 | MAKE_RGB(0xaa, 0x00, 0xaa), |
| 20 | MAKE_RGB(0xaa, 0x55, 0x00), |
| 21 | MAKE_RGB(0xaa, 0xaa, 0xaa), |
| 22 | MAKE_RGB(0x55, 0x55, 0x55), |
| 23 | MAKE_RGB(0x55, 0x55, 0xff), |
| 24 | MAKE_RGB(0x55, 0xff, 0x55), |
| 25 | MAKE_RGB(0x55, 0xff, 0xff), |
| 26 | MAKE_RGB(0xff, 0x55, 0x55), |
| 27 | MAKE_RGB(0xff, 0x55, 0xff), |
| 28 | MAKE_RGB(0xff, 0xff, 0x55), |
| 29 | RGB_WHITE |
| 30 | }; |
| 31 | |
| 12 | 32 | static const int PALETTE_0[] = { 0, 3, 5, 7 }; |
| 13 | 33 | static const int PALETTE_1[] = { 0, 2, 4, 6 }; |
| 14 | 34 | static const int PALETTE_2[] = { 0, 3, 4, 7 }; |
| r17839 | r17840 | |
| 43 | 63 | |
| 44 | 64 | |
| 45 | 65 | //************************************************************************** |
| 46 | | // PALETTE |
| 47 | | //************************************************************************** |
| 48 | | |
| 49 | | //------------------------------------------------- |
| 50 | | // PALETTE_INIT( pc1512 ) |
| 51 | | //------------------------------------------------- |
| 52 | | |
| 53 | | static PALETTE_INIT( pc1512 ) |
| 54 | | { |
| 55 | | palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00); |
| 56 | | palette_set_color_rgb(machine, 1, 0x00, 0x00, 0xaa); |
| 57 | | palette_set_color_rgb(machine, 2, 0x00, 0xaa, 0x00); |
| 58 | | palette_set_color_rgb(machine, 3, 0x00, 0xaa, 0xaa); |
| 59 | | palette_set_color_rgb(machine, 4, 0xaa, 0x00, 0x00); |
| 60 | | palette_set_color_rgb(machine, 5, 0xaa, 0x00, 0xaa); |
| 61 | | palette_set_color_rgb(machine, 6, 0xaa, 0x55, 0x00); |
| 62 | | palette_set_color_rgb(machine, 7, 0xaa, 0xaa, 0xaa); |
| 63 | | palette_set_color_rgb(machine, 8, 0x55, 0x55, 0x55); |
| 64 | | palette_set_color_rgb(machine, 9, 0x55, 0x55, 0xff); |
| 65 | | palette_set_color_rgb(machine, 10, 0x55, 0xff, 0x55); |
| 66 | | palette_set_color_rgb(machine, 11, 0x55, 0xff, 0xff); |
| 67 | | palette_set_color_rgb(machine, 12, 0xff, 0x55, 0x55); |
| 68 | | palette_set_color_rgb(machine, 13, 0xff, 0x55, 0xff); |
| 69 | | palette_set_color_rgb(machine, 14, 0xff, 0xff, 0x55); |
| 70 | | palette_set_color_rgb(machine, 15, 0xff, 0xff, 0xff); |
| 71 | | } |
| 72 | | |
| 73 | | |
| 74 | | |
| 75 | | //************************************************************************** |
| 76 | 66 | // VIDEO RAM ACCESS |
| 77 | 67 | //************************************************************************** |
| 78 | 68 | |
| r17839 | r17840 | |
| 403 | 393 | return ((ioport("LK")->read() >> 5) & 0x03) << 11; |
| 404 | 394 | } |
| 405 | 395 | |
| 406 | | void pc1512_state::draw_alpha(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 396 | void pc1512_state::draw_alpha(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 407 | 397 | { |
| 408 | 398 | offs_t char_rom_offset = get_char_rom_offset(); |
| 409 | | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 410 | 399 | UINT32 *p = &bitmap.pix32(y + VFP_HIRES, HFP_HIRES); |
| 411 | 400 | |
| 412 | 401 | if (get_display_mode(m_vdu_mode) == ALPHA_40) |
| r17839 | r17840 | |
| 443 | 432 | { |
| 444 | 433 | int color = BIT(data, 7) ? fg : bg; |
| 445 | 434 | |
| 446 | | *p = palette[color]; p++; |
| 435 | *p = PALETTE[color]; p++; |
| 447 | 436 | |
| 448 | 437 | data <<= 1; |
| 449 | 438 | } |
| r17839 | r17840 | |
| 473 | 462 | return color; |
| 474 | 463 | }; |
| 475 | 464 | |
| 476 | | void pc1512_state::draw_graphics_1(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 465 | void pc1512_state::draw_graphics_1(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 477 | 466 | { |
| 478 | 467 | if (y > 199) return; |
| 479 | 468 | |
| 480 | 469 | UINT32 *p = &bitmap.pix32(y + VFP_LORES, HFP_LORES); |
| 481 | | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 482 | 470 | |
| 483 | 471 | for (int column = 0; column < x_count; column++) |
| 484 | 472 | { |
| r17839 | r17840 | |
| 488 | 476 | |
| 489 | 477 | for (int x = 0; x < 8; x++) |
| 490 | 478 | { |
| 491 | | *p = palette[get_color((BIT(b, 15) << 1) | BIT(b, 14))]; p++; |
| 479 | *p = PALETTE[get_color((BIT(b, 15) << 1) | BIT(b, 14))]; p++; |
| 492 | 480 | b <<= 2; |
| 493 | 481 | } |
| 494 | 482 | } |
| 495 | 483 | } |
| 496 | 484 | |
| 497 | | void pc1512_state::draw_graphics_2(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 485 | void pc1512_state::draw_graphics_2(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 498 | 486 | { |
| 499 | 487 | if (y > 199) return; |
| 500 | 488 | |
| 501 | 489 | UINT32 *p = &bitmap.pix32(y + VFP_HIRES, HFP_HIRES); |
| 502 | | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 503 | 490 | |
| 504 | 491 | for (int column = 0; column < x_count; column++) |
| 505 | 492 | { |
| r17839 | r17840 | |
| 512 | 499 | |
| 513 | 500 | for (int x = 0; x < 16; x++) |
| 514 | 501 | { |
| 515 | | *p = palette[(BIT(i, 15) << 3) | (BIT(r, 15) << 2) | (BIT(g, 15) << 1) | BIT(b, 15)]; p++; |
| 502 | *p = PALETTE[(BIT(i, 15) << 3) | (BIT(r, 15) << 2) | (BIT(g, 15) << 1) | BIT(b, 15)]; p++; |
| 516 | 503 | i <<= 1; r <<= 1; g <<= 1; b <<= 1; |
| 517 | 504 | } |
| 518 | 505 | } |
| r17839 | r17840 | |
| 526 | 513 | { |
| 527 | 514 | case ALPHA_40: |
| 528 | 515 | case ALPHA_80: |
| 529 | | state->draw_alpha(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); |
| 516 | state->draw_alpha(bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); |
| 530 | 517 | break; |
| 531 | 518 | |
| 532 | 519 | case GRAPHICS_1: |
| 533 | | state->draw_graphics_1(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); |
| 520 | state->draw_graphics_1(bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); |
| 534 | 521 | break; |
| 535 | 522 | |
| 536 | 523 | case GRAPHICS_2: |
| 537 | | state->draw_graphics_2(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); |
| 524 | state->draw_graphics_2(bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); |
| 538 | 525 | break; |
| 539 | 526 | } |
| 540 | 527 | } |
| r17839 | r17840 | |
| 574 | 561 | |
| 575 | 562 | UINT32 pc1512_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 576 | 563 | { |
| 577 | | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 578 | 564 | if (m_vdu_mode & MODE_ENABLE_VIDEO) |
| 579 | 565 | { |
| 580 | 566 | m_blink_ctr++; |
| r17839 | r17840 | |
| 608 | 594 | case ALPHA_40: |
| 609 | 595 | case ALPHA_80: |
| 610 | 596 | case GRAPHICS_1: |
| 611 | | bitmap.fill(palette[m_vdu_color & 0x0f], cliprect); |
| 597 | bitmap.fill(PALETTE[m_vdu_color & 0x0f], cliprect); |
| 612 | 598 | break; |
| 613 | 599 | |
| 614 | 600 | case GRAPHICS_2: |
| 615 | | bitmap.fill(palette[m_vdu_border & 0x0f], cliprect); |
| 601 | bitmap.fill(PALETTE[m_vdu_border & 0x0f], cliprect); |
| 616 | 602 | break; |
| 617 | 603 | } |
| 618 | 604 | |
| r17839 | r17840 | |
| 620 | 606 | } |
| 621 | 607 | else |
| 622 | 608 | { |
| 623 | | bitmap.fill(palette[0], cliprect); |
| 609 | bitmap.fill(RGB_BLACK, cliprect); |
| 624 | 610 | } |
| 625 | 611 | |
| 626 | 612 | return 0; |
| r17839 | r17840 | |
| 639 | 625 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 640 | 626 | MCFG_SCREEN_REFRESH_RATE(50) |
| 641 | 627 | |
| 642 | | MCFG_PALETTE_LENGTH(16) |
| 643 | | MCFG_PALETTE_INIT(pc1512) |
| 644 | | |
| 645 | 628 | MCFG_MC6845_ADD(AMS40041_TAG, AMS40041, XTAL_28_63636MHz/32, crtc_intf) |
| 646 | 629 | MACHINE_CONFIG_END |
trunk/src/mess/video/cgc7900.c
| r17839 | r17840 | |
| 22 | 22 | #define OVERLAY_CURSOR_BLINK BIT(m_roll_overlay[0], 12) |
| 23 | 23 | #define OVERLAY_CHARACTER_BLINK BIT(m_roll_overlay[0], 11) |
| 24 | 24 | |
| 25 | static const rgb_t PALETTE[] = |
| 26 | { |
| 27 | RGB_BLACK, |
| 28 | MAKE_RGB(0x00, 0x00, 0xff), |
| 29 | MAKE_RGB(0x00, 0xff, 0x00), |
| 30 | MAKE_RGB(0x00, 0xff, 0xff), |
| 31 | MAKE_RGB(0xff, 0x00, 0x00), |
| 32 | MAKE_RGB(0xff, 0x00, 0xff), |
| 33 | MAKE_RGB(0xff, 0xff, 0x00), |
| 34 | RGB_WHITE |
| 35 | }; |
| 36 | |
| 25 | 37 | /*************************************************************************** |
| 26 | 38 | READ/WRITE HANDLERS |
| 27 | 39 | ***************************************************************************/ |
| r17839 | r17840 | |
| 101 | 113 | UINT8 g = (data >> 8) & 0xff; |
| 102 | 114 | UINT8 r = (data >> 16) & 0xff; |
| 103 | 115 | |
| 104 | | palette_set_color_rgb(machine(), i + 8, r, g, b); |
| 116 | m_clut[i] = MAKE_RGB(r, g, b); |
| 105 | 117 | } |
| 106 | 118 | } |
| 107 | 119 | |
| r17839 | r17840 | |
| 109 | 121 | draw_bitmap - draw bitmap image |
| 110 | 122 | -------------------------------------------------*/ |
| 111 | 123 | |
| 112 | | void cgc7900_state::draw_bitmap(screen_device *screen, bitmap_ind16 &bitmap) |
| 124 | void cgc7900_state::draw_bitmap(screen_device *screen, bitmap_rgb32 &bitmap) |
| 113 | 125 | { |
| 114 | 126 | } |
| 115 | 127 | |
| r17839 | r17840 | |
| 117 | 129 | draw_overlay - draw text overlay |
| 118 | 130 | -------------------------------------------------*/ |
| 119 | 131 | |
| 120 | | void cgc7900_state::draw_overlay(screen_device *screen, bitmap_ind16 &bitmap) |
| 132 | void cgc7900_state::draw_overlay(screen_device *screen, bitmap_rgb32 &bitmap) |
| 121 | 133 | { |
| 122 | 134 | for (int y = 0; y < 768; y++) |
| 123 | 135 | { |
| r17839 | r17840 | |
| 138 | 150 | { |
| 139 | 151 | if (!OVERLAY_CURSOR_BLINK || m_blink) |
| 140 | 152 | { |
| 141 | | bitmap.pix16(y, (sx * 8) + x) = 7; |
| 153 | bitmap.pix32(y, (sx * 8) + x) = PALETTE[7]; |
| 142 | 154 | } |
| 143 | 155 | } |
| 144 | 156 | else |
| 145 | 157 | { |
| 146 | 158 | if (BIT(data, x) && (!OVERLAY_CHARACTER_BLINK || m_blink)) |
| 147 | 159 | { |
| 148 | | if (OVERLAY_VF) bitmap.pix16(y, (sx * 8) + x) = fg; |
| 160 | if (OVERLAY_VF) bitmap.pix32(y, (sx * 8) + x) = PALETTE[fg]; |
| 149 | 161 | } |
| 150 | 162 | else |
| 151 | 163 | { |
| 152 | | if (OVERLAY_VB) bitmap.pix16(y, (sx * 8) + x) = bg; |
| 164 | if (OVERLAY_VB) bitmap.pix32(y, (sx * 8) + x) = PALETTE[bg]; |
| 153 | 165 | } |
| 154 | 166 | } |
| 155 | 167 | } |
| r17839 | r17840 | |
| 169 | 181 | } |
| 170 | 182 | |
| 171 | 183 | /*------------------------------------------------- |
| 172 | | PALETTE_INIT( cgc7900 ) |
| 173 | | -------------------------------------------------*/ |
| 174 | | |
| 175 | | static PALETTE_INIT( cgc7900 ) |
| 176 | | { |
| 177 | | palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00 ); |
| 178 | | palette_set_color_rgb(machine, 1, 0x00, 0x00, 0xff ); |
| 179 | | palette_set_color_rgb(machine, 2, 0x00, 0xff, 0x00 ); |
| 180 | | palette_set_color_rgb(machine, 3, 0x00, 0xff, 0xff ); |
| 181 | | palette_set_color_rgb(machine, 4, 0xff, 0x00, 0x00 ); |
| 182 | | palette_set_color_rgb(machine, 5, 0xff, 0x00, 0xff ); |
| 183 | | palette_set_color_rgb(machine, 6, 0xff, 0xff, 0x00 ); |
| 184 | | palette_set_color_rgb(machine, 7, 0xff, 0xff, 0xff ); |
| 185 | | } |
| 186 | | |
| 187 | | /*------------------------------------------------- |
| 188 | 184 | VIDEO_START( cgc7900 ) |
| 189 | 185 | -------------------------------------------------*/ |
| 190 | 186 | |
| r17839 | r17840 | |
| 198 | 194 | SCREEN_UPDATE_IND16( cgc7900 ) |
| 199 | 195 | -------------------------------------------------*/ |
| 200 | 196 | |
| 201 | | UINT32 cgc7900_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 197 | UINT32 cgc7900_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 202 | 198 | { |
| 203 | 199 | update_clut(); |
| 204 | 200 | draw_bitmap(&screen, bitmap); |
| r17839 | r17840 | |
| 248 | 244 | |
| 249 | 245 | MCFG_GFXDECODE(cgc7900) |
| 250 | 246 | |
| 251 | | MCFG_PALETTE_LENGTH(8+256) /* 8 overlay colors + 256 bitmap colors */ |
| 252 | | MCFG_PALETTE_INIT(cgc7900) |
| 253 | | |
| 254 | 247 | MCFG_TIMER_ADD_PERIODIC("blink", blink_tick, attotime::from_hz(XTAL_28_48MHz/7500000)) |
| 255 | 248 | MACHINE_CONFIG_END |
trunk/src/mess/video/zx8301.c
| r17839 | r17840 | |
| 33 | 33 | static const int ZX8301_COLOR_MODE4[] = { 0, 2, 4, 7 }; |
| 34 | 34 | |
| 35 | 35 | |
| 36 | static const rgb_t PALETTE[] = |
| 37 | { |
| 38 | MAKE_RGB(0x00, 0x00, 0x00), // black |
| 39 | MAKE_RGB(0x00, 0x00, 0xff), // blue |
| 40 | MAKE_RGB(0xff, 0x00, 0x00), // red |
| 41 | MAKE_RGB(0xff, 0x00, 0xff), // magenta |
| 42 | MAKE_RGB(0x00, 0xff, 0x00), // green |
| 43 | MAKE_RGB(0x00, 0xff, 0xff), // cyan |
| 44 | MAKE_RGB(0xff, 0xff, 0x00), // yellow |
| 45 | MAKE_RGB(0xff, 0xff, 0xff) // white |
| 46 | }; |
| 36 | 47 | |
| 48 | |
| 49 | |
| 37 | 50 | //************************************************************************** |
| 38 | 51 | // GLOBAL VARIABLES |
| 39 | 52 | //************************************************************************** |
| r17839 | r17840 | |
| 254 | 267 | // draw_line_mode4 - draw mode 4 line |
| 255 | 268 | //------------------------------------------------- |
| 256 | 269 | |
| 257 | | void zx8301_device::draw_line_mode4(bitmap_ind16 &bitmap, int y, UINT16 da) |
| 270 | void zx8301_device::draw_line_mode4(bitmap_rgb32 &bitmap, int y, UINT16 da) |
| 258 | 271 | { |
| 259 | 272 | int x = 0; |
| 260 | 273 | |
| r17839 | r17840 | |
| 269 | 282 | int green = BIT(byte_high, 7); |
| 270 | 283 | int color = (green << 1) | red; |
| 271 | 284 | |
| 272 | | bitmap.pix16(y, x++) = ZX8301_COLOR_MODE4[color]; |
| 285 | bitmap.pix32(y, x++) = PALETTE[ZX8301_COLOR_MODE4[color]]; |
| 273 | 286 | |
| 274 | 287 | byte_high <<= 1; |
| 275 | 288 | byte_low <<= 1; |
| r17839 | r17840 | |
| 282 | 295 | // draw_line_mode8 - draw mode 8 line |
| 283 | 296 | //------------------------------------------------- |
| 284 | 297 | |
| 285 | | void zx8301_device::draw_line_mode8(bitmap_ind16 &bitmap, int y, UINT16 da) |
| 298 | void zx8301_device::draw_line_mode8(bitmap_rgb32 &bitmap, int y, UINT16 da) |
| 286 | 299 | { |
| 287 | 300 | int x = 0; |
| 288 | 301 | |
| r17839 | r17840 | |
| 305 | 318 | color = 0; |
| 306 | 319 | } |
| 307 | 320 | |
| 308 | | bitmap.pix16(y, x++) = color; |
| 309 | | bitmap.pix16(y, x++) = color; |
| 321 | bitmap.pix32(y, x++) = PALETTE[color]; |
| 322 | bitmap.pix32(y, x++) = PALETTE[color]; |
| 310 | 323 | |
| 311 | 324 | byte_high <<= 2; |
| 312 | 325 | byte_low <<= 2; |
| r17839 | r17840 | |
| 316 | 329 | |
| 317 | 330 | |
| 318 | 331 | //------------------------------------------------- |
| 319 | | // update_screen - |
| 332 | // screen_update - |
| 320 | 333 | //------------------------------------------------- |
| 321 | 334 | |
| 322 | | void zx8301_device::update_screen(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 335 | UINT32 zx8301_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 323 | 336 | { |
| 324 | 337 | if (!m_dispoff) |
| 325 | 338 | { |
| r17839 | r17840 | |
| 341 | 354 | } |
| 342 | 355 | else |
| 343 | 356 | { |
| 344 | | bitmap.fill(get_black_pen(machine()), cliprect); |
| 357 | bitmap.fill(RGB_BLACK, cliprect); |
| 345 | 358 | } |
| 359 | |
| 360 | return 0; |
| 346 | 361 | } |
trunk/src/mess/video/uv201.c
| r17839 | r17840 | |
| 81 | 81 | ((_y >= cliprect.min_y) && (_y <= cliprect.max_y)) |
| 82 | 82 | |
| 83 | 83 | #define DRAW_PIXEL(_scanline, _dot) \ |
| 84 | | if (IS_VISIBLE(_scanline)) bitmap.pix16((_scanline), HSYNC_WIDTH + HFP_WIDTH + _dot) = pixel; |
| 84 | if (IS_VISIBLE(_scanline)) bitmap.pix32((_scanline), HSYNC_WIDTH + HFP_WIDTH + _dot) = m_palette[pixel]; |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | |
| r17839 | r17840 | |
| 239 | 239 | onvalue = onhiintensity; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | | palette_set_color_rgb(machine(), offset + 0, offvalue, offvalue, offvalue); // black |
| 243 | | palette_set_color_rgb(machine(), offset + 1, onvalue, offvalue, offvalue); // red |
| 244 | | palette_set_color_rgb(machine(), offset + 2, offvalue, onvalue, offvalue); // green |
| 245 | | palette_set_color_rgb(machine(), offset + 3, onvalue, onvalue, offvalue); // red-green |
| 246 | | palette_set_color_rgb(machine(), offset + 4, offvalue, offvalue, onvalue); // blue |
| 247 | | palette_set_color_rgb(machine(), offset + 5, onvalue, offvalue, onvalue); // red-blue |
| 248 | | palette_set_color_rgb(machine(), offset + 6, offvalue, onvalue, onvalue); // green-blue |
| 249 | | palette_set_color_rgb(machine(), offset + 7, onvalue, onvalue, onvalue); // white |
| 242 | m_palette[offset + 0] = MAKE_RGB(offvalue, offvalue, offvalue); // black |
| 243 | m_palette[offset + 1] = MAKE_RGB(onvalue, offvalue, offvalue); // red |
| 244 | m_palette[offset + 2] = MAKE_RGB(offvalue, onvalue, offvalue); // green |
| 245 | m_palette[offset + 3] = MAKE_RGB(onvalue, onvalue, offvalue); // red-green |
| 246 | m_palette[offset + 4] = MAKE_RGB(offvalue, offvalue, onvalue); // blue |
| 247 | m_palette[offset + 5] = MAKE_RGB(onvalue, offvalue, onvalue); // red-blue |
| 248 | m_palette[offset + 6] = MAKE_RGB(offvalue, onvalue, onvalue); // green-blue |
| 249 | m_palette[offset + 7] = MAKE_RGB(onvalue, onvalue, onvalue); // white |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
| r17839 | r17840 | |
| 496 | 496 | // screen_update - |
| 497 | 497 | //------------------------------------------------- |
| 498 | 498 | |
| 499 | | UINT32 uv201_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 499 | UINT32 uv201_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 500 | 500 | { |
| 501 | 501 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 502 | 502 | |
trunk/src/mess/video/abc806.c
| r17839 | r17840 | |
| 24 | 24 | #define VERTICAL_PORCH_HACK 27 |
| 25 | 25 | |
| 26 | 26 | |
| 27 | | |
| 28 | | //------------------------------------------------- |
| 29 | | // PALETTE_INIT( abc806 ) |
| 30 | | //------------------------------------------------- |
| 31 | | |
| 32 | | static PALETTE_INIT( abc806 ) |
| 27 | static const rgb_t PALETTE[] = |
| 33 | 28 | { |
| 34 | | palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00); // black |
| 35 | | palette_set_color_rgb(machine, 1, 0xff, 0x00, 0x00); // red |
| 36 | | palette_set_color_rgb(machine, 2, 0x00, 0xff, 0x00); // green |
| 37 | | palette_set_color_rgb(machine, 3, 0xff, 0xff, 0x00); // yellow |
| 38 | | palette_set_color_rgb(machine, 4, 0x00, 0x00, 0xff); // blue |
| 39 | | palette_set_color_rgb(machine, 5, 0xff, 0x00, 0xff); // magenta |
| 40 | | palette_set_color_rgb(machine, 6, 0x00, 0xff, 0xff); // cyan |
| 41 | | palette_set_color_rgb(machine, 7, 0xff, 0xff, 0xff); // white |
| 42 | | } |
| 29 | RGB_BLACK, // black |
| 30 | MAKE_RGB(0xff, 0x00, 0x00), // red |
| 31 | MAKE_RGB(0x00, 0xff, 0x00), // green |
| 32 | MAKE_RGB(0xff, 0xff, 0x00), // yellow |
| 33 | MAKE_RGB(0x00, 0x00, 0xff), // blue |
| 34 | MAKE_RGB(0xff, 0x00, 0xff), // magenta |
| 35 | MAKE_RGB(0x00, 0xff, 0xff), // cyan |
| 36 | RGB_WHITE // white |
| 37 | }; |
| 43 | 38 | |
| 44 | 39 | |
| 45 | 40 | //------------------------------------------------- |
| r17839 | r17840 | |
| 242 | 237 | static MC6845_UPDATE_ROW( abc806_update_row ) |
| 243 | 238 | { |
| 244 | 239 | abc806_state *state = device->machine().driver_data<abc806_state>(); |
| 245 | | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 246 | 240 | |
| 247 | 241 | // UINT8 old_data = 0xff; |
| 248 | 242 | int fg_color = 7; |
| r17839 | r17840 | |
| 333 | 327 | { |
| 334 | 328 | int color = BIT(chargen_data, 7) ? fg_color : bg_color; |
| 335 | 329 | |
| 336 | | bitmap.pix32(y, x++) = palette[color]; |
| 330 | bitmap.pix32(y, x++) = PALETTE[color]; |
| 337 | 331 | |
| 338 | 332 | if (e5 || e6) |
| 339 | 333 | { |
| 340 | | bitmap.pix32(y, x++) = palette[color]; |
| 334 | bitmap.pix32(y, x++) = PALETTE[color]; |
| 341 | 335 | } |
| 342 | 336 | |
| 343 | 337 | chargen_data <<= 1; |
| r17839 | r17840 | |
| 436 | 430 | |
| 437 | 431 | void abc806_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 438 | 432 | { |
| 439 | | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 440 | 433 | UINT32 addr = (m_hrs & 0x0f) << 15; |
| 441 | 434 | |
| 442 | 435 | for (int y = m_sync + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_sync + VERTICAL_PORCH_HACK + 240); y++) |
| r17839 | r17840 | |
| 450 | 443 | { |
| 451 | 444 | int x = HORIZONTAL_PORCH_HACK + (ABC800_CHAR_WIDTH * 4) - 16 + (sx * 4) + pixel; |
| 452 | 445 | |
| 453 | | if (BIT(dot, 15) || bitmap.pix32(y, x) == palette[0]) |
| 446 | if (BIT(dot, 15) || (bitmap.pix32(y, x) == RGB_BLACK)) |
| 454 | 447 | { |
| 455 | | bitmap.pix32(y, x) = palette[(dot >> 12) & 0x07]; |
| 448 | bitmap.pix32(y, x) = PALETTE[(dot >> 12) & 0x07]; |
| 456 | 449 | } |
| 457 | 450 | |
| 458 | 451 | dot <<= 4; |
| r17839 | r17840 | |
| 547 | 540 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 548 | 541 | MCFG_SCREEN_SIZE(768, 312) |
| 549 | 542 | MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1) |
| 550 | | |
| 551 | | MCFG_PALETTE_LENGTH(8) |
| 552 | | |
| 553 | | MCFG_PALETTE_INIT(abc806) |
| 554 | 543 | MACHINE_CONFIG_END |
trunk/src/mess/drivers/studio2.c
| r17839 | r17840 | |
| 305 | 305 | DEVCB_CPU_INPUT_LINE(CDP1802_TAG, COSMAC_INPUT_LINE_EF1) |
| 306 | 306 | }; |
| 307 | 307 | |
| 308 | | static PALETTE_INIT( visicom ) |
| 308 | static const rgb_t VISICOM_PALETTE[] = |
| 309 | 309 | { |
| 310 | | palette_set_color_rgb(machine, 0, 0x00, 0x80, 0x00); |
| 311 | | palette_set_color_rgb(machine, 1, 0x00, 0x00, 0xff); |
| 312 | | palette_set_color_rgb(machine, 2, 0x00, 0xff, 0x00); |
| 313 | | palette_set_color_rgb(machine, 3, 0xff, 0x00, 0x00); |
| 314 | | } |
| 310 | MAKE_RGB(0x00, 0x80, 0x00), |
| 311 | MAKE_RGB(0x00, 0x00, 0xff), |
| 312 | MAKE_RGB(0x00, 0xff, 0x00), |
| 313 | MAKE_RGB(0xff, 0x00, 0x00) |
| 314 | }; |
| 315 | 315 | |
| 316 | 316 | READ_LINE_MEMBER( mpt02_state::rdata_r ) |
| 317 | 317 | { |
| r17839 | r17840 | |
| 465 | 465 | |
| 466 | 466 | /* video hardware */ |
| 467 | 467 | MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, 1760000) |
| 468 | | |
| 469 | | MCFG_PALETTE_LENGTH(2) |
| 470 | | MCFG_PALETTE_INIT(black_and_white) |
| 471 | | |
| 472 | 468 | MCFG_CDP1861_ADD(CDP1861_TAG, 1760000, studio2_cdp1861_intf) |
| 473 | 469 | |
| 474 | 470 | /* sound hardware */ |
| r17839 | r17840 | |
| 488 | 484 | |
| 489 | 485 | /* video hardware */ |
| 490 | 486 | MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, XTAL_3_579545MHz/2) |
| 491 | | |
| 492 | | MCFG_PALETTE_LENGTH(4) |
| 493 | | MCFG_PALETTE_INIT(visicom) |
| 494 | | |
| 495 | 487 | MCFG_CDP1861_ADD(CDP1861_TAG, XTAL_3_579545MHz/2/8, studio2_cdp1861_intf) |
| 496 | 488 | |
| 497 | 489 | /* sound hardware */ |
| r17839 | r17840 | |
| 513 | 505 | MCFG_CDP1864_SCREEN_ADD(SCREEN_TAG, CDP1864_CLOCK) |
| 514 | 506 | MCFG_SCREEN_UPDATE_DEVICE(CDP1864_TAG, cdp1864_device, screen_update) |
| 515 | 507 | |
| 516 | | MCFG_PALETTE_LENGTH(8+8) |
| 517 | | |
| 518 | 508 | /* sound hardware */ |
| 519 | 509 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 520 | 510 | MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) |
trunk/src/mess/drivers/ql.c
| r17839 | r17840 | |
| 702 | 702 | |
| 703 | 703 | |
| 704 | 704 | //************************************************************************** |
| 705 | | // VIDEO |
| 706 | | //************************************************************************** |
| 707 | | |
| 708 | | //------------------------------------------------- |
| 709 | | // PALETTE_INIT( ql ) |
| 710 | | //------------------------------------------------- |
| 711 | | |
| 712 | | static PALETTE_INIT( ql ) |
| 713 | | { |
| 714 | | palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00 ); // black |
| 715 | | palette_set_color_rgb(machine, 1, 0x00, 0x00, 0xff ); // blue |
| 716 | | palette_set_color_rgb(machine, 2, 0xff, 0x00, 0x00 ); // red |
| 717 | | palette_set_color_rgb(machine, 3, 0xff, 0x00, 0xff ); // magenta |
| 718 | | palette_set_color_rgb(machine, 4, 0x00, 0xff, 0x00 ); // green |
| 719 | | palette_set_color_rgb(machine, 5, 0x00, 0xff, 0xff ); // cyan |
| 720 | | palette_set_color_rgb(machine, 6, 0xff, 0xff, 0x00 ); // yellow |
| 721 | | palette_set_color_rgb(machine, 7, 0xff, 0xff, 0xff ); // white |
| 722 | | } |
| 723 | | |
| 724 | | |
| 725 | | //------------------------------------------------- |
| 726 | | // SCREEN_UPDATE_IND16( ql ) |
| 727 | | //------------------------------------------------- |
| 728 | | |
| 729 | | UINT32 ql_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 730 | | { |
| 731 | | m_zx8301->update_screen(bitmap, cliprect); |
| 732 | | |
| 733 | | return 0; |
| 734 | | } |
| 735 | | |
| 736 | | |
| 737 | | |
| 738 | | //************************************************************************** |
| 739 | 705 | // DEVICE CONFIGURATION |
| 740 | 706 | //************************************************************************** |
| 741 | 707 | |
| r17839 | r17840 | |
| 1014 | 980 | MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 1015 | 981 | MCFG_SCREEN_REFRESH_RATE(50.08) |
| 1016 | 982 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate |
| 1017 | | MCFG_SCREEN_UPDATE_DRIVER(ql_state, screen_update) |
| 983 | MCFG_SCREEN_UPDATE_DEVICE(ZX8301_TAG, zx8301_device, screen_update) |
| 1018 | 984 | MCFG_SCREEN_SIZE(960, 312) |
| 1019 | 985 | MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) |
| 1020 | 986 | |
| 1021 | | MCFG_PALETTE_LENGTH(8) |
| 1022 | | MCFG_PALETTE_INIT(ql) |
| 1023 | | |
| 1024 | 987 | // sound hardware |
| 1025 | 988 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1026 | 989 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |
trunk/src/mess/drivers/pc8001.c
| r17839 | r17840 | |
| 340 | 340 | |
| 341 | 341 | /* Video */ |
| 342 | 342 | |
| 343 | | static PALETTE_INIT( pc8001 ) |
| 344 | | { |
| 345 | | } |
| 346 | | |
| 347 | 343 | void pc8001_state::video_start() |
| 348 | 344 | { |
| 349 | 345 | // find memory regions |
| r17839 | r17840 | |
| 352 | 348 | |
| 353 | 349 | /* uPD3301 Interface */ |
| 354 | 350 | |
| 351 | static const rgb_t PALETTE[] = |
| 352 | { |
| 353 | RGB_BLACK, |
| 354 | MAKE_RGB(0x00, 0x00, 0x00), |
| 355 | MAKE_RGB(0x00, 0x00, 0x00), |
| 356 | MAKE_RGB(0x00, 0x00, 0x00), |
| 357 | MAKE_RGB(0x00, 0x00, 0x00), |
| 358 | MAKE_RGB(0x00, 0x00, 0x00), |
| 359 | MAKE_RGB(0x00, 0x00, 0x00), |
| 360 | RGB_WHITE |
| 361 | }; |
| 362 | |
| 355 | 363 | static UPD3301_DISPLAY_PIXELS( pc8001_display_pixels ) |
| 356 | 364 | { |
| 357 | 365 | pc8001_state *state = device->machine().driver_data<pc8001_state>(); |
| r17839 | r17840 | |
| 368 | 376 | { |
| 369 | 377 | int color = BIT(data, 7) ^ rvv; |
| 370 | 378 | |
| 371 | | bitmap.pix16(y, (sx * 8) + i) = color ? 7 : 0; |
| 379 | bitmap.pix32(y, (sx * 8) + i) = PALETTE[color ? 7 : 0]; |
| 372 | 380 | |
| 373 | 381 | data <<= 1; |
| 374 | 382 | } |
| r17839 | r17840 | |
| 381 | 389 | { |
| 382 | 390 | int color = BIT(data, 7) ^ rvv; |
| 383 | 391 | |
| 384 | | bitmap.pix16(y, (sx/2 * 16) + (i * 2)) = color ? 7 : 0; |
| 385 | | bitmap.pix16(y, (sx/2 * 16) + (i * 2) + 1) = color ? 7 : 0; |
| 392 | bitmap.pix32(y, (sx/2 * 16) + (i * 2)) = PALETTE[color ? 7 : 0]; |
| 393 | bitmap.pix32(y, (sx/2 * 16) + (i * 2) + 1) = PALETTE[color ? 7 : 0]; |
| 386 | 394 | |
| 387 | 395 | data <<= 1; |
| 388 | 396 | } |
| r17839 | r17840 | |
| 560 | 568 | MCFG_SCREEN_SIZE(640, 220) |
| 561 | 569 | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1) |
| 562 | 570 | |
| 563 | | MCFG_PALETTE_LENGTH(8) |
| 564 | | MCFG_PALETTE_INIT(pc8001) |
| 565 | | |
| 566 | 571 | /* sound hardware */ |
| 567 | 572 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 568 | 573 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |
| r17839 | r17840 | |
| 597 | 602 | MCFG_SCREEN_SIZE(640, 220) |
| 598 | 603 | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1) |
| 599 | 604 | |
| 600 | | MCFG_PALETTE_LENGTH(8) |
| 601 | | MCFG_PALETTE_INIT(pc8001) |
| 602 | | |
| 603 | 605 | /* sound hardware */ |
| 604 | 606 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 605 | 607 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |