src/mess/drivers/pc88va.c
| r9519 | r9520 | |
| 5 | 5 | A follow up of the regular PC-8801. It can also run PC-8801 software in compatible mode |
| 6 | 6 | |
| 7 | 7 | preliminary driver by Angelo Salese |
| 8 | Special thanks to Fujix for his documentation translation help |
| 8 | 9 | |
| 9 | 10 | TODO: |
| 10 | 11 | - Does this system have one or two CPUs? I'm prone to think that the V30 does all the job |
| r9519 | r9520 | |
| 40 | 41 | UINT8 h_line_pos; |
| 41 | 42 | UINT8 blink; |
| 42 | 43 | UINT16 cur_pos_x,cur_pos_y; |
| 44 | UINT8 curn; |
| 45 | UINT8 curn_blink; |
| 43 | 46 | }tsp; |
| 44 | 47 | static UINT16 video_pri_reg[2]; |
| 45 | 48 | |
| r9519 | r9520 | |
| 345 | 348 | UINT32 screen_pri; |
| 346 | 349 | bitmap_fill(bitmap, cliprect, 0); |
| 347 | 350 | |
| 351 | if(tsp.disp_on == 0) // don't bother if we are under DSPOFF command |
| 352 | return 0; |
| 353 | |
| 348 | 354 | /* |
| 349 | 355 | video_pri_reg[0] |
| 350 | 356 | xxxx ---- ---- ---- priority 3 |
| r9519 | r9520 | |
| 541 | 547 | case DSPON: cmd = DSPON; buf_size = 3; buf_index = 0; break; |
| 542 | 548 | |
| 543 | 549 | /* 0x13 - DSPOFF: set DiSPlay OFF */ |
| 544 | | case DSPOFF: tsp.disp_on = 0; break; |
| 550 | case DSPOFF: cmd = DSPOFF; tsp.disp_on = 0; break; |
| 545 | 551 | |
| 546 | 552 | /* 0x14 - DSPDEF: set DiSPlay DEFinitions */ |
| 547 | 553 | case DSPDEF: cmd = DSPDEF; buf_size = 6; buf_index = 0; break; |
| r9519 | r9520 | |
| 559 | 565 | case EMUL: cmd = EMUL; buf_size = 4; buf_index = 0; break; |
| 560 | 566 | |
| 561 | 567 | /* 0x88 - EXIT: ??? */ |
| 562 | | case EXIT: break; |
| 568 | case EXIT: cmd = EXIT; break; |
| 563 | 569 | |
| 564 | 570 | /* 0x82 - SPRON: set SPRite ON */ |
| 565 | | case SPRON: cmd = SPRON; buf_size = 3; buf_index = 0; break; |
| 571 | case SPRON: cmd = SPRON; buf_size = 3; buf_index = 0; break; |
| 566 | 572 | |
| 567 | 573 | /* 0x83 - SPROFF: set SPRite OFF */ |
| 568 | | case SPROFF: tsp.spr_on = 0; break; |
| 574 | case SPROFF: cmd = SPROFF; tsp.spr_on = 0; break; |
| 569 | 575 | |
| 570 | 576 | /* 0x85 - SPRSW: ??? */ |
| 571 | | case SPRSW: cmd = SPRSW; buf_size = 1; buf_index = 0; break; |
| 577 | case SPRSW: cmd = SPRSW; buf_size = 1; buf_index = 0; break; |
| 572 | 578 | |
| 573 | 579 | /* 0x81 - SPROV: set SPRite OVerflow information */ |
| 574 | | case 0x81: /* ... */ break; |
| 580 | /* |
| 581 | -x-- ---- Sprite Over flag |
| 582 | --x- ---- Sprite Collision flag |
| 583 | ---x xxxx First sprite that caused Sprite Over event |
| 584 | */ |
| 585 | case SPROV: cmd = SPROV; /* TODO: where it returns the info? */ break; |
| 575 | 586 | |
| 576 | 587 | /* TODO: 0x89 shouldn't trigger, should be one of the above commands */ |
| 577 | 588 | default: cmd = 0x00; printf("PC=%05x: Unknown IDP %02x cmd set\n",cpu_get_pc(space->cpu),data); break; |
| 578 | 589 | } |
| 579 | 590 | } |
| 580 | 591 | |
| 592 | static void tsp_sprite_enable(running_machine *machine, UINT32 spr_offset, UINT8 sw_bit) |
| 593 | { |
| 594 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 595 | |
| 596 | space->write_word(spr_offset, space->read_word(spr_offset) & ~0x200); |
| 597 | space->write_word(spr_offset, space->read_word(spr_offset) | (sw_bit & 0x200)); |
| 598 | } |
| 599 | |
| 581 | 600 | /* TODO: very preliminary, needs something showable first */ |
| 582 | 601 | static void execute_sync_cmd(running_machine *machine) |
| 583 | 602 | { |
| r9519 | r9520 | |
| 642 | 661 | /* |
| 643 | 662 | [0] attr offset (lo word) |
| 644 | 663 | [1] attr offset (hi word) |
| 645 | | [2] pitch |
| 664 | [2] pitch (character code interval x 16, i.e. 0x20 = 2 bytes |
| 646 | 665 | [3] line height |
| 647 | | [4] h line position |
| 666 | [4] hline vertical position |
| 648 | 667 | [5] blink number |
| 649 | 668 | */ |
| 650 | 669 | tsp.attr_offset = buf_ram[0] | buf_ram[1] << 8; |
| r9519 | r9520 | |
| 658 | 677 | { |
| 659 | 678 | /* |
| 660 | 679 | xxxx x--- [0] Sprite Cursor number (sprite RAM entry) |
| 661 | | ---- --x- [0] (bit in sprite def) |
| 680 | ---- --x- [0] show cursor bit (actively modifies the spriteram entry) |
| 662 | 681 | ---- ---x [0] Blink Enable |
| 663 | 682 | */ |
| 664 | 683 | |
| 665 | 684 | /* TODO: needs basic sprite emulation */ |
| 685 | tsp.curn = (buf_ram[0] & 0xf8); |
| 686 | tsp.curn_blink = (buf_ram[0] & 1); |
| 687 | |
| 688 | tsp_sprite_enable(machine, 0xa0000 + tsp.spr_offset + tsp.curn, (buf_ram[0] & 2) << 8); |
| 666 | 689 | } |
| 667 | 690 | |
| 668 | 691 | static void execute_actscr_cmd(running_machine *machine) |
| 669 | 692 | { |
| 670 | 693 | /* |
| 671 | | xxxx xxxx [0] param * 32 (???) |
| 694 | This command assigns a strip where the cursor is located. |
| 695 | xxxx xxxx [0] strip ID * 32 (???) |
| 672 | 696 | */ |
| 673 | 697 | |
| 674 | 698 | /* TODO: no idea about this command */ |
| 699 | //printf("ACTSCR: %02x\n",buf_ram[0]); |
| 675 | 700 | } |
| 676 | 701 | |
| 677 | 702 | static void execute_curs_cmd(running_machine *machine) |
| r9519 | r9520 | |
| 689 | 714 | |
| 690 | 715 | static void execute_emul_cmd(running_machine *machine) |
| 691 | 716 | { |
| 717 | /* |
| 718 | [0] Emulate target strip ID x 32 |
| 719 | [1] The number of chars |
| 720 | [2] The number of attributes |
| 721 | [3] The number of lines |
| 722 | */ |
| 723 | |
| 692 | 724 | // TODO: this starts 3301 video emulation |
| 725 | //popmessage("Warning: TSP executes EMUL command, contact MESSdev"); |
| 693 | 726 | } |
| 694 | 727 | |
| 695 | 728 | static void execute_spron_cmd(running_machine *machine) |
| r9519 | r9520 | |
| 697 | 730 | /* |
| 698 | 731 | [0] Sprite Table Offset (hi word) |
| 699 | 732 | [1] (unknown / reserved) |
| 700 | | xxxx x--- [2] HSPN: some kind of Sprite Over register |
| 701 | | ---- --x- [2] MG: ??? |
| 702 | | ---- ---x [2] GR: ??? |
| 733 | xxxx x--- [2] HSPN: Maximum number of sprites in one raster (num + 1) for Sprite Over |
| 734 | ---- --x- [2] MG: all sprites are 2x zoomed vertically when 1 |
| 735 | ---- ---x [2] GR: 1 to enable the group collision detection |
| 703 | 736 | */ |
| 704 | 737 | tsp.spr_offset = buf_ram[0] << 8; |
| 705 | 738 | tsp.spr_on = 1; |
| r9519 | r9520 | |
| 708 | 741 | |
| 709 | 742 | static void execute_sprsw_cmd(running_machine *machine) |
| 710 | 743 | { |
| 711 | | /* TODO: no idea about this command, some kind of manual sprite switch? */ |
| 744 | /* |
| 745 | Toggle an individual sprite in the sprite ram entry |
| 746 | [0] xxxx x--- target sprite number |
| 747 | [0] ---- --x- sprite off/on switch |
| 748 | */ |
| 749 | |
| 750 | tsp_sprite_enable(machine, 0xa0000 + tsp.spr_offset + (buf_ram[0] & 0xf8), (buf_ram[0] & 2) << 8); |
| 712 | 751 | } |
| 713 | 752 | |
| 714 | 753 | static WRITE8_HANDLER( idp_param_w ) |