src/mess/drivers/x1.c
| r5742 | r5743 | |
| 1053 | 1053 | turbo_reg.gfx_pal = data; |
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | static UINT8 kanji_addr_l,kanji_addr_h,kanji_count; |
| 1057 | static UINT32 kanji_addr; |
| 1058 | |
| 1059 | /* |
| 1060 | * FIXME: recheck this once that the kanji rom is redumped, it's confirmed bad for the following reasons: |
| 1061 | * - A game lets you type stuff that's typed with this function, the index doesn't match with the typed char; |
| 1062 | * - It search for chars that are out of the rom range; |
| 1063 | */ |
| 1064 | static READ8_HANDLER( x1_kanji_r ) |
| 1065 | { |
| 1066 | UINT8 *kanji_rom = memory_region(space->machine, "cgrom"); |
| 1067 | UINT8 res; |
| 1068 | |
| 1069 | //res = 0; |
| 1070 | |
| 1071 | //printf("%08x\n",kanji_addr*0x20); |
| 1072 | |
| 1073 | res = kanji_rom[(kanji_addr*0x20)+(kanji_count)+0x2800]; |
| 1074 | kanji_count++; |
| 1075 | kanji_count&=0x1f; |
| 1076 | |
| 1077 | //printf("%04x R\n",offset); |
| 1078 | |
| 1079 | return res; |
| 1080 | } |
| 1081 | |
| 1082 | static WRITE8_HANDLER( x1_kanji_w ) |
| 1083 | { |
| 1084 | //printf("%04x %02x W\n",offset,data); |
| 1085 | switch(offset) |
| 1086 | { |
| 1087 | case 0: kanji_addr_l = (data & 0xff); break; |
| 1088 | case 1: kanji_addr_h = (data & 0xff); kanji_count = 0; break; |
| 1089 | case 2: |
| 1090 | if(data) |
| 1091 | { |
| 1092 | kanji_addr = (kanji_addr_h<<8) | (kanji_addr_l); |
| 1093 | kanji_addr &= 0x3fff; //<- temp kludge until the rom is redumped. |
| 1094 | //printf("%08x\n",kanji_addr); |
| 1095 | //kanji_addr+= kanji_count; |
| 1096 | } |
| 1097 | break; |
| 1098 | } |
| 1099 | } |
| 1100 | |
| 1056 | 1101 | /************************************* |
| 1057 | 1102 | * |
| 1058 | 1103 | * Memory maps |
| r5742 | r5743 | |
| 1134 | 1179 | if(offset == 0x0700 || offset == 0x0701) { return ym2151_r(devtag_get_device(space->machine, "ym"), offset-0x0700); } |
| 1135 | 1180 | else if(offset >= 0x0704 && offset <= 0x0707) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x0704); } |
| 1136 | 1181 | else if(offset == 0x0e03) { return x1_rom_r(space, 0); } |
| 1182 | else if(offset >= 0x0e80 && offset <= 0x0e83) { return x1_kanji_r(space, offset-0xe80); } |
| 1137 | 1183 | else if(offset >= 0x0ff8 && offset <= 0x0fff) { return x1_fdc_r(space, offset-0xff8); } |
| 1138 | 1184 | else if(offset >= 0x1400 && offset <= 0x17ff) { return x1_pcg_r(space, offset-0x1400); } |
| 1139 | 1185 | else if(offset >= 0x1900 && offset <= 0x19ff) { return sub_io_r(space, 0); } |
| r5742 | r5743 | |
| 1155 | 1201 | else if(offset >= 0x4000 && offset <= 0xffff) { return gfx_bitmap_ram[offset-0x4000+(scrn_reg.gfx_bank*0xc000)]; } |
| 1156 | 1202 | else |
| 1157 | 1203 | { |
| 1204 | //0xfd0-0xfd7: FDC extended area? |
| 1205 | //0x1ff0: if 0, game screen is interlaced |
| 1158 | 1206 | logerror("(PC=%06x) Read i/o address %04x\n",cpu_get_pc(space->cpu),offset); |
| 1159 | 1207 | } |
| 1160 | 1208 | return 0xff; |
| r5742 | r5743 | |
| 1167 | 1215 | else if(offset >= 0x0704 && offset <= 0x0707) { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x0704,data); } |
| 1168 | 1216 | // else if(offset >= 0x0c00 && offset <= 0x0cff) { x1_rs232c_w(space->machine, 0, data); } |
| 1169 | 1217 | else if(offset >= 0x0e00 && offset <= 0x0e02) { x1_rom_w(space, offset-0xe00,data); } |
| 1170 | | // else if(offset >= 0x0e80 && offset <= 0x0e82) { x1_kanji_w(space->machine, offset-0xe80,data); } |
| 1218 | else if(offset >= 0x0e80 && offset <= 0x0e83) { x1_kanji_w(space, offset-0xe80,data); } |
| 1171 | 1219 | else if(offset >= 0x0ff8 && offset <= 0x0fff) { x1_fdc_w(space, offset-0xff8,data); } |
| 1172 | 1220 | else if(offset >= 0x1000 && offset <= 0x10ff) { x1_pal_b_w(space, 0,data); } |
| 1173 | 1221 | else if(offset >= 0x1100 && offset <= 0x11ff) { x1_pal_r_w(space, 0,data); } |
| r5742 | r5743 | |
| 1679 | 1727 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8, 0x200, 0x20 ) |
| 1680 | 1728 | GFXDECODE_ENTRY( "pcg", 0x00000, x1_pcg_8x8, 0x000, 1 ) |
| 1681 | 1729 | GFXDECODE_ENTRY( "cgrom", 0x01800, x1_chars_8x16, 0x200, 0x20 ) |
| 1682 | | GFXDECODE_ENTRY( "kanji", 0x27000, x1_chars_16x16, 0, 0x20 ) //needs to be checked when the ROM will be redumped |
| 1730 | // GFXDECODE_ENTRY( "kanji", 0x27000, x1_chars_16x16, 0, 0x20 ) //needs to be checked when the ROM will be redumped |
| 1731 | GFXDECODE_ENTRY( "cgrom", 0x02800, x1_chars_16x16, 0, 0x20 ) //needs to be checked when the ROM will be redumped |
| 1683 | 1732 | GFXDECODE_END |
| 1684 | 1733 | |
| 1685 | 1734 | /************************************* |
| r5742 | r5743 | |
| 1965 | 2014 | |
| 1966 | 2015 | ROM_REGION(0x1800, "pcg", ROMREGION_ERASEFF) |
| 1967 | 2016 | |
| 1968 | | ROM_REGION(0x4c600, "cgrom", 0) |
| 2017 | ROM_REGION(0x4d600, "cgrom", 0) |
| 1969 | 2018 | ROM_LOAD("fnt0808.x1", 0x00000, 0x00800, CRC(e3995a57) SHA1(1c1a0d8c9f4c446ccd7470516b215ddca5052fb2) ) |
| 1970 | 2019 | ROM_RELOAD( 0x00800, 0x00800) |
| 1971 | 2020 | ROM_RELOAD( 0x01000, 0x00800) |
| r5742 | r5743 | |
| 1986 | 2035 | |
| 1987 | 2036 | ROM_REGION(0x1800, "pcg", ROMREGION_ERASEFF) |
| 1988 | 2037 | |
| 1989 | | ROM_REGION(0x2800, "cgrom", 0) |
| 2038 | ROM_REGION(0x4d600, "cgrom", 0) |
| 1990 | 2039 | ROM_LOAD("fnt0808.x1", 0x00000, 0x00800, CRC(e3995a57) SHA1(1c1a0d8c9f4c446ccd7470516b215ddca5052fb2) ) |
| 1991 | 2040 | ROM_RELOAD( 0x00800, 0x00800) |
| 1992 | 2041 | ROM_RELOAD( 0x01000, 0x00800) |
| r5742 | r5743 | |
| 2006 | 2055 | |
| 2007 | 2056 | ROM_REGION(0x1800, "pcg", ROMREGION_ERASEFF) |
| 2008 | 2057 | |
| 2009 | | ROM_REGION(0x2800, "cgrom", 0) |
| 2058 | ROM_REGION(0x4d600, "cgrom", 0) |
| 2010 | 2059 | /* This should be larger... hence, we are missing something (maybe part of the other fnt roms?) */ |
| 2011 | 2060 | ROM_LOAD("fnt0808_turbo.x1", 0x00000, 0x00800, CRC(84a47530) SHA1(06c0995adc7a6609d4272417fe3570ca43bd0454) ) |
| 2012 | 2061 | ROM_RELOAD( 0x00800, 0x00800) |
| 2013 | 2062 | ROM_RELOAD( 0x01000, 0x00800) |
| 2014 | 2063 | ROM_LOAD("fnt0816.x1", 0x01800, 0x01000, BAD_DUMP CRC(34818d54) SHA1(2c5fdd73249421af5509e48a94c52c4e423402bf) ) |
| 2064 | ROM_LOAD("fnt1616.x1", 0x02800, 0x4ac00, BAD_DUMP CRC(46826745) SHA1(b9e6c320611f0842df6f45673c47c3e23bc14272) ) |
| 2015 | 2065 | |
| 2016 | 2066 | ROM_REGION(0x4ac00, "kanji", 0) |
| 2017 | 2067 | /* This is clearly a bad dump: size does not make sense and from 0x28000 on there are only 0xff */ |