src/mess/video/vdc.c
| r898 | r899 | |
| 25 | 25 | memset(vdc.vram, 0, 0x10000); |
| 26 | 26 | |
| 27 | 27 | /* create display bitmap */ |
| 28 | | vdc.bmp = auto_bitmap_alloc(360, 256, BITMAP_FORMAT_INDEXED16); |
| 28 | vdc.bmp = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | VIDEO_UPDATE( pce ) |
| 33 | 33 | { |
| 34 | | /* only refresh the visible portion of the display */ |
| 35 | | rectangle pce_visible_area; |
| 36 | | |
| 37 | | int center_x = ((360/2) - (vdc.physical_width/2)); |
| 38 | | int center_y = ((256/2) - (vdc.physical_height/2)); |
| 39 | | |
| 40 | | pce_visible_area.min_x = center_x; |
| 41 | | pce_visible_area.min_y = center_y; |
| 42 | | pce_visible_area.max_x = (center_x + vdc.physical_width) - 1; |
| 43 | | pce_visible_area.max_y = (center_x + vdc.physical_height) - 1; |
| 44 | | |
| 45 | 34 | /* copy our rendering buffer to the display */ |
| 46 | | copybitmap (bitmap,vdc.bmp,0,0,0,0,&pce_visible_area,TRANSPARENCY_NONE,0); |
| 35 | copybitmap (bitmap,vdc.bmp,0,0,0,0,cliprect,TRANSPARENCY_NONE,0); |
| 47 | 36 | return 0; |
| 48 | 37 | } |
| 49 | 38 | |
| r898 | r899 | |
| 55 | 44 | /* our line buffer */ |
| 56 | 45 | UINT16 *line_buffer = BITMAP_ADDR16( vdc.bmp, line, 0 ); |
| 57 | 46 | |
| 58 | | for(i=0; i<360;i++) |
| 59 | | line_buffer[i]=Machine->pens[0]; |
| 47 | for( i=0; i< Machine->screen[0].width; i++ ) |
| 48 | line_buffer[i] = Machine->pens[0]; |
| 60 | 49 | } |
| 61 | 50 | |
| 62 | 51 | void draw_overscan_line(int line) |
| r898 | r899 | |
| 66 | 55 | /* our line buffer */ |
| 67 | 56 | UINT16 *line_buffer = BITMAP_ADDR16( vdc.bmp, line, 0 ); |
| 68 | 57 | |
| 69 | | for(i=0; i<360;i++) |
| 70 | | line_buffer[i]=Machine->pens[0x100]; |
| 58 | for( i=0; i< Machine->screen[0].width; i++ ) |
| 59 | line_buffer[i] = Machine->pens[0x100]; |
| 71 | 60 | } |
| 72 | 61 | |
| 73 | 62 | void vram_write(offs_t offset, UINT8 data) |
| r898 | r899 | |
| 116 | 105 | vdc.vdc_latch = data; |
| 117 | 106 | break; |
| 118 | 107 | |
| 119 | | case BYR: |
| 120 | | if(vdc.current_segment == STATE_ACTIVE) |
| 121 | | vdc.y_scroll=vdc.vdc_data[BYR].w; |
| 122 | | break; |
| 108 | case BYR: |
| 109 | vdc.y_scroll=vdc.vdc_data[BYR].w; |
| 110 | break; |
| 123 | 111 | |
| 124 | 112 | case HDR: |
| 125 | 113 | vdc.physical_width = ((data & 0x003F) + 1) << 3; |
| r898 | r899 | |
| 174 | 162 | vdc.dvssr_write = 1; |
| 175 | 163 | break; |
| 176 | 164 | |
| 177 | | case BYR: |
| 178 | | if(vdc.current_segment == STATE_ACTIVE) |
| 179 | | vdc.y_scroll=vdc.vdc_data[BYR].w; |
| 180 | | break; |
| 165 | case BYR: |
| 166 | vdc.y_scroll=vdc.vdc_data[BYR].w; |
| 167 | break; |
| 181 | 168 | |
| 182 | 169 | case LENR: |
| 183 | 170 | vdc_do_dma(); |
| r898 | r899 | |
| 299 | 286 | { |
| 300 | 287 | static int width_table[4] = {5, 6, 7, 7}; |
| 301 | 288 | |
| 302 | | int center_x = ((360/2) - (vdc.physical_width/2)); |
| 303 | | |
| 304 | | int scroll_y = (vdc.y_scroll & 0x01FF); |
| 289 | int scroll_y = ( vdc.y_scroll & 0x01FF); |
| 305 | 290 | int scroll_x = (vdc.vdc_data[BXR].w & 0x03FF); |
| 306 | 291 | int nt_index; |
| 307 | 292 | |
| r898 | r899 | |
| 318 | 303 | int v_width = width_table[(vdc.vdc_data[MWR].w >> 4) & 3]; |
| 319 | 304 | |
| 320 | 305 | /* our line buffer */ |
| 321 | | UINT16 *line_buffer = BITMAP_ADDR16( vdc.bmp, bitmap_line, center_x ); |
| 306 | UINT16 *line_buffer = BITMAP_ADDR16( vdc.bmp, bitmap_line, 86 ); |
| 322 | 307 | #ifdef MAME_DEBUG |
| 323 | 308 | int line_buffer_size; |
| 324 | 309 | #endif |
| r898 | r899 | |
| 345 | 330 | } |
| 346 | 331 | else |
| 347 | 332 | { |
| 348 | | for(i=0;i<(vdc.physical_width >> 3)+1;i++) |
| 333 | int pixel = 0; |
| 334 | for(i=0;i<(vdc.physical_width >> 3);i++) |
| 349 | 335 | { |
| 350 | 336 | nt_index = (i + (scroll_x >> 3)) & ((2 << (v_width-1))-1); |
| 351 | 337 | nt_index *= 2; |
| r898 | r899 | |
| 374 | 360 | i3 = (b3 >> (7-x)) & 1; |
| 375 | 361 | c = (cell_palette << 4 | i3 << 3 | i2 << 2 | i1 << 1 | i0); |
| 376 | 362 | |
| 377 | | #ifdef MAME_DEBUG |
| 378 | | //apparently some kind of bounds check? |
| 379 | | assert((i<<3)+x < (line_buffer_size)); |
| 380 | | #endif |
| 381 | | line_buffer[(i<<3)+x] = Machine->pens[c]; |
| 363 | /* colour #0 always comes from palette #0 */ |
| 364 | if ( ! ( c & 0x0F ) ) |
| 365 | c &= 0x0F; |
| 366 | |
| 367 | line_buffer[ pixel++ ] = Machine->pens[c]; |
| 368 | if ( vdc.physical_width != 512 ) { |
| 369 | if ( pixel < ( ( ( i * 8 + x + 1 ) * 512 ) / vdc.physical_width ) ) { |
| 370 | line_buffer[ pixel++ ] = Machine->pens[c]; |
| 371 | } |
| 372 | } |
| 382 | 373 | } |
| 383 | 374 | } |
| 384 | | |
| 385 | 375 | } |
| 386 | 376 | /* Sprite rendering is independant of BG drawing! */ |
| 387 | 377 | if(vdc.vdc_data[CR].w & CR_SB) |
| r898 | r899 | |
| 430 | 420 | static int cgx_table[] = {16, 32}; |
| 431 | 421 | static int cgy_table[] = {16, 32, 64, 64}; |
| 432 | 422 | |
| 433 | | int center_x = ((360/2) - (vdc.physical_width/2)); |
| 434 | | // int center_y = ((256/2) - (vdc.physical_height/2)); |
| 435 | | |
| 436 | 423 | int obj_x, obj_y, obj_i, obj_a; |
| 437 | 424 | int obj_w, obj_h, obj_l, cgypos; |
| 438 | 425 | int hf, vf; |
| r898 | r899 | |
| 442 | 429 | char buf[16]; |
| 443 | 430 | |
| 444 | 431 | UINT8 sprites_drawn=0; |
| 445 | | UINT16 *line_buffer= BITMAP_ADDR16( vdc.bmp, bitmap_line, center_x ); |
| 432 | UINT16 *line_buffer= BITMAP_ADDR16( vdc.bmp, bitmap_line, 86 ); |
| 446 | 433 | |
| 447 | 434 | /* 0 -> no sprite pixels drawn, otherwise is sprite #+1 */ |
| 448 | | UINT8 drawn[(0x40 << 3) + 32]; |
| 449 | | if (!line_buffer) |
| 450 | | return; |
| 435 | UINT8 drawn[Machine->screen[0].width]; |
| 451 | 436 | |
| 452 | 437 | //clear our sprite-to-sprite clipping buffer. |
| 453 | | memset(drawn, 0, (0x40 << 3) + 32); |
| 438 | memset(drawn, 0, sizeof(drawn)); |
| 454 | 439 | /* count up: Highest priority is Sprite 0 */ |
| 455 | 440 | for(i=0; i<64; i++) |
| 456 | 441 | { |
| 457 | 442 | obj_y = (vdc.sprite_ram[(i<<2)+0] & 0x03FF) - 64; |
| 458 | 443 | obj_x = (vdc.sprite_ram[(i<<2)+1] & 0x03FF) - 32; |
| 459 | 444 | |
| 445 | if ( vdc.vdc_data[MWR].w & 0x0030 ) { |
| 446 | obj_y -= ( vdc.vdc_data[BYR].w & (vdc.vdc_data[MWR].w & 0x0040 ? 0x1FF : 0x0FF) ); |
| 447 | } |
| 448 | |
| 460 | 449 | if ((obj_y == -64) || (obj_y > line)) continue; |
| 461 | 450 | if ((obj_x == -32) || (obj_x > vdc.physical_width)) continue; |
| 462 | 451 | |
| r898 | r899 | |
| 497 | 486 | |
| 498 | 487 | if(cgx == 0) |
| 499 | 488 | { |
| 489 | int pixel_x = ( ( obj_x * 512 ) / vdc.physical_width ); |
| 490 | |
| 500 | 491 | conv_obj(obj_i + (cgypos << 2), obj_l, hf, vf, buf); |
| 492 | |
| 501 | 493 | for(x=0;x<16;x++) |
| 502 | 494 | { |
| 503 | 495 | if(((obj_x + x)<(vdc.physical_width))&&((obj_x + x)>=0)) |
| r898 | r899 | |
| 507 | 499 | { |
| 508 | 500 | if(!drawn[obj_x+x]) |
| 509 | 501 | { |
| 510 | | if(priority || (line_buffer[obj_x + x] == Machine->pens[0])) |
| 511 | | line_buffer[obj_x + x] = Machine->pens[0x100 + (palette << 4) + c]; |
| 512 | | drawn[obj_x + x]=i+1; |
| 502 | if(priority || (line_buffer[pixel_x] == Machine->pens[0])) { |
| 503 | line_buffer[pixel_x] = Machine->pens[0x100 + (palette << 4) + c]; |
| 504 | if ( vdc.physical_width != 512 ) { |
| 505 | if ( pixel_x + 1 < ( ( ( obj_x + x + 1 ) * 512 ) / vdc.physical_width ) ) { |
| 506 | line_buffer[pixel_x + 1] = Machine->pens[0x100 + (palette << 4) + c]; |
| 507 | } |
| 508 | } |
| 509 | drawn[obj_x+x]=i+1; |
| 510 | } |
| 513 | 511 | } |
| 514 | 512 | else if (drawn[obj_x+x]==1) |
| 515 | 513 | { |
| r898 | r899 | |
| 519 | 517 | } |
| 520 | 518 | } |
| 521 | 519 | } |
| 520 | pixel_x += 1; |
| 521 | if ( vdc.physical_width != 512 ) { |
| 522 | if ( pixel_x < ( ( ( obj_x + x + 1 ) * 512 ) / vdc.physical_width ) ) { |
| 523 | pixel_x += 1; |
| 524 | } |
| 525 | } |
| 522 | 526 | } |
| 523 | 527 | } |
| 524 | 528 | else |
| 525 | 529 | { |
| 530 | int pixel_x = ( ( obj_x * 512 ) / vdc.physical_width ); |
| 531 | |
| 526 | 532 | conv_obj(obj_i + (cgypos << 2) + (hf ? 2 : 0), obj_l, hf, vf, buf); |
| 533 | |
| 527 | 534 | for(x=0;x<16;x++) |
| 528 | 535 | { |
| 529 | 536 | if(((obj_x + x)<(vdc.physical_width))&&((obj_x + x)>=0)) |
| r898 | r899 | |
| 533 | 540 | { |
| 534 | 541 | if(!drawn[obj_x+x]) |
| 535 | 542 | { |
| 536 | | if(priority || (line_buffer[obj_x + x] == Machine->pens[0])) |
| 537 | | line_buffer[obj_x + x] = Machine->pens[0x100 + (palette << 4) + c]; |
| 538 | | drawn[obj_x + x]=i+1; |
| 543 | if(priority || (line_buffer[pixel_x] == Machine->pens[0])) { |
| 544 | line_buffer[pixel_x] = Machine->pens[0x100 + (palette << 4) + c]; |
| 545 | if ( vdc.physical_width != 512 ) { |
| 546 | if ( pixel_x + 1 < ( ( ( obj_x + x + 1 ) * 512 ) / vdc.physical_width ) ) { |
| 547 | line_buffer[pixel_x + 1] = Machine->pens[0x100 + (palette << 4) + c]; |
| 548 | } |
| 549 | } |
| 550 | drawn[obj_x + x]=i+1; |
| 551 | } |
| 539 | 552 | } |
| 540 | 553 | else if (drawn[obj_x+x]==1) |
| 541 | 554 | { |
| r898 | r899 | |
| 547 | 560 | } |
| 548 | 561 | } |
| 549 | 562 | } |
| 563 | pixel_x += 1; |
| 564 | if ( vdc.physical_width != 512 ) { |
| 565 | if ( pixel_x < ( ( ( obj_x + x + 1 ) * 512 ) / vdc.physical_width ) ) { |
| 566 | pixel_x += 1; |
| 567 | } |
| 568 | } |
| 550 | 569 | } |
| 551 | 570 | |
| 552 | 571 | conv_obj(obj_i + (cgypos << 2) + (hf ? 0 : 2), obj_l, hf, vf, buf); |
| r898 | r899 | |
| 559 | 578 | { |
| 560 | 579 | if(!drawn[obj_x+0x10+x]) |
| 561 | 580 | { |
| 562 | | if(priority || (line_buffer[obj_x + 0x10 + x] == Machine->pens[0])) |
| 563 | | line_buffer[obj_x + 0x10 + x] = Machine->pens[0x100 + (palette << 4) + c]; |
| 564 | | drawn[obj_x + 0x10 + x]=i+1; |
| 581 | if(priority || (line_buffer[pixel_x] == Machine->pens[0])) { |
| 582 | line_buffer[pixel_x] = Machine->pens[0x100 + (palette << 4) + c]; |
| 583 | if ( vdc.physical_width != 512 ) { |
| 584 | if ( pixel_x + 1 < ( ( ( obj_x + x + 17 ) * 512 ) / vdc.physical_width ) ) { |
| 585 | line_buffer[pixel_x + 1] = Machine->pens[0x100 + (palette << 4) + c]; |
| 586 | } |
| 587 | } |
| 588 | drawn[obj_x + 0x10 + x]=i+1; |
| 589 | } |
| 565 | 590 | } |
| 566 | 591 | else if (drawn[obj_x+0x10+x]==1) |
| 567 | 592 | { |
| r898 | r899 | |
| 571 | 596 | } |
| 572 | 597 | } |
| 573 | 598 | } |
| 599 | pixel_x += 1; |
| 600 | if ( vdc.physical_width != 512 ) { |
| 601 | if ( pixel_x < ( ( ( obj_x + x + 17 ) * 512 ) / vdc.physical_width ) ) { |
| 602 | pixel_x += 1; |
| 603 | } |
| 604 | } |
| 574 | 605 | } |
| 575 | 606 | } |
| 576 | 607 | } |
src/mess/drivers/pce.c
| r898 | r899 | |
| 51 | 51 | #include "sound/c6280.h" |
| 52 | 52 | #include "hash.h" |
| 53 | 53 | |
| 54 | #define MAIN_CLOCK 21477270 |
| 55 | |
| 54 | 56 | static INTERRUPT_GEN( pce_interrupt ) |
| 55 | 57 | { |
| 56 | 58 | int ret = 0; |
| 57 | 59 | |
| 58 | 60 | /* bump current scanline */ |
| 59 | 61 | vdc.curline = (vdc.curline + 1) % VDC_LPF; |
| 60 | | vdc.current_segment_line++; |
| 61 | 62 | |
| 62 | 63 | if(vdc.curline==0) |
| 63 | 64 | { |
| 64 | 65 | //state is now in the VDS region, nothing even tries to draw here. |
| 65 | 66 | vdc.top_blanking=(vdc.vdc_data[VPR].b.l&0x1F)+1; |
| 66 | 67 | vdc.top_overscan=(vdc.vdc_data[VPR].b.h)+2; |
| 67 | | vdc.current_bitmap_line=0; |
| 68 | | vdc.current_segment=STATE_TOPBLANK; |
| 69 | | vdc.current_segment_line=0; |
| 70 | 68 | vdc.active_lines = vdc.physical_height = 1 + ( vdc.vdc_data[VDW].w & 0x01FF ); |
| 71 | 69 | vdc.bottomfill=vdc.vdc_data[VCR].b.l; |
| 72 | 70 | } |
| 73 | 71 | |
| 74 | | switch(vdc.current_segment) |
| 75 | | { |
| 76 | | case STATE_TOPBLANK: |
| 77 | | { |
| 78 | | if(vdc.current_segment_line == vdc.top_blanking) |
| 79 | | { |
| 80 | | vdc.current_segment=STATE_TOPFILL; |
| 81 | | vdc.current_segment_line=0; |
| 82 | | } |
| 83 | | break; |
| 72 | if ( vdc.curline < vdc.top_blanking ) { |
| 73 | /* We are in the top blanking area */ |
| 74 | draw_black_line( vdc.curline ); |
| 75 | } else if ( vdc.curline < vdc.top_blanking + vdc.top_overscan ) { |
| 76 | /* We are in the top overscan area */ |
| 77 | draw_overscan_line( vdc.curline ); |
| 78 | } else if ( vdc.curline < vdc.top_blanking + vdc.top_overscan + vdc.active_lines ) { |
| 79 | /* We are in the active screen area */ |
| 80 | if ( vdc.curline == vdc.top_blanking + vdc.top_overscan ) { |
| 81 | vdc.y_scroll = vdc.vdc_data[BYR].w; |
| 84 | 82 | } |
| 85 | | case STATE_TOPFILL: |
| 86 | | { |
| 87 | | if(vdc.current_segment_line == vdc.top_overscan) |
| 88 | | { |
| 89 | | vdc.current_segment=STATE_ACTIVE; |
| 90 | | vdc.current_segment_line=0; |
| 91 | | vdc.y_scroll = vdc.vdc_data[BYR].w; |
| 92 | | } |
| 93 | | break; |
| 94 | | } |
| 95 | | case STATE_ACTIVE: |
| 96 | | { |
| 97 | | if(vdc.current_segment_line == vdc.active_lines) |
| 98 | | { |
| 99 | | vdc.current_segment_line=0; |
| 100 | | if(vdc.bottomfill != 0) |
| 101 | | { |
| 102 | | vdc.current_segment=STATE_BOTTOMFILL; |
| 103 | | vdc.status |= VDC_VD; |
| 104 | | if(vdc.vdc_data[CR].w & CR_VR) |
| 105 | | { |
| 106 | | |
| 83 | pce_refresh_line( vdc.curline, vdc.curline - ( vdc.top_blanking + vdc.top_overscan ) ); |
| 84 | } else { |
| 85 | /* We are in the bottom blanking area */ |
| 86 | if ( vdc.curline == vdc.top_blanking + vdc.top_overscan + vdc.active_lines ) { |
| 87 | if ( vdc.bottomfill != 0 ) { |
| 88 | vdc.status |= VDC_VD; |
| 89 | if ( vdc.vdc_data[CR].w & CR_VR ) |
| 90 | ret = 1; |
| 91 | |
| 92 | /* do VRAM > SATB DMA if the enable bit is set or the DVSSR reg. was written to */ |
| 93 | if( ( vdc.vdc_data[DCR].w & DCR_DSR ) || vdc.dvssr_write ) { |
| 94 | int i; |
| 95 | if ( vdc.dvssr_write ) |
| 96 | vdc.dvssr_write = 0; |
| 97 | |
| 98 | for( i = 0; i < 256; i++ ) { |
| 99 | vdc.sprite_ram[i] = ( vdc.vram[ ( vdc.vdc_data[DVSSR].w << 1 ) + i * 2 + 1 ] << 8 ) | vdc.vram[ ( vdc.vdc_data[DVSSR].w << 1 ) + i * 2 ]; |
| 100 | } |
| 101 | |
| 102 | vdc.status |= VDC_DS; /* set satb done flag */ |
| 103 | |
| 104 | /* generate interrupt if needed */ |
| 105 | if ( vdc.vdc_data[DCR].w & DCR_DSC ) |
| 107 | 106 | ret = 1; |
| 108 | | } |
| 109 | | |
| 110 | | /* do VRAM > SATB DMA if the enable bit is set or the DVSSR reg. was written to */ |
| 111 | | if((vdc.vdc_data[DCR].w & DCR_DSR) || vdc.dvssr_write) |
| 112 | | { |
| 113 | | int i; |
| 114 | | if(vdc.dvssr_write) vdc.dvssr_write = 0; |
| 115 | | for( i = 0; i < 256; i++ ) { |
| 116 | | vdc.sprite_ram[i] = ( vdc.vram[ ( vdc.vdc_data[DVSSR].w << 1 ) + i * 2 + 1 ] << 8 ) | vdc.vram[ ( vdc.vdc_data[DVSSR].w << 1 ) + i * 2 ]; |
| 117 | | } |
| 118 | | vdc.status |= VDC_DS; /* set satb done flag */ |
| 119 | | |
| 120 | | /* generate interrupt if needed */ |
| 121 | | if(vdc.vdc_data[DCR].w & DCR_DSC) |
| 122 | | ret = 1; |
| 123 | | } |
| 124 | | |
| 125 | | } |
| 126 | | else vdc.current_segment=STATE_TOPBLANK; |
| 107 | } |
| 127 | 108 | } |
| 128 | | break; |
| 129 | 109 | } |
| 130 | | case STATE_BOTTOMFILL: |
| 131 | | { |
| 132 | | if(vdc.current_segment_line == vdc.bottomfill) |
| 133 | | { |
| 134 | | vdc.current_segment_line=0; |
| 135 | | vdc.current_segment=STATE_TOPBLANK; |
| 136 | | } |
| 137 | | break; |
| 138 | | } |
| 139 | | |
| 140 | | default:break; |
| 110 | draw_overscan_line( vdc.curline ); |
| 141 | 111 | } |
| 142 | 112 | |
| 143 | | /* draw a line of the display */ |
| 144 | | if(vdc.curline >= FIRST_VISIBLE && vdc.curline < (LAST_VISIBLE)) |
| 145 | | { |
| 146 | | switch(vdc.current_segment) |
| 147 | | { |
| 148 | | default: |
| 149 | | draw_black_line(vdc.current_bitmap_line); |
| 150 | | break; |
| 151 | | case STATE_TOPFILL: |
| 152 | | case STATE_BOTTOMFILL: |
| 153 | | draw_overscan_line(vdc.current_bitmap_line); |
| 154 | | break; |
| 155 | | case STATE_ACTIVE: |
| 156 | | pce_refresh_line(vdc.current_bitmap_line, vdc.current_segment_line); |
| 157 | | break; |
| 158 | | } |
| 159 | | vdc.current_bitmap_line++; |
| 160 | | } |
| 161 | | else |
| 162 | | { |
| 163 | | //rendering can take place here, but it's never on screen! |
| 164 | | switch(vdc.current_segment) |
| 165 | | { |
| 166 | | default: |
| 167 | | draw_black_line(243); |
| 168 | | break; |
| 169 | | case STATE_TOPFILL: |
| 170 | | case STATE_BOTTOMFILL: |
| 171 | | draw_overscan_line(243); |
| 172 | | break; |
| 173 | | case STATE_ACTIVE: |
| 174 | | pce_refresh_line(243, vdc.current_segment_line); |
| 175 | | break; |
| 176 | | } |
| 177 | | } |
| 178 | | |
| 179 | | |
| 180 | 113 | /* generate interrupt on line compare if necessary */ |
| 181 | 114 | if(vdc.vdc_data[CR].w & CR_RC) |
| 182 | | if(vdc.curline == (((vdc.vdc_data[RCR].w-64)+vdc.top_blanking+vdc.top_overscan)%263)) |
| 115 | if( vdc.curline == ( ( ( vdc.vdc_data[RCR].w-64 ) + vdc.top_blanking + vdc.top_overscan ) % ( VDC_LPF + 1 ) )) |
| 183 | 116 | { |
| 184 | 117 | vdc.status |= VDC_RR; |
| 185 | 118 | ret = 1; |
| 186 | 119 | } |
| 187 | 120 | |
| 188 | 121 | /* handle frame events */ |
| 189 | | if(vdc.curline == 261 && vdc.current_segment != STATE_BOTTOMFILL) |
| 122 | if(vdc.curline == VDC_LPF - 1 && ( vdc.bottomfill == 0 || vdc.top_overscan + vdc.top_blanking + vdc.active_lines >= VDC_LPF ) ) |
| 190 | 123 | { |
| 191 | 124 | vdc.status |= VDC_VD; /* set vblank flag */ |
| 192 | 125 | |
| r898 | r899 | |
| 295 | 228 | |
| 296 | 229 | static MACHINE_DRIVER_START( pce ) |
| 297 | 230 | /* basic machine hardware */ |
| 298 | | MDRV_CPU_ADD(H6280, 7195090) |
| 231 | MDRV_CPU_ADD(H6280, MAIN_CLOCK/3) |
| 299 | 232 | MDRV_CPU_PROGRAM_MAP(pce_mem, 0) |
| 300 | 233 | MDRV_CPU_IO_MAP(pce_io, 0) |
| 301 | 234 | MDRV_CPU_VBLANK_INT(pce_interrupt, VDC_LPF) |
| r898 | r899 | |
| 306 | 239 | /* video hardware */ |
| 307 | 240 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 308 | 241 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 309 | | MDRV_SCREEN_SIZE(45*8, 32*8) |
| 310 | | MDRV_SCREEN_VISIBLE_AREA(0*8, 45*8-1, 0*8, 32*8-1) |
| 242 | MDRV_SCREEN_ADD("main",0) |
| 243 | MDRV_SCREEN_RAW_PARAMS(MAIN_CLOCK/2, 684, 0, 684, VDC_LPF, 0, VDC_LPF) |
| 311 | 244 | /* MDRV_GFXDECODE( pce_gfxdecodeinfo ) */ |
| 312 | 245 | MDRV_PALETTE_LENGTH(512) |
| 313 | 246 | MDRV_COLORTABLE_LENGTH(512) |
| r898 | r899 | |
| 317 | 250 | |
| 318 | 251 | MDRV_NVRAM_HANDLER( pce ) |
| 319 | 252 | MDRV_SPEAKER_STANDARD_STEREO("left","right") |
| 320 | | MDRV_SOUND_ADD(C6280, 21477270/6) |
| 253 | MDRV_SOUND_ADD(C6280, MAIN_CLOCK/6) |
| 321 | 254 | MDRV_SOUND_ROUTE(0, "left", 1.00) |
| 322 | 255 | MDRV_SOUND_ROUTE(1, "right", 1.00) |
| 323 | 256 | MACHINE_DRIVER_END |