trunk/src/mess/drivers/pc9801.c
| r19337 | r19338 | |
| 5 | 5 | preliminary driver by Angelo Salese |
| 6 | 6 | |
| 7 | 7 | TODO: |
| 8 | | - floppy interface doesn't seem to work at all with either floppy inserted or not, missing DMA irq? |
| 9 | 8 | - proper 8251 uart hook-up on keyboard |
| 10 | | - boot is too slow right now, might be due of the floppy / HDD devices |
| 11 | 9 | - investigate on POR bit |
| 12 | | - Write a PC80S31K device (also used on PC-8801 and PC-88VA, it's the FDC + Z80 sub-system); |
| 13 | 10 | - Check for mouse support |
| 14 | | - .FDI support, should be a standard raw image, but then it mis-match with the Western file format ... |
| 15 | 11 | - kanji support; |
| 12 | - Write a PC80S31K device (also used on PC-8801 and PC-88VA, it's the FDC + Z80 sub-system); |
| 16 | 13 | |
| 17 | 14 | TODO (PC-9801RS): |
| 18 | | - floppy disk hook-up; |
| 19 | 15 | - extra features; |
| 20 | 16 | - clean-up duplicate code; |
| 21 | 17 | |
| r19337 | r19338 | |
| 621 | 617 | int xi,yi; |
| 622 | 618 | int x; |
| 623 | 619 | UINT8 char_size,interlace_on; |
| 624 | | UINT8 kanji_on; |
| 625 | 620 | UINT16 tile; |
| 626 | 621 | UINT8 pcg_sel, pcg_lr; |
| 622 | UINT8 kanji_sel; |
| 627 | 623 | |
| 628 | 624 | if(state->m_video_ff[DISPLAY_REG] == 0) //screen is off |
| 629 | 625 | return; |
| 630 | 626 | |
| 631 | 627 | interlace_on = state->m_video_ff[INTERLACE_REG]; |
| 632 | 628 | char_size = (interlace_on) ? 16 : 8; |
| 633 | | kanji_on = 0; |
| 634 | 629 | tile = 0; |
| 635 | 630 | |
| 636 | 631 | for(x=0;x<pitch;x++) |
| r19337 | r19338 | |
| 643 | 638 | |
| 644 | 639 | tile_addr = addr+(x*(state->m_video_ff[WIDTH40_REG]+1)); |
| 645 | 640 | |
| 646 | | if(kanji_on) |
| 647 | | kanji_on--; |
| 648 | | |
| 649 | 641 | pcg_sel = 0; |
| 642 | kanji_sel = 0; |
| 650 | 643 | pcg_lr = 0; |
| 651 | 644 | |
| 652 | | if(kanji_on == 0) |
| 645 | tile = state->m_video_ram_1[(tile_addr*2) & 0x1fff] & 0xff; |
| 646 | knj_tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0xff; |
| 647 | if((tile == 0x56 || tile == 0x57) && knj_tile) |
| 653 | 648 | { |
| 654 | | tile = state->m_video_ram_1[(tile_addr*2) & 0x1fff] & 0x00ff; |
| 655 | | knj_tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0xff; |
| 656 | | if((tile & 0xe0) == 0 && knj_tile) // kanji select, TODO |
| 657 | | { |
| 658 | | tile <<= 8; |
| 659 | | tile |= (knj_tile & 0x7f); |
| 660 | | /* annoying kanji bit-swap applied on the address bus ... */ |
| 661 | | tile = BITSWAP16(tile,7,15,14,13,12,11,6,5,10,9,8,4,3,2,1,0); |
| 662 | | tile &= 0x1fff; |
| 663 | | kanji_on = 2; |
| 664 | | } |
| 665 | | else if((tile == 0x56 || tile == 0x57) && knj_tile) |
| 666 | | { |
| 667 | | pcg_sel = 1; |
| 668 | | tile = knj_tile & 0x7f; |
| 669 | | pcg_lr = (knj_tile & 0x80) >> 7; |
| 670 | | } |
| 649 | pcg_sel = 1; |
| 650 | tile = knj_tile & 0x7f; |
| 651 | pcg_lr = (knj_tile & 0x80) >> 7; |
| 671 | 652 | } |
| 653 | else if(knj_tile) // kanji select, TODO |
| 654 | { |
| 655 | pcg_lr = (knj_tile & 0x80) >> 7; |
| 656 | pcg_lr |= (tile & 0x80) >> 7; // Tokimeki Sports Gal 3 |
| 657 | tile &= 0x7f; |
| 658 | tile <<= 8; |
| 659 | tile |= (knj_tile & 0x7f); |
| 660 | /* annoying kanji bit-swap applied on the address bus ... */ |
| 661 | tile = BITSWAP16(tile,15,7,14,13,12,11,6,5,10,9,8,4,3,2,1,0); |
| 662 | // tile&=0x7fff; |
| 663 | kanji_sel = 1; |
| 664 | } |
| 672 | 665 | attr = (state->m_video_ram_1[(tile_addr*2 & 0x1fff) | 0x2000] & 0x00ff); |
| 673 | 666 | |
| 674 | 667 | secret = (attr & 1) ^ 1; |
| r19337 | r19338 | |
| 694 | 687 | |
| 695 | 688 | if(!secret) |
| 696 | 689 | { |
| 697 | | if(kanji_on) |
| 698 | | tile_data = (state->m_kanji_rom[tile*0x20+yi*2+(kanji_on & 1)]); |
| 690 | if(kanji_sel) |
| 691 | tile_data = (state->m_kanji_rom[tile*0x20+yi*2+pcg_lr]); |
| 699 | 692 | else if(pcg_sel) |
| 700 | 693 | tile_data = (state->m_pcg_ram[0xac000*2+tile*0x40+yi*2+pcg_lr]); |
| 701 | 694 | else |
| r19337 | r19338 | |
| 3478 | 3471 | ROM_LOAD("hn613128pac8.bin",0x00800, 0x01000, BAD_DUMP CRC(b5a15b5c) SHA1(e5f071edb72a5e9a8b8b1c23cf94a74d24cb648e) ) //bad dump, 8x16 charset? (it's on the kanji board) |
| 3479 | 3472 | |
| 3480 | 3473 | ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF ) |
| 3481 | | ROM_LOAD16_BYTE( "24256c-x01.bin", 0x00000, 0x8000, CRC(28ec1375) SHA1(9d8e98e703ce0f483df17c79f7e841c5c5cd1692) ) |
| 3482 | | ROM_LOAD16_BYTE( "24256c-x02.bin", 0x00001, 0x8000, CRC(90985158) SHA1(78fb106131a3f4eb054e87e00fe4f41193416d65) ) |
| 3483 | | ROM_LOAD16_BYTE( "24256c-x03.bin", 0x10000, 0x8000, CRC(d4893543) SHA1(eb8c1bee0f694e1e0c145a24152222d4e444e86f) ) |
| 3484 | | ROM_LOAD16_BYTE( "24256c-x04.bin", 0x10001, 0x8000, CRC(5dec0fc2) SHA1(41000da14d0805ed0801b31eb60623552e50e41c) ) |
| 3474 | ROM_LOAD16_BYTE( "24256c-x01.bin", 0x00000, 0x8000, BAD_DUMP CRC(28ec1375) SHA1(9d8e98e703ce0f483df17c79f7e841c5c5cd1692) ) |
| 3475 | ROM_LOAD16_BYTE( "24256c-x02.bin", 0x00001, 0x8000, BAD_DUMP CRC(90985158) SHA1(78fb106131a3f4eb054e87e00fe4f41193416d65) ) |
| 3476 | ROM_LOAD16_BYTE( "24256c-x03.bin", 0x10000, 0x8000, BAD_DUMP CRC(d4893543) SHA1(eb8c1bee0f694e1e0c145a24152222d4e444e86f) ) |
| 3477 | ROM_LOAD16_BYTE( "24256c-x04.bin", 0x10001, 0x8000, BAD_DUMP CRC(5dec0fc2) SHA1(41000da14d0805ed0801b31eb60623552e50e41c) ) |
| 3485 | 3478 | ROM_END |
| 3486 | 3479 | |
| 3487 | 3480 | /* |
| r19337 | r19338 | |
| 3550 | 3543 | ROM_REGION( 0x50000, "chargen", 0 ) |
| 3551 | 3544 | ROM_LOAD( "font_rs.rom", 0x00000, 0x46800, BAD_DUMP CRC(da370e7a) SHA1(584d0c7fde8c7eac1f76dc5e242102261a878c5e) ) |
| 3552 | 3545 | |
| 3553 | | ROM_REGION( 0x45000, "kanji", ROMREGION_ERASEFF ) |
| 3546 | ROM_REGION( 0x40000, "kanji", ROMREGION_ERASEFF ) |
| 3554 | 3547 | ROM_LOAD16_BYTE( "24256c-x01.bin", 0x00000, 0x8000, BAD_DUMP CRC(28ec1375) SHA1(9d8e98e703ce0f483df17c79f7e841c5c5cd1692) ) |
| 3555 | 3548 | ROM_LOAD16_BYTE( "24256c-x02.bin", 0x00001, 0x8000, BAD_DUMP CRC(90985158) SHA1(78fb106131a3f4eb054e87e00fe4f41193416d65) ) |
| 3556 | 3549 | ROM_LOAD16_BYTE( "24256c-x03.bin", 0x10000, 0x8000, BAD_DUMP CRC(d4893543) SHA1(eb8c1bee0f694e1e0c145a24152222d4e444e86f) ) |