src/mess/drivers/x1.c
| r6293 | r6294 | |
| 1001 | 1001 | |
| 1002 | 1002 | if(addr == 0) |
| 1003 | 1003 | { |
| 1004 | | gfx_data = memory_region(space->machine, "cgrom"); |
| 1005 | | res = gfx_data[0x0000+bios_offset+(pcg_write_addr*8)]; |
| 1004 | printf("%04x %02x\n",pcg_write_addr,bios_offset); |
| 1005 | gfx_data = memory_region(space->machine, "font"); |
| 1006 | res = gfx_data[0x0800+bios_offset+(pcg_write_addr*0x20)]; |
| 1006 | 1007 | |
| 1007 | 1008 | bios_offset++; |
| 1008 | | bios_offset&=0x7; |
| 1009 | bios_offset&=0x1f; |
| 1009 | 1010 | return res; |
| 1010 | 1011 | } |
| 1011 | 1012 | else |
| r6293 | r6294 | |
| 1228 | 1229 | */ |
| 1229 | 1230 | static READ8_HANDLER( x1_kanji_r ) |
| 1230 | 1231 | { |
| 1231 | | UINT8 *kanji_rom = memory_region(space->machine, "cgrom"); |
| 1232 | UINT8 *kanji_rom = memory_region(space->machine, "kanji"); |
| 1232 | 1233 | UINT8 res; |
| 1233 | 1234 | |
| 1234 | 1235 | //res = 0; |
| 1235 | 1236 | |
| 1236 | 1237 | //printf("%08x\n",kanji_addr*0x20); |
| 1237 | 1238 | |
| 1238 | | res = kanji_rom[(kanji_addr*0x20)+(kanji_count)+0x2800]; |
| 1239 | res = kanji_rom[(kanji_addr*0x20)+(kanji_count)]; |
| 1239 | 1240 | kanji_count++; |
| 1240 | 1241 | kanji_count&=0x1f; |
| 1241 | 1242 | |
| r6293 | r6294 | |
| 1246 | 1247 | |
| 1247 | 1248 | static WRITE8_HANDLER( x1_kanji_w ) |
| 1248 | 1249 | { |
| 1249 | | //printf("%04x %02x W\n",offset,data); |
| 1250 | // if(offset < 2) |
| 1251 | // printf("%04x %02x W\n",offset,data); |
| 1250 | 1252 | switch(offset) |
| 1251 | 1253 | { |
| 1252 | 1254 | case 0: kanji_addr_l = (data & 0xff); break; |
| r6293 | r6294 | |
| 1880 | 1882 | |
| 1881 | 1883 | static const gfx_layout x1_chars_16x16 = |
| 1882 | 1884 | { |
| 1883 | | 16,16, |
| 1885 | 8,8, |
| 1884 | 1886 | RGN_FRAC(1,1), |
| 1885 | 1887 | 1, |
| 1886 | 1888 | { 0 }, |
| 1887 | | { 0, 1, 2, 3, 4, 5, 6, 7,8,9,10,11,12,13,14,15 }, |
| 1888 | | { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }, |
| 1889 | | 16*16 |
| 1889 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 1890 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 1891 | 8*8 |
| 1890 | 1892 | }; |
| 1891 | 1893 | |
| 1892 | 1894 | /* decoded for debugging purpose, this will be nuked in the end... */ |
| 1893 | 1895 | static GFXDECODE_START( x1 ) |
| 1894 | 1896 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8, 0x200, 0x20 ) |
| 1895 | 1897 | GFXDECODE_ENTRY( "pcg", 0x00000, x1_pcg_8x8, 0x000, 1 ) |
| 1896 | | GFXDECODE_ENTRY( "cgrom", 0x01800, x1_chars_8x16, 0x200, 0x20 ) |
| 1897 | | // GFXDECODE_ENTRY( "kanji", 0x27000, x1_chars_16x16, 0, 0x20 ) //needs to be checked when the ROM will be redumped |
| 1898 | | GFXDECODE_ENTRY( "cgrom", 0x02800, x1_chars_16x16, 0, 0x20 ) //needs to be checked when the ROM will be redumped |
| 1898 | GFXDECODE_ENTRY( "font", 0x00000, x1_chars_8x16, 0x200, 0x20 ) |
| 1899 | GFXDECODE_ENTRY( "kanji", 0x00000, x1_chars_16x16, 0, 0x20 ) |
| 1899 | 1900 | GFXDECODE_END |
| 1900 | 1901 | |
| 1901 | 1902 | /************************************* |
| r6293 | r6294 | |
| 2198 | 2199 | |
| 2199 | 2200 | ROM_REGION(0x1800, "pcg", ROMREGION_ERASEFF) |
| 2200 | 2201 | |
| 2202 | ROM_REGION(0x2000, "font", 0) //TODO: this contains 8x16 charset only, maybe it's possible that it derivates a 8x8 charset by skipping gfx lines? |
| 2203 | ROM_LOAD( "ank.fnt", 0x0000, 0x2000, BAD_DUMP CRC(19689fbd) SHA1(0d4e072cd6195a24a1a9b68f1d37500caa60e599) ) |
| 2204 | |
| 2201 | 2205 | ROM_REGION(0x4d600, "cgrom", 0) |
| 2202 | 2206 | ROM_LOAD("fnt0808.x1", 0x00000, 0x00800, CRC(e3995a57) SHA1(1c1a0d8c9f4c446ccd7470516b215ddca5052fb2) ) |
| 2203 | 2207 | ROM_RELOAD( 0x00800, 0x00800) |
| 2204 | 2208 | ROM_RELOAD( 0x01000, 0x00800) |
| 2205 | | ROM_LOAD("fnt0816.x1", 0x01800, 0x1000, BAD_DUMP CRC(34818d54) SHA1(2c5fdd73249421af5509e48a94c52c4e423402bf) ) |
| 2206 | 2209 | |
| 2207 | | ROM_REGION(0x4ac00, "kanji", ROMREGION_ERASEFF) |
| 2210 | ROM_REGION(0x20000, "kanji", ROMREGION_ERASEFF) |
| 2211 | |
| 2212 | ROM_REGION(0x20000, "raw_kanji", ROMREGION_ERASEFF) |
| 2208 | 2213 | ROM_END |
| 2209 | 2214 | |
| 2210 | 2215 | ROM_START( x1ck ) |
| r6293 | r6294 | |
| 2219 | 2224 | |
| 2220 | 2225 | ROM_REGION(0x1800, "pcg", ROMREGION_ERASEFF) |
| 2221 | 2226 | |
| 2227 | ROM_REGION(0x2000, "font", 0) //TODO: this contains 8x16 charset only, maybe it's possible that it derivates a 8x8 charset by skipping gfx lines? |
| 2228 | ROM_LOAD( "ank.fnt", 0x0000, 0x2000, BAD_DUMP CRC(19689fbd) SHA1(0d4e072cd6195a24a1a9b68f1d37500caa60e599) ) |
| 2229 | |
| 2222 | 2230 | ROM_REGION(0x4d600, "cgrom", 0) |
| 2223 | 2231 | ROM_LOAD("fnt0808.x1", 0x00000, 0x00800, CRC(e3995a57) SHA1(1c1a0d8c9f4c446ccd7470516b215ddca5052fb2) ) |
| 2224 | 2232 | ROM_RELOAD( 0x00800, 0x00800) |
| 2225 | 2233 | ROM_RELOAD( 0x01000, 0x00800) |
| 2226 | | ROM_LOAD("fnt0816.x1", 0x01800, 0x01000, BAD_DUMP CRC(34818d54) SHA1(2c5fdd73249421af5509e48a94c52c4e423402bf) ) |
| 2227 | 2234 | |
| 2228 | | ROM_REGION(0x4ac00, "kanji", 0) |
| 2229 | | /* This is clearly a bad dump: size does not make sense and from 0x28000 on there are only 0xff */ |
| 2230 | | ROM_LOAD("kanji2.rom", 0x0000, 0x4ac00, BAD_DUMP CRC(33800ef2) SHA1(fc07a31ee30db312c7995e887519a9173cb38c0d) ) |
| 2235 | ROM_REGION(0x20000, "kanji", ROMREGION_ERASEFF) |
| 2236 | |
| 2237 | ROM_REGION(0x20000, "raw_kanji", ROMREGION_ERASEFF) |
| 2231 | 2238 | ROM_END |
| 2232 | 2239 | |
| 2233 | 2240 | ROM_START( x1turbo ) |
| r6293 | r6294 | |
| 2239 | 2246 | |
| 2240 | 2247 | ROM_REGION(0x1800, "pcg", ROMREGION_ERASEFF) |
| 2241 | 2248 | |
| 2249 | ROM_REGION(0x2000, "font", 0) //TODO: this contains 8x16 charset only, maybe it's possible that it derivates a 8x8 charset by skipping gfx lines? |
| 2250 | ROM_LOAD( "ank.fnt", 0x0000, 0x2000, CRC(19689fbd) SHA1(0d4e072cd6195a24a1a9b68f1d37500caa60e599) ) |
| 2251 | |
| 2242 | 2252 | ROM_REGION(0x4d600, "cgrom", 0) |
| 2243 | | /* This should be larger... hence, we are missing something (maybe part of the other fnt roms?) */ |
| 2244 | 2253 | ROM_LOAD("fnt0808_turbo.x1", 0x00000, 0x00800, CRC(84a47530) SHA1(06c0995adc7a6609d4272417fe3570ca43bd0454) ) |
| 2245 | 2254 | ROM_RELOAD( 0x00800, 0x00800) |
| 2246 | 2255 | ROM_RELOAD( 0x01000, 0x00800) |
| 2247 | | ROM_LOAD("fnt0816.x1", 0x01800, 0x01000, BAD_DUMP CRC(34818d54) SHA1(2c5fdd73249421af5509e48a94c52c4e423402bf) ) |
| 2248 | | ROM_LOAD("fnt1616.x1", 0x02800, 0x4ac00, BAD_DUMP CRC(46826745) SHA1(b9e6c320611f0842df6f45673c47c3e23bc14272) ) |
| 2249 | 2256 | |
| 2250 | | ROM_REGION(0x4ac00, "kanji", 0) |
| 2251 | | /* This is clearly a bad dump: size does not make sense and from 0x28000 on there are only 0xff */ |
| 2252 | | ROM_LOAD("kanji2.rom", 0x0000, 0x4ac00, BAD_DUMP CRC(33800ef2) SHA1(fc07a31ee30db312c7995e887519a9173cb38c0d) ) |
| 2257 | ROM_REGION(0x20000, "kanji", ROMREGION_ERASEFF) |
| 2258 | |
| 2259 | ROM_REGION(0x20000, "raw_kanji", ROMREGION_ERASEFF) |
| 2260 | ROM_LOAD("kanji4.rom", 0x00000, 0x8000, CRC(3e39de89) SHA1(d3fd24892bb1948c4697dedf5ff065ff3eaf7562) ) |
| 2261 | ROM_LOAD("kanji2.rom", 0x08000, 0x8000, CRC(e710628a) SHA1(103bbe459dc8da27a9400aa45b385255c18fcc75) ) |
| 2262 | ROM_LOAD("kanji3.rom", 0x10000, 0x8000, CRC(8cae13ae) SHA1(273f3329c70b332f6a49a3a95e906bbfe3e9f0a1) ) |
| 2263 | ROM_LOAD("kanji1.rom", 0x18000, 0x8000, CRC(5874f70b) SHA1(dad7ada1b70c45f1e9db11db273ef7b385ef4f17) ) |
| 2253 | 2264 | ROM_END |
| 2254 | 2265 | |
| 2255 | | /* X1 Turbo Z: IPL is supposed to be the same as X1 Turbo, but which dumps should be in "cgrom"? |
| 2256 | | Many emulators come with fnt0816.x1 & fnt1616.x1 but I am not sure about what was present on the real |
| 2257 | | X1 Turbo / Turbo Z */ |
| 2258 | | ROM_START( x1turboz ) |
| 2266 | ROM_START( x1turbo40 ) |
| 2259 | 2267 | ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF ) |
| 2260 | | ROM_LOAD( "ipl.x1t", 0x0000, 0x8000, CRC(2e8b767c) SHA1(44620f57a25f0bcac2b57ca2b0f1ebad3bf305d3) ) |
| 2268 | ROM_LOAD( "ipl.bin", 0x0000, 0x8000, CRC(112f80a2) SHA1(646cc3fb5d2d24ff4caa5167b0892a4196e9f843) ) |
| 2261 | 2269 | |
| 2262 | 2270 | ROM_REGION(0x1000, "mcu", ROMREGION_ERASEFF) //MCU for the Keyboard, "sub cpu" |
| 2263 | 2271 | ROM_LOAD( "80c48", 0x0000, 0x1000, NO_DUMP ) |
| 2264 | 2272 | |
| 2265 | 2273 | ROM_REGION(0x1800, "pcg", ROMREGION_ERASEFF) |
| 2266 | 2274 | |
| 2267 | | ROM_REGION(0x4d600, "cgrom", 0) |
| 2275 | ROM_REGION(0x2000, "font", 0) //TODO: this contains 8x16 charset only, maybe it's possible that it derivates a 8x8 charset by skipping gfx lines? |
| 2276 | ROM_LOAD( "ank.fnt", 0x0000, 0x2000, CRC(19689fbd) SHA1(0d4e072cd6195a24a1a9b68f1d37500caa60e599) ) |
| 2277 | |
| 2278 | ROM_REGION(0x1800, "cgrom", 0) |
| 2268 | 2279 | ROM_LOAD("fnt0808_turbo.x1", 0x0000, 0x0800, CRC(84a47530) SHA1(06c0995adc7a6609d4272417fe3570ca43bd0454) ) |
| 2269 | 2280 | ROM_RELOAD( 0x00800, 0x00800) |
| 2270 | 2281 | ROM_RELOAD( 0x01000, 0x00800) |
| 2271 | | ROM_SYSTEM_BIOS( 0, "font1", "Font set 1" ) |
| 2272 | | ROMX_LOAD("fnt0816.x1", 0x1800, 0x1000, CRC(34818d54) SHA1(2c5fdd73249421af5509e48a94c52c4e423402bf), ROM_BIOS(1) ) |
| 2273 | | /* I strongly suspect this is not genuine */ |
| 2274 | | ROMX_LOAD("fnt1616.x1", 0x02800, 0x4ac00, BAD_DUMP CRC(46826745) SHA1(b9e6c320611f0842df6f45673c47c3e23bc14272), ROM_BIOS(1) ) |
| 2275 | | ROM_SYSTEM_BIOS( 1, "font2", "Font set 2" ) |
| 2276 | | ROMX_LOAD("fnt0816_a.x1", 0x01800, 0x1000, BAD_DUMP CRC(98db5a6b) SHA1(adf1492ef326b0f8820a3caa1915ad5ab8138f49), ROM_BIOS(2) ) |
| 2277 | | /* I strongly suspect this is not genuine */ |
| 2278 | | ROMX_LOAD("fnt1616_a.x1", 0x02800, 0x4ac00, BAD_DUMP CRC(bc5689ae) SHA1(a414116e261eb92bbdd407f63c8513257cd5a86f), ROM_BIOS(2) ) |
| 2279 | 2282 | |
| 2280 | | ROM_REGION(0x4ac00, "kanji", 0) |
| 2281 | | /* This is clearly a bad dump: size does not make sense and from 0x28000 on there are only 0xff */ |
| 2282 | | ROM_LOAD("kanji2.rom", 0x0000, 0x4ac00, BAD_DUMP CRC(33800ef2) SHA1(fc07a31ee30db312c7995e887519a9173cb38c0d) ) |
| 2283 | ROM_REGION(0x20000, "kanji", ROMREGION_ERASEFF) |
| 2284 | |
| 2285 | ROM_REGION(0x20000, "raw_kanji", ROMREGION_ERASEFF) |
| 2286 | ROM_LOAD("kanji4.rom", 0x00000, 0x8000, CRC(3e39de89) SHA1(d3fd24892bb1948c4697dedf5ff065ff3eaf7562) ) |
| 2287 | ROM_LOAD("kanji2.rom", 0x08000, 0x8000, CRC(e710628a) SHA1(103bbe459dc8da27a9400aa45b385255c18fcc75) ) |
| 2288 | ROM_LOAD("kanji3.rom", 0x10000, 0x8000, CRC(8cae13ae) SHA1(273f3329c70b332f6a49a3a95e906bbfe3e9f0a1) ) |
| 2289 | ROM_LOAD("kanji1.rom", 0x18000, 0x8000, CRC(5874f70b) SHA1(dad7ada1b70c45f1e9db11db273ef7b385ef4f17) ) |
| 2283 | 2290 | ROM_END |
| 2284 | 2291 | |
| 2285 | 2292 | |
| 2293 | /* Convert the 8-bytes interleaving into something usable by the write handler */ |
| 2294 | static DRIVER_INIT( kanji ) |
| 2295 | { |
| 2296 | UINT32 i,j,k,l; |
| 2297 | UINT8 *kanji = memory_region(machine,"kanji"); |
| 2298 | UINT8 *raw_kanji = memory_region(machine,"raw_kanji"); |
| 2286 | 2299 | |
| 2300 | k = 0; |
| 2301 | for(l=0;l<2;l++) |
| 2302 | { |
| 2303 | for(j=l*8;j<(l*8)+0x10000;j+=16) |
| 2304 | { |
| 2305 | for(i=0;i<8;i++) |
| 2306 | { |
| 2307 | kanji[j+i] = raw_kanji[k]; |
| 2308 | kanji[j+i+0x10000] = raw_kanji[0x10000+k]; |
| 2309 | k++; |
| 2310 | } |
| 2311 | } |
| 2312 | } |
| 2313 | } |
| 2314 | |
| 2315 | |
| 2287 | 2316 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 2288 | 2317 | COMP( 1982, x1, 0, 0, x1, x1, 0, 0, "Sharp", "X1 (CZ-800C)", 0) |
| 2289 | 2318 | COMP( 1984, x1ck, x1, 0, x1, x1, 0, 0, "Sharp", "X1Ck (CZ-804C)", 0) |
| 2290 | | COMP( 1984, x1turbo, x1, 0, x1turbo, x1, 0, 0, "Sharp", "X1 Turbo (CZ-850C)", GAME_NOT_WORKING) |
| 2291 | | COMP( 1986, x1turboz, x1, 0, x1turbo, x1, 0, 0, "Sharp", "X1 Turbo Z (CZ-880C)", GAME_NOT_WORKING) |
| 2319 | COMP( 1984, x1turbo, x1, 0, x1turbo, x1, kanji,0, "Sharp", "X1 Turbo (CZ-850C)", GAME_NOT_WORKING) //model 10 |
| 2320 | COMP( 1985, x1turbo40, x1, 0, x1turbo, x1, kanji,0, "Sharp", "X1 Turbo (CZ-862C)", GAME_NOT_WORKING) //model 40 |