src/mess/drivers/mz2500.c
| r8974 | r8975 | |
| 1 | | /*************************************************************************** |
| 1 | /******************************************************************************************************************************** |
| 2 | 2 | |
| 3 | 3 | Sharp MZ-2500 (c) 1985 Sharp Corporation |
| 4 | 4 | |
| 5 | 5 | driver by Angelo Salese |
| 6 | 6 | |
| 7 | 7 | TODO: |
| 8 | | - 4096 color mode; |
| 9 | | - Kanji text is cutted in half when font_size is 1, different data used? |
| 10 | | (check Back to the Future); |
| 11 | | - Implement unlatched ROMs (Phone and Dictionary); |
| 8 | - Kanji text is cutted in half when font_size is 1 / interlace is disabled, different data used? (check Back to the Future); |
| 12 | 9 | - Find real CRTC registers |
| 13 | 10 | - Some games doesn't set proper registers if you have interlace enabled, is there any real reason? |
| 14 | 11 | - Implement external ROM hook-up; |
| r8974 | r8975 | |
| 30 | 27 | - Multiplan: hangs after you set the RTC; |
| 31 | 28 | - Murder Club: has lots of CG artifacts; |
| 32 | 29 | - Penguin Kun Wars: has a bug with window effects ("Push space or trigger" msg on the bottom"), needs investigation; |
| 33 | | - Relics: doesn't boot, bad dump? |
| 30 | - Relics: doesn't boot, sets fdc register 0xdc bit 2 to 1 |
| 34 | 31 | - Super MZ Demo 1: Hangs at the logo "roar". |
| 35 | 32 | - Telephone Soft: shows garbage with the CG layer; |
| 36 | 33 | - The Black Onyx: hangs at the title screen, background should also animate; |
| r8974 | r8975 | |
| 49 | 46 | 0x76000-0x77fff NOP (0x3b) |
| 50 | 47 | 0x78000-0x7ffff Phone ROM (0x3c-0x3f) |
| 51 | 48 | |
| 52 | | ****************************************************************************/ |
| 49 | ********************************************************************************************************************************/ |
| 53 | 50 | |
| 54 | 51 | #include "emu.h" |
| 55 | 52 | #include "cpu/z80/z80.h" |
| r8974 | r8975 | |
| 67 | 64 | /* machine stuff */ |
| 68 | 65 | static UINT8 bank_val[8],bank_addr; |
| 69 | 66 | static UINT8 irq_sel,irq_vector[4],irq_mask[4]; |
| 70 | | static UINT8 kanji_bank; |
| 67 | static UINT8 kanji_bank,dic_bank; |
| 71 | 68 | static UINT8 fdc_reverse; |
| 72 | 69 | static UINT8 key_mux; |
| 73 | | static UINT8 cg_reg_index; |
| 74 | | static UINT8 cg_reg[0x20]; |
| 75 | | static UINT8 clut16[0x10]; |
| 76 | | static UINT16 clut256[0x100]; |
| 77 | | static UINT8 cg_mask; |
| 78 | | static UINT8 wid_40; |
| 79 | | static UINT16 cg_vs,cg_ve,cg_hs,cg_he; //CG window parameters |
| 80 | | static UINT8 cg_latch[4]; |
| 81 | 70 | |
| 82 | 71 | #define WRAM_RESET 0 |
| 83 | 72 | #define IPL_RESET 1 |
| r8974 | r8975 | |
| 93 | 82 | static UINT8 text_reg[0x100], text_reg_index; |
| 94 | 83 | static UINT8 text_col_size, text_font_reg; |
| 95 | 84 | static UINT8 pal_select; |
| 85 | static UINT8 wid_40; |
| 86 | static UINT16 cg_vs,cg_ve,cg_hs,cg_he; //CG window parameters |
| 87 | static UINT8 cg_latch[4]; |
| 88 | static UINT8 cg_reg_index; |
| 89 | static UINT8 cg_reg[0x20]; |
| 90 | static UINT8 clut16[0x10]; |
| 91 | static UINT16 clut256[0x100]; |
| 92 | static UINT8 cg_mask; |
| 96 | 93 | |
| 97 | 94 | static VIDEO_START( mz2500 ) |
| 98 | 95 | { |
| r8974 | r8975 | |
| 337 | 334 | cg_interlace = text_font_reg ? 1 : 2; |
| 338 | 335 | |
| 339 | 336 | //popmessage("%d %d %d %d",cg_hs,cg_he,cg_vs,cg_ve); |
| 340 | | popmessage("%d %d",cg_vs,cg_ve); |
| 341 | 337 | |
| 342 | 338 | for(y=0;y<200;y++) |
| 343 | 339 | { |
| r8974 | r8975 | |
| 543 | 539 | } |
| 544 | 540 | } |
| 545 | 541 | break; |
| 542 | case 0x3a: |
| 543 | { |
| 544 | UINT8 *dic_rom = memory_region(machine, "dictionary"); |
| 545 | |
| 546 | return dic_rom[(offset & 0x1fff) + ((dic_bank & 0x1f)*0x2000)]; |
| 547 | } |
| 548 | break; |
| 549 | case 0x3c: |
| 550 | case 0x3d: |
| 551 | case 0x3e: |
| 552 | case 0x3f: |
| 553 | { |
| 554 | UINT8 *phone_rom = memory_region(machine, "phone"); |
| 555 | |
| 556 | return phone_rom[offset+(cur_bank & 3)*0x2000]; |
| 557 | } |
| 558 | break; |
| 546 | 559 | default: return ram[offset+cur_bank*0x2000]; |
| 547 | 560 | } |
| 548 | 561 | |
| r8974 | r8975 | |
| 653 | 666 | } |
| 654 | 667 | } |
| 655 | 668 | break; |
| 669 | case 0x3a: |
| 670 | { |
| 671 | // DIC ROM, WRITENOP |
| 672 | break; |
| 673 | } |
| 674 | case 0x3c: |
| 675 | case 0x3d: |
| 676 | case 0x3e: |
| 677 | case 0x3f: |
| 678 | { |
| 679 | // PHONE ROM, WRITENOP |
| 680 | break; |
| 681 | } |
| 656 | 682 | default: ram[offset+cur_bank*0x2000] = data; break; |
| 657 | 683 | } |
| 658 | 684 | } |
| r8974 | r8975 | |
| 719 | 745 | kanji_bank = data; |
| 720 | 746 | } |
| 721 | 747 | |
| 748 | static WRITE8_HANDLER( mz2500_dictionary_bank_w ) |
| 749 | { |
| 750 | dic_bank = data; |
| 751 | } |
| 752 | |
| 722 | 753 | /* 0xf4 - 0xf7 all returns vblank / hblank states */ |
| 723 | 754 | static READ8_HANDLER( mz2500_crtc_hvblank_r ) |
| 724 | 755 | { |
| r8974 | r8975 | |
| 1213 | 1244 | // AM_RANGE(0xca, 0xca) AM_READWRITE(voice_r,voice_w) |
| 1214 | 1245 | // AM_RANGE(0xcc, 0xcc) AM_READWRITE(calendar_r,calendar_w) |
| 1215 | 1246 | AM_RANGE(0xcc, 0xcd) AM_NOP |
| 1216 | | // AM_RANGE(0xce, 0xce) AM_WRITE(mz2500_dictionary_bank_w) |
| 1217 | | AM_RANGE(0xce, 0xce) AM_NOP |
| 1247 | AM_RANGE(0xce, 0xce) AM_WRITE(mz2500_dictionary_bank_w) |
| 1218 | 1248 | AM_RANGE(0xcf, 0xcf) AM_WRITE(mz2500_kanji_bank_w) |
| 1219 | 1249 | AM_RANGE(0xd8, 0xdb) AM_DEVREADWRITE("mb8877a", mz2500_wd17xx_r, mz2500_wd17xx_w) |
| 1220 | 1250 | AM_RANGE(0xdc, 0xdd) AM_WRITE(mz2500_fdc_w) |
| r8974 | r8975 | |
| 1740 | 1770 | ROM_START( mz2500 ) |
| 1741 | 1771 | ROM_REGION( 0x80000, "maincpu", ROMREGION_ERASEFF ) |
| 1742 | 1772 | |
| 1773 | ROM_REGION( 0x2000, "pcg", ROMREGION_ERASEFF ) |
| 1774 | |
| 1743 | 1775 | ROM_REGION( 0x08000, "ipl", 0 ) |
| 1744 | 1776 | ROM_LOAD( "ipl.rom", 0x00000, 0x8000, CRC(7a659f20) SHA1(ccb3cfdf461feea9db8d8d3a8815f7e345d274f7) ) |
| 1745 | 1777 | |
| r8974 | r8975 | |
| 1756 | 1788 | ROM_REGION( 0x40000, "dictionary", 0 ) |
| 1757 | 1789 | ROM_LOAD( "dict.rom", 0x00000, 0x40000, CRC(aa957c2b) SHA1(19a5ba85055f048a84ed4e8d471aaff70fcf0374) ) |
| 1758 | 1790 | |
| 1759 | | ROM_REGION( 0x2000, "pcg", ROMREGION_ERASEFF ) |
| 1791 | ROM_REGION( 0x8000, "rom", ROMREGION_ERASEFF ) //iplpro |
| 1792 | ROM_LOAD( "sasi.rom", 0x00000, 0x8000, CRC(a7bf39ce) SHA1(3f4a237fc4f34bac6fe2bbda4ce4d16d42400081) ) |
| 1760 | 1793 | |
| 1761 | | ROM_REGION( 0x8000, "rom", ROMREGION_ERASEFF ) |
| 1762 | | ROM_LOAD( "file.rom", 0x00000, 0x8000, CRC(a7bf39ce) SHA1(3f4a237fc4f34bac6fe2bbda4ce4d16d42400081) ) //optional? |
| 1794 | ROM_REGION( 0x8000, "phone", ROMREGION_ERASEFF ) |
| 1795 | ROM_LOAD( "phone.rom", 0x00000, 0x4000, CRC(8e49e4dc) SHA1(2589f0c95028037a41ca32a8fd799c5f085dab51) ) |
| 1763 | 1796 | ROM_END |
| 1764 | 1797 | |
| 1765 | 1798 | /* Driver */ |