src/emu/video/mc6845.c
| r10689 | r10690 | |
| 837 | 837 | INT8 cursor_x = cursor_visible ? (mc6845->cursor_addr - mc6845->current_disp_addr) : -1; |
| 838 | 838 | |
| 839 | 839 | /* call the external system to draw it */ |
| 840 | | mc6845->intf->update_row(device, bitmap, cliprect, mc6845->current_disp_addr, ra, y, mc6845->horiz_disp, cursor_x, param); |
| 840 | if (MODE_ROW_COLUMN_ADDRESSING(mc6845)) |
| 841 | { |
| 842 | UINT8 cc = 0; |
| 843 | UINT8 cr = y / (mc6845->max_ras_addr + 1); |
| 844 | UINT16 ma = (cr << 8) | cc; |
| 841 | 845 | |
| 846 | mc6845->intf->update_row(device, bitmap, cliprect, ma, ra, y, mc6845->horiz_disp, cursor_x, param); |
| 847 | } |
| 848 | else |
| 849 | { |
| 850 | mc6845->intf->update_row(device, bitmap, cliprect, mc6845->current_disp_addr, ra, y, mc6845->horiz_disp, cursor_x, param); |
| 851 | } |
| 852 | |
| 842 | 853 | /* update MA if the last raster address */ |
| 843 | 854 | if (ra == mc6845->max_ras_addr) |
| 844 | 855 | mc6845->current_disp_addr = (mc6845->current_disp_addr + mc6845->horiz_disp) & 0x3fff; |
src/mess/video/abc1600.c
| r10689 | r10690 | |
| 2 | 2 | |
| 3 | 3 | TODO: |
| 4 | 4 | |
| 5 | | - mc6845 row/column addressing mode |
| 6 | 5 | - position image based on vsync/hsync |
| 7 | 6 | - FRAME POL |
| 8 | 7 | - landscape/portrait mode |
| r10689 | r10690 | |
| 111 | 110 | |
| 112 | 111 | UINT8 gmdo = m_video_ram[addr]; |
| 113 | 112 | UINT8 gmdi = m_gmdi & 0xff; |
| 114 | | UINT8 mask = m_wrm & 0xff; |
| 113 | UINT8 mask = 0xff;//m_wrm & 0xff; |
| 115 | 114 | |
| 116 | 115 | m_video_ram[addr] = (gmdi & mask) | (gmdo & (mask ^ 0xff)); |
| 117 | 116 | |
| r10689 | r10690 | |
| 134 | 133 | |
| 135 | 134 | UINT8 gmdo = m_video_ram[addr]; |
| 136 | 135 | UINT8 gmdi = m_gmdi >> 8; |
| 137 | | UINT8 mask = m_wrm >> 8; |
| 136 | UINT8 mask = 0xff;//m_wrm >> 8; |
| 138 | 137 | |
| 139 | 138 | m_video_ram[addr] = (gmdi & mask) | (gmdo & (mask ^ 0xff)); |
| 140 | 139 | |
| r10689 | r10690 | |
| 258 | 257 | bit description |
| 259 | 258 | |
| 260 | 259 | 0 MOVE CYK CLK |
| 261 | | 1 DISP CYK PRE FETCH / DISP CYC SEL |
| 260 | 1 DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK) |
| 262 | 261 | 2 DATA CLK |
| 263 | 262 | 3 _DISP MEM WE |
| 264 | 263 | 4 _CAS HB |
| 265 | | 5 DTACK CLK |
| 264 | 5 DTACK CLK / BLANK TEST (+2 PIXCLK) |
| 266 | 265 | 6 DISPREC CLK |
| 267 | 266 | 7 _RAS HB |
| 268 | 267 | |
| r10689 | r10690 | |
| 282 | 281 | bit description |
| 283 | 282 | |
| 284 | 283 | 0 MOVE CYK CLK |
| 285 | | 1 DISP CYK PRE FETCH / DISP CYC SEL |
| 284 | 1 DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK) |
| 286 | 285 | 2 DATA CLK |
| 287 | 286 | 3 _DISP MEM WE |
| 288 | 287 | 4 _CAS HB |
| 289 | | 5 DTACK CLK |
| 288 | 5 DTACK CLK / BLANK TEST (+2 PIXCLK) |
| 290 | 289 | 6 DISPREC CLK |
| 291 | 290 | 7 _RAS HB |
| 292 | 291 | |
| r10689 | r10690 | |
| 391 | 390 | |
| 392 | 391 | CRTCA0 0 |
| 393 | 392 | CRTCA1 0 |
| 394 | | CRTCA2 MA1 |
| 395 | | CRTCA3 MA2 |
| 396 | | CRTCA4 MA3 |
| 397 | | CRTCA5 MA4 |
| 393 | CRTCA2 CC1/MA1 |
| 394 | CRTCA3 CC2/MA2 |
| 395 | CRTCA4 CC3/MA3 |
| 396 | CRTCA5 CC4/MA4 |
| 398 | 397 | CRTCA6 RA0 |
| 399 | 398 | CRTCA7 RA1 |
| 400 | 399 | CRTCA8 RA2 |
| 401 | 400 | CRTCA9 RA3 |
| 402 | | CRTCA10 MA8 |
| 403 | | CRTCA11 MA9 |
| 404 | | CRTCA12 MA10 |
| 405 | | CRTCA13 MA11 |
| 406 | | CRTCA14 MA12 |
| 407 | | CRTCA15 MA13 |
| 401 | CRTCA10 CR0/MA8 |
| 402 | CRTCA11 CR1/MA9 |
| 403 | CRTCA12 CR2/MA10 |
| 404 | CRTCA13 CR3/MA11 |
| 405 | CRTCA14 CR4/MA12 |
| 406 | CRTCA15 CR5/MA13 |
| 408 | 407 | |
| 409 | 408 | */ |
| 410 | 409 | |
| 411 | | UINT16 new_ma = ma + (column * 2); |
| 410 | UINT8 cc = (ma & 0xff) + column; |
| 411 | UINT8 cr = ma >> 8; |
| 412 | 412 | |
| 413 | | return ((new_ma << 2) & 0xfc00) | (ra & 0x0f) << 6 | ((new_ma << 1) & 0x3c); |
| 413 | return (cr << 10) | ((ra & 0x0f) << 6) | ((cc << 1) & 0x3c); |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | void abc1600_state::crtc_update_row(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 417 | 417 | { |
| 418 | | for (int column = 0; column < x_count; column++) |
| 418 | int x = 0; |
| 419 | |
| 420 | for (int column = 0; column < x_count; column += 2) |
| 419 | 421 | { |
| 420 | 422 | UINT16 dma = get_crtca(ma, ra, column); |
| 421 | | UINT16 gmdo = (m_video_ram[dma] << 8) | m_video_ram[dma + 1]; |
| 422 | 423 | |
| 423 | | //logerror("Y %u col %u DMA %04x:%04x\n", y, column, dma, gmdo); |
| 424 | | |
| 425 | | for (int bit = 0; bit < 16; bit++) |
| 424 | // data is read out of video RAM in nibble mode by strobing CAS 4 times |
| 425 | for (int cas = 0; cas < 4; cas++) |
| 426 | 426 | { |
| 427 | | int x = (column * 16) + bit; |
| 428 | | int color = (BIT(gmdo, 15) ^ PIX_POL) & !BLANK; |
| 427 | UINT8 data = m_video_ram[dma + cas]; |
| 428 | |
| 429 | for (int bit = 0; bit < 8; bit++) |
| 430 | { |
| 431 | int color = (BIT(data, 7) ^ PIX_POL) & !BLANK; |
| 429 | 432 | |
| 430 | | *BITMAP_ADDR16(bitmap, y, x) = color; |
| 433 | *BITMAP_ADDR16(bitmap, y, x++) = color; |
| 431 | 434 | |
| 432 | | gmdo <<= 1; |
| 435 | data <<= 1; |
| 436 | } |
| 433 | 437 | } |
| 434 | 438 | } |
| 435 | 439 | } |
| r10689 | r10690 | |
| 452 | 456 | static const mc6845_interface crtc_intf = |
| 453 | 457 | { |
| 454 | 458 | SCREEN_TAG, |
| 455 | | 8, |
| 459 | 32, |
| 456 | 460 | NULL, |
| 457 | 461 | abc1600_update_row, |
| 458 | 462 | NULL, |
| r10689 | r10690 | |
| 472 | 476 | { |
| 473 | 477 | // allocate video RAM |
| 474 | 478 | m_video_ram = auto_alloc_array(machine, UINT8, VIDEORAM_SIZE); |
| 479 | memset(m_video_ram, 0, VIDEORAM_SIZE); |
| 475 | 480 | |
| 476 | 481 | // state saving |
| 477 | 482 | save_pointer(NAME(m_video_ram), VIDEORAM_SIZE); |