src/mess/video/vdc8563.c
| r1920 | r1921 | |
| 15 | 15 | #include <stdio.h> |
| 16 | 16 | #include <assert.h> |
| 17 | 17 | #include "driver.h" |
| 18 | | #include "deprecat.h" |
| 19 | 18 | |
| 20 | 19 | #include "includes/crtc6845.h" // include only several register defines |
| 21 | 20 | #include "vdc8563.h" |
| r1920 | r1921 | |
| 402 | 401 | } |
| 403 | 402 | } |
| 404 | 403 | |
| 405 | | static void vdc8563_monotext_screenrefresh (bitmap_t *bitmap, int full_refresh) |
| 404 | static void vdc8563_monotext_screenrefresh (running_machine *machine, bitmap_t *bitmap, int full_refresh) |
| 406 | 405 | { |
| 407 | 406 | int x, y, i; |
| 408 | 407 | rectangle rect; |
| r1920 | r1921 | |
| 410 | 409 | int h=CRTC6845_CHAR_LINES; |
| 411 | 410 | int height=CRTC6845_CHAR_HEIGHT; |
| 412 | 411 | |
| 413 | | rect.min_x=Machine->screen[0].visarea.min_x; |
| 414 | | rect.max_x=Machine->screen[0].visarea.max_x; |
| 412 | rect.min_x=machine->screen[0].visarea.min_x; |
| 413 | rect.max_x=machine->screen[0].visarea.max_x; |
| 415 | 414 | if (full_refresh) { |
| 416 | 415 | memset(vdc.dirty+vdc.videoram_start, 1, vdc.videoram_size); |
| 417 | 416 | } |
| r1920 | r1921 | |
| 421 | 420 | y++, rect.min_y+=height, rect.max_y+=height) { |
| 422 | 421 | for (x=0; x<w; x++, i=(i+1)&vdc.mask) { |
| 423 | 422 | if (vdc.dirty[i]) { |
| 424 | | drawgfx(bitmap,Machine->gfx[0], |
| 423 | drawgfx(bitmap,machine->gfx[0], |
| 425 | 424 | vdc.ram[i], FRAMECOLOR|(MONOCOLOR<<4), 0, 0, |
| 426 | | Machine->gfx[0]->width*x+8,height*y+height, |
| 425 | machine->gfx[0]->width*x+8,height*y+height, |
| 427 | 426 | &rect,TRANSPARENCY_NONE,0); |
| 428 | 427 | if ((vdc.cursor_on)&&(i==(CRTC6845_CURSOR_POS&vdc.mask))) { |
| 429 | 428 | int k=height-CRTC6845_CURSOR_TOP; |
| 430 | 429 | if (CRTC6845_CURSOR_BOTTOM<height) k=CRTC6845_CURSOR_BOTTOM-CRTC6845_CURSOR_TOP+1; |
| 431 | 430 | |
| 432 | 431 | if (k>0) |
| 433 | | plot_box(bitmap, Machine->gfx[0]->width*x+8, |
| 432 | plot_box(bitmap, machine->gfx[0]->width*x+8, |
| 434 | 433 | height*y+height+CRTC6845_CURSOR_TOP, |
| 435 | | Machine->gfx[0]->width, k, Machine->pens[FRAMECOLOR]); |
| 434 | machine->gfx[0]->width, k, machine->pens[FRAMECOLOR]); |
| 436 | 435 | } |
| 437 | 436 | |
| 438 | 437 | vdc.dirty[i]=0; |
| r1920 | r1921 | |
| 442 | 441 | } |
| 443 | 442 | } |
| 444 | 443 | |
| 445 | | static void vdc8563_text_screenrefresh (bitmap_t *bitmap, int full_refresh) |
| 444 | static void vdc8563_text_screenrefresh (running_machine *machine, bitmap_t *bitmap, int full_refresh) |
| 446 | 445 | { |
| 447 | 446 | int x, y, i, j; |
| 448 | 447 | rectangle rect; |
| r1920 | r1921 | |
| 450 | 449 | int h=CRTC6845_CHAR_LINES; |
| 451 | 450 | int height=CRTC6845_CHAR_HEIGHT; |
| 452 | 451 | |
| 453 | | rect.min_x=Machine->screen[0].visarea.min_x; |
| 454 | | rect.max_x=Machine->screen[0].visarea.max_x; |
| 452 | rect.min_x=machine->screen[0].visarea.min_x; |
| 453 | rect.max_x=machine->screen[0].visarea.max_x; |
| 455 | 454 | if (full_refresh) { |
| 456 | 455 | memset(vdc.dirty+vdc.videoram_start, 1, vdc.videoram_size); |
| 457 | 456 | } |
| r1920 | r1921 | |
| 488 | 487 | if (CRTC6845_CURSOR_BOTTOM<height) k=CRTC6845_CURSOR_BOTTOM-CRTC6845_CURSOR_TOP+1; |
| 489 | 488 | |
| 490 | 489 | if (k>0) |
| 491 | | plot_box(bitmap, Machine->gfx[0]->width*x+8, |
| 490 | plot_box(bitmap, machine->gfx[0]->width*x+8, |
| 492 | 491 | height*y+height+CRTC6845_CURSOR_TOP, |
| 493 | | Machine->gfx[0]->width, k, Machine->pens[0x10|(vdc.ram[j]&0xf)]); |
| 492 | machine->gfx[0]->width, k, machine->pens[0x10|(vdc.ram[j]&0xf)]); |
| 494 | 493 | } |
| 495 | 494 | |
| 496 | 495 | vdc.dirty[i]=0; |
| r1920 | r1921 | |
| 502 | 501 | } |
| 503 | 502 | } |
| 504 | 503 | |
| 505 | | static void vdc8563_graphic_screenrefresh (bitmap_t *bitmap, int full_refresh) |
| 504 | static void vdc8563_graphic_screenrefresh (running_machine *machine, bitmap_t *bitmap, int full_refresh) |
| 506 | 505 | { |
| 507 | 506 | int x, y, i, j, k; |
| 508 | 507 | rectangle rect; |
| r1920 | r1921 | |
| 510 | 509 | int h=CRTC6845_CHAR_LINES; |
| 511 | 510 | int height=CRTC6845_CHAR_HEIGHT; |
| 512 | 511 | |
| 513 | | rect.min_x=Machine->screen[0].visarea.min_x; |
| 514 | | rect.max_x=Machine->screen[0].visarea.max_x; |
| 512 | rect.min_x=machine->screen[0].visarea.min_x; |
| 513 | rect.max_x=machine->screen[0].visarea.max_x; |
| 515 | 514 | if (full_refresh) { |
| 516 | 515 | memset(vdc.dirty, 1, vdc.mask+1); |
| 517 | 516 | } |
| r1920 | r1921 | |
| 523 | 522 | for (j=0; j<height; j++) { |
| 524 | 523 | k=((i<<4)+j)&vdc.mask; |
| 525 | 524 | if (vdc.dirty[k]) { |
| 526 | | drawgfx(bitmap,Machine->gfx[1], |
| 525 | drawgfx(bitmap,machine->gfx[1], |
| 527 | 526 | vdc.ram[k], FRAMECOLOR|(MONOCOLOR<<4), 0, 0, |
| 528 | | Machine->gfx[0]->width*x+8,height*y+height+j, |
| 527 | machine->gfx[0]->width*x+8,height*y+height+j, |
| 529 | 528 | &rect,TRANSPARENCY_NONE,0); |
| 530 | 529 | vdc.dirty[k]=0; |
| 531 | 530 | } |
| r1920 | r1921 | |
| 544 | 543 | vdc8563_time(); |
| 545 | 544 | |
| 546 | 545 | full_refresh|=vdc.changed; |
| 547 | | if (GRAPHIC) { vdc8563_graphic_screenrefresh(bitmap, full_refresh); |
| 546 | if (GRAPHIC) { vdc8563_graphic_screenrefresh(machine, bitmap, full_refresh); |
| 548 | 547 | } else { |
| 549 | 548 | for (i=0; i<512; i++) { |
| 550 | 549 | if (full_refresh||vdc.fontdirty[i]) { |
| r1920 | r1921 | |
| 552 | 551 | vdc.fontdirty[i]=0; |
| 553 | 552 | } |
| 554 | 553 | } |
| 555 | | if (TEXT) vdc8563_text_screenrefresh(bitmap, full_refresh); |
| 556 | | else vdc8563_monotext_screenrefresh(bitmap, full_refresh); |
| 554 | if (TEXT) vdc8563_text_screenrefresh(machine, bitmap, full_refresh); |
| 555 | else vdc8563_monotext_screenrefresh(machine, bitmap, full_refresh); |
| 557 | 556 | } |
| 558 | 557 | |
| 559 | 558 | if (full_refresh) { |