src/mess/video/abc800.c
| r15725 | r15726 | |
| 4 | 4 | * |
| 5 | 5 | ****************************************************************************/ |
| 6 | 6 | |
| 7 | | /* |
| 8 | | |
| 9 | | TODO: |
| 10 | | |
| 11 | | - color cursor |
| 12 | | - color HR graphics |
| 13 | | |
| 14 | | */ |
| 15 | | |
| 16 | 7 | #include "includes/abc80x.h" |
| 17 | 8 | |
| 18 | 9 | |
| r15725 | r15726 | |
| 65 | 56 | if (col >= 80) row += 16; |
| 66 | 57 | else if (col >= 40) row += 8; |
| 67 | 58 | |
| 68 | | col %= 40; |
| 69 | | |
| 70 | | return (row * 40) + col; |
| 59 | return (row * 40) + (col % 40); |
| 71 | 60 | } |
| 72 | 61 | |
| 73 | 62 | |
| r15725 | r15726 | |
| 99 | 88 | { |
| 100 | 89 | UINT16 addr = 0; |
| 101 | 90 | |
| 102 | | for (int y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 240); y++) |
| 91 | for (int y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 480); y += 2) |
| 103 | 92 | { |
| 104 | 93 | int x = 0; |
| 105 | 94 | |
| r15725 | r15726 | |
| 110 | 99 | for (int dot = 0; dot < 4; dot++) |
| 111 | 100 | { |
| 112 | 101 | UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03); |
| 113 | | int color = m_fgctl_prom[fgctl_addr] & 0x07; |
| 102 | UINT8 fgctl = m_fgctl_prom[fgctl_addr]; |
| 103 | int color = fgctl & 0x07; |
| 114 | 104 | |
| 115 | | bitmap.pix16(y, x++) = color; |
| 105 | if (color) |
| 106 | { |
| 107 | rgb_t rgb = palette_entry_get_color(machine().palette, bitmap.pix16(y, x)); |
| 108 | bool black = !RGB_RED(rgb) && !RGB_GREEN(rgb) && !RGB_BLUE(rgb); |
| 109 | bool opaque = !BIT(fgctl, 3); |
| 116 | 110 | |
| 111 | if (black || opaque) |
| 112 | { |
| 113 | color += 128; |
| 114 | |
| 115 | bitmap.pix16(y, x) = color; |
| 116 | bitmap.pix16(y, x + 1) = color; |
| 117 | |
| 118 | bitmap.pix16(y + 1, x) = color; |
| 119 | bitmap.pix16(y + 1, x + 1) = color; |
| 120 | } |
| 121 | } |
| 122 | |
| 117 | 123 | data <<= 2; |
| 124 | x += 2; |
| 118 | 125 | } |
| 119 | 126 | } |
| 120 | 127 | } |
| r15725 | r15726 | |
| 138 | 145 | |
| 139 | 146 | |
| 140 | 147 | //------------------------------------------------- |
| 148 | // VIDEO_START( abc800c ) |
| 149 | //------------------------------------------------- |
| 150 | |
| 151 | void abc800c_state::video_start() |
| 152 | { |
| 153 | abc800_state::video_start(); |
| 154 | |
| 155 | // initialize palette |
| 156 | palette_set_color_rgb(machine(), 128+0, 0x00, 0x00, 0x00); // black |
| 157 | palette_set_color_rgb(machine(), 128+1, 0xff, 0x00, 0x00); // red |
| 158 | palette_set_color_rgb(machine(), 128+2, 0x00, 0xff, 0x00); // green |
| 159 | palette_set_color_rgb(machine(), 128+3, 0xff, 0xff, 0x00); // yellow |
| 160 | palette_set_color_rgb(machine(), 128+4, 0x00, 0x00, 0xff); // blue |
| 161 | palette_set_color_rgb(machine(), 128+5, 0xff, 0x00, 0xff); // magenta |
| 162 | palette_set_color_rgb(machine(), 128+6, 0x00, 0xff, 0xff); // cyan |
| 163 | palette_set_color_rgb(machine(), 128+7, 0xff, 0xff, 0xff); // white |
| 164 | } |
| 165 | |
| 166 | |
| 167 | //------------------------------------------------- |
| 141 | 168 | // SCREEN_UPDATE( abc800c ) |
| 142 | 169 | //------------------------------------------------- |
| 143 | 170 | |
| r15725 | r15726 | |
| 146 | 173 | // clear screen |
| 147 | 174 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 148 | 175 | |
| 149 | | // draw HR graphics |
| 150 | | hr_update(bitmap, cliprect); |
| 151 | | |
| 176 | // draw text |
| 152 | 177 | if (!BIT(m_fgctl, 7)) |
| 153 | 178 | { |
| 154 | | // draw text |
| 155 | 179 | saa5050_update(m_trom, bitmap, cliprect); |
| 156 | 180 | } |
| 157 | 181 | |
| 182 | saa5050_frame_advance(m_trom); |
| 183 | |
| 184 | // draw HR graphics |
| 185 | hr_update(bitmap, cliprect); |
| 186 | |
| 158 | 187 | return 0; |
| 159 | 188 | } |
| 160 | 189 | |
| r15725 | r15726 | |
| 180 | 209 | MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 181 | 210 | MCFG_SCREEN_UPDATE_DRIVER(abc800c_state, screen_update) |
| 182 | 211 | |
| 183 | | MCFG_SCREEN_REFRESH_RATE(60) |
| 212 | MCFG_SCREEN_REFRESH_RATE(50) |
| 184 | 213 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 185 | | MCFG_SCREEN_SIZE(640, 480) |
| 186 | | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 214 | MCFG_SCREEN_SIZE(480, 480) |
| 215 | MCFG_SCREEN_VISIBLE_AREA(0, 480-1, 0, 480-1) |
| 187 | 216 | |
| 188 | | MCFG_PALETTE_LENGTH(128) |
| 217 | MCFG_PALETTE_LENGTH(128+8) |
| 189 | 218 | MCFG_PALETTE_INIT(saa5050) |
| 190 | 219 | |
| 191 | 220 | MCFG_GFXDECODE(saa5050) |
| r15725 | r15726 | |
| 321 | 350 | // draw HR graphics |
| 322 | 351 | hr_update(bitmap, cliprect); |
| 323 | 352 | |
| 353 | // draw text |
| 324 | 354 | if (!BIT(m_fgctl, 7)) |
| 325 | 355 | { |
| 326 | | // draw text |
| 327 | 356 | m_crtc->screen_update(screen, bitmap, cliprect); |
| 328 | 357 | } |
| 329 | 358 | |
src/mess/video/abc806.c
| r15725 | r15726 | |
| 6 | 6 | |
| 7 | 7 | /* |
| 8 | 8 | |
| 9 | | TODO: |
| 9 | TODO: |
| 10 | 10 | |
| 11 | | - HRU II PROM reading |
| 11 | - HRU II PROM test |
| 12 | - flashing |
| 13 | - double height |
| 14 | - underline |
| 12 | 15 | |
| 13 | 16 | */ |
| 14 | 17 | |
| r15725 | r15726 | |
| 41 | 44 | |
| 42 | 45 | |
| 43 | 46 | //------------------------------------------------- |
| 44 | | // abc806_hrs_w - high resolution memory banking |
| 47 | // hrs_w - high resolution memory banking |
| 45 | 48 | //------------------------------------------------- |
| 46 | 49 | |
| 47 | 50 | WRITE8_MEMBER( abc806_state::hrs_w ) |
| r15725 | r15726 | |
| 66 | 69 | |
| 67 | 70 | |
| 68 | 71 | //------------------------------------------------- |
| 69 | | // abc806_hrc_w - high resolution color write |
| 72 | // hrc_w - high resolution color write |
| 70 | 73 | //------------------------------------------------- |
| 71 | 74 | |
| 72 | 75 | WRITE8_MEMBER( abc806_state::hrc_w ) |
| r15725 | r15726 | |
| 78 | 81 | |
| 79 | 82 | |
| 80 | 83 | //------------------------------------------------- |
| 81 | | // abc806_charram_r - character RAM read |
| 84 | // charram_r - character RAM read |
| 82 | 85 | //------------------------------------------------- |
| 83 | 86 | |
| 84 | 87 | READ8_MEMBER( abc806_state::charram_r ) |
| r15725 | r15726 | |
| 90 | 93 | |
| 91 | 94 | |
| 92 | 95 | //------------------------------------------------- |
| 93 | | // abc806_charram_w - character RAM write |
| 96 | // charram_w - character RAM write |
| 94 | 97 | //------------------------------------------------- |
| 95 | 98 | |
| 96 | 99 | WRITE8_MEMBER( abc806_state::charram_w ) |
| 97 | 100 | { |
| 98 | 101 | m_color_ram[offset] = m_attr_data; |
| 102 | |
| 99 | 103 | m_char_ram[offset] = data; |
| 100 | 104 | } |
| 101 | 105 | |
| 102 | 106 | |
| 103 | 107 | //------------------------------------------------- |
| 104 | | // abc806_ami_r - attribute memory read |
| 108 | // ami_r - attribute memory read |
| 105 | 109 | //------------------------------------------------- |
| 106 | 110 | |
| 107 | 111 | READ8_MEMBER( abc806_state::ami_r ) |
| r15725 | r15726 | |
| 111 | 115 | |
| 112 | 116 | |
| 113 | 117 | //------------------------------------------------- |
| 114 | | // abc806_amo_w - attribute memory write |
| 118 | // amo_w - attribute memory write |
| 115 | 119 | //------------------------------------------------- |
| 116 | 120 | |
| 117 | 121 | WRITE8_MEMBER( abc806_state::amo_w ) |
| r15725 | r15726 | |
| 121 | 125 | |
| 122 | 126 | |
| 123 | 127 | //------------------------------------------------- |
| 124 | | // abc806_cli_r - palette PROM read |
| 128 | // cli_r - palette PROM read |
| 125 | 129 | //------------------------------------------------- |
| 126 | 130 | |
| 127 | 131 | READ8_MEMBER( abc806_state::cli_r ) |
| r15725 | r15726 | |
| 144 | 148 | UINT16 hru2_addr = (m_hru2_a8 << 8) | (offset >> 8); |
| 145 | 149 | UINT8 data = m_hru2_prom[hru2_addr] & 0x0f; |
| 146 | 150 | |
| 151 | logerror("HRU II %03x : %01x\n", hru2_addr, data); |
| 152 | |
| 147 | 153 | data |= m_rtc->dio_r() << 7; |
| 148 | 154 | |
| 149 | 155 | return data; |
| r15725 | r15726 | |
| 151 | 157 | |
| 152 | 158 | |
| 153 | 159 | //------------------------------------------------- |
| 154 | | // abc806_sti_r - protection device read |
| 160 | // sti_r - protection device read |
| 155 | 161 | //------------------------------------------------- |
| 156 | 162 | |
| 157 | 163 | READ8_MEMBER( abc806_state::sti_r ) |
| r15725 | r15726 | |
| 176 | 182 | |
| 177 | 183 | |
| 178 | 184 | //------------------------------------------------- |
| 179 | | // abc806_sto_w - |
| 185 | // sto_w - |
| 180 | 186 | //------------------------------------------------- |
| 181 | 187 | |
| 182 | 188 | WRITE8_MEMBER( abc806_state::sto_w ) |
| r15725 | r15726 | |
| 221 | 227 | |
| 222 | 228 | |
| 223 | 229 | //------------------------------------------------- |
| 224 | | // abc806_sso_w - sync offset write |
| 230 | // sso_w - sync offset write |
| 225 | 231 | //------------------------------------------------- |
| 226 | 232 | |
| 227 | 233 | WRITE8_MEMBER( abc806_state::sso_w ) |
| r15725 | r15726 | |
| 513 | 519 | screen.set_visible_area(0, 767, 0, 311); |
| 514 | 520 | |
| 515 | 521 | // clear screen |
| 516 | | bitmap.fill(0, cliprect); |
| 522 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 517 | 523 | |
| 518 | 524 | if (!m_txoff) |
| 519 | 525 | { |
| r15725 | r15726 | |
| 541 | 547 | MCFG_SCREEN_REFRESH_RATE(60) |
| 542 | 548 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 543 | 549 | MCFG_SCREEN_SIZE(768, 312) |
| 544 | | MCFG_SCREEN_VISIBLE_AREA(0,768-1, 0, 312-1) |
| 550 | MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1) |
| 545 | 551 | |
| 546 | 552 | MCFG_PALETTE_LENGTH(8) |
| 547 | 553 | |