src/mess/drivers/x1.c
| r5549 | r5550 | |
| 561 | 561 | // fatalerror("Data written to the DMA space"); |
| 562 | 562 | } |
| 563 | 563 | |
| 564 | /* TODO: still not yet perfect */ |
| 565 | static UINT16 check_pcg_addr(running_machine *machine) |
| 566 | { |
| 567 | if(colorram[0x7ff] & 0x20) return 0x7ff; |
| 568 | if(colorram[0x3ff] & 0x20) return 0x3ff; |
| 569 | if(colorram[0x5ff] & 0x20) return 0x5ff; |
| 570 | if(colorram[0x1ff] & 0x20) return 0x1ff; |
| 571 | |
| 572 | return 0x3ff; |
| 573 | } |
| 574 | |
| 564 | 575 | static WRITE8_HANDLER( x1_pcg_w ) |
| 565 | 576 | { |
| 566 | 577 | int addr,pcg_offset; |
| 567 | 578 | UINT8 *PCG_RAM = memory_region(space->machine, "pcg"); |
| 579 | static UINT16 used_pcg_addr; |
| 568 | 580 | |
| 569 | 581 | addr = (offset & 0x300) >> 8; |
| 570 | 582 | |
| r5549 | r5550 | |
| 586 | 598 | { |
| 587 | 599 | // if(!ply_reg.pcg_mode) |
| 588 | 600 | // { |
| 589 | | //( ((V_CNT-CRT_YL)/FNT_YL) + TXT_YL) * TXT_XL |
| 590 | | // int v_count = video_screen_get_vpos(space->machine->primary_screen); |
| 591 | 601 | // |
| 592 | 602 | // } |
| 593 | 603 | // else |
| 594 | 604 | { |
| 595 | | pcg_offset = (pcg_index[addr-1]) & 0x7ff; |
| 605 | used_pcg_addr = videoram[check_pcg_addr(space->machine)]*8; |
| 606 | pcg_offset = (pcg_index[addr-1]+used_pcg_addr) & 0x7ff; |
| 596 | 607 | pcg_offset+=((addr-1)*0x800); |
| 597 | 608 | PCG_RAM[pcg_offset] = data; |
| 598 | 609 | |
| r5549 | r5550 | |
| 604 | 615 | gfx_element_mark_dirty(space->machine->gfx[7], pcg_offset >> 3); |
| 605 | 616 | |
| 606 | 617 | pcg_index[addr-1]++; |
| 618 | pcg_index[addr-1]&=7; |
| 607 | 619 | } |
| 608 | 620 | } |
| 609 | 621 | } |