src/mess/drivers/socrates.c
| r5350 | r5351 | |
| 100 | 100 | UINT8 vblankstate; // are we in vblank? |
| 101 | 101 | UINT8 speech_running; // is speech synth talking? |
| 102 | 102 | UINT32 speech_address; // address in speech space |
| 103 | UINT8 speech_settings; // speech settings (nybble 0: ? externrom ? ?; nybble 1: ? ? ? ?) |
| 103 | 104 | UINT8 speech_dummy_read; // have we done a dummy read yet? |
| 104 | 105 | UINT8 speech_load_address_count; // number of times load address has happened |
| 106 | UINT8 speech_load_settings_count; // number of times load settings has happened |
| 105 | 107 | |
| 106 | 108 | } socrates={ {0}}; |
| 107 | 109 | |
| r5350 | r5351 | |
| 188 | 190 | socrates.vblankstate = 0; |
| 189 | 191 | socrates.speech_running = 0; |
| 190 | 192 | socrates.speech_address = 0; |
| 193 | socrates.speech_settings = 0; |
| 191 | 194 | socrates.speech_dummy_read = 0; |
| 192 | 195 | socrates.speech_load_address_count = 0; |
| 196 | socrates.speech_load_settings_count = 0; |
| 193 | 197 | } |
| 194 | 198 | |
| 195 | 199 | DRIVER_INIT( socrates ) |
| r5350 | r5351 | |
| 249 | 253 | // bit 2 - speech chip bit 2 |
| 250 | 254 | // bit 1 - speech chip bit 1 |
| 251 | 255 | // bit 0 - speech chip bit 0 |
| 252 | | UINT8 *speechrom = memory_region(space->machine, "speech"); |
| 256 | UINT8 *speechromint = memory_region(space->machine, "speechint"); |
| 257 | UINT8 *speechromext = memory_region(space->machine, "speechext"); |
| 253 | 258 | int temp = 0; |
| 254 | 259 | temp |= (socrates.speech_running)?0x80:0; |
| 255 | 260 | temp |= 0x40; // unknown |
| r5350 | r5351 | |
| 258 | 263 | switch(socrates.io40_latch&0xF0) // what was last opcode sent? |
| 259 | 264 | { |
| 260 | 265 | case 0x60: case 0xE0:// speech status 'read' register |
| 261 | | logerror("reading speech rom nybble from nybble address %x (byte address %x)\n",socrates.speech_address, socrates.speech_address>>1); |
| 262 | | temp |= ((speechrom[(socrates.speech_address>>1)&0x1fff]>>((socrates.speech_address&1)*4))&0xF); |
| 266 | if(socrates.speech_settings&0x04) // external speech roms (outside of speech ic but still in cart) enabled |
| 267 | { |
| 268 | logerror("reading external speech rom nybble from nybble address %x (byte address %x)\n",socrates.speech_address, socrates.speech_address>>1); |
| 269 | temp |= ((speechromext[((socrates.speech_address>>1)&0xffff)]>>((socrates.speech_address&1)*4))&0xF); |
| 270 | } |
| 271 | else |
| 272 | { |
| 273 | logerror("reading internal speech rom nybble from nybble address %x (byte address %x)\n",socrates.speech_address, socrates.speech_address>>1); |
| 274 | temp |= ((speechromint[((socrates.speech_address>>1)&0x1fff)]>>((socrates.speech_address&1)*4))&0xF); |
| 275 | } |
| 263 | 276 | if (socrates.speech_dummy_read == 0) // if we havent done the dummy read yet, do so now |
| 264 | 277 | { |
| 265 | 278 | socrates.speech_dummy_read++; |
| r5350 | r5351 | |
| 280 | 293 | { |
| 281 | 294 | socrates.speech_running = 0; |
| 282 | 295 | socrates.speech_load_address_count = 0; // should this be here or in the write functuon subpart which is speak command? |
| 296 | socrates.speech_load_settings_count = 0; |
| 283 | 297 | } |
| 284 | 298 | |
| 285 | 299 | WRITE8_HANDLER( speech_command ) // write 0x4x, some sort of bitfield; speech chip is probably hitachi hd38880 related but not exact, w/4 bit interface |
| r5350 | r5351 | |
| 356 | 370 | socrates.speech_load_address_count++; |
| 357 | 371 | logerror("loaded address nybble %X, byte address is currently %5X with %d nybbles loaded\n", data&0xF, socrates.speech_address>>1, socrates.speech_load_address_count); |
| 358 | 372 | break; |
| 359 | | case 0xD0: // load bank or maybe init1 and init2? |
| 360 | | // write code here |
| 373 | case 0xD0: // load settings |
| 374 | socrates.speech_settings |= ((data&0xF)<<(socrates.speech_load_settings_count*4)); |
| 375 | socrates.speech_load_settings_count++; |
| 361 | 376 | break; |
| 362 | 377 | case 0xE0: // read byte, handled elsewhere |
| 363 | 378 | break; |
| r5350 | r5351 | |
| 371 | 386 | { |
| 372 | 387 | socrates.speech_running = 0; |
| 373 | 388 | socrates.speech_address = 0; |
| 389 | socrates.speech_settings = 0; |
| 374 | 390 | socrates.speech_dummy_read = 0; |
| 375 | 391 | socrates.speech_load_address_count = 0; |
| 392 | socrates.speech_load_settings_count = 0; |
| 376 | 393 | socrates.io40_latch &= 0x0f; // set last command to 0 to prevent problems |
| 377 | 394 | } |
| 378 | 395 | else // other |
| r5350 | r5351 | |
| 412 | 429 | { |
| 413 | 430 | socrates.speech_running = 0; |
| 414 | 431 | socrates.speech_address = 0; |
| 432 | socrates.speech_settings = 0; |
| 415 | 433 | socrates.speech_dummy_read = 0; |
| 416 | 434 | socrates.speech_load_address_count = 0; |
| 435 | socrates.speech_load_settings_count = 0; |
| 417 | 436 | socrates.io40_latch &= 0x0f; // set last command to 0 to prevent problems |
| 418 | 437 | logerror("write to i/o 0x60 of %x\n",data); |
| 419 | 438 | } |
| r5350 | r5351 | |
| 898 | 917 | ROM_REGION(0x10000, "vram", 0) |
| 899 | 918 | ROM_FILL(0x0000, 0xffff, 0xff) /* fill with ff, driver_init changes this to the 'correct' startup pattern */ |
| 900 | 919 | |
| 901 | | ROM_REGION(0x10000, "speech", 0) |
| 902 | | ROM_FILL(0x0000, 0xffff, 0x00) /* fill with 00, if no speech cart is present socrates will see this */ |
| 903 | | ROM_LOAD_OPTIONAL("speech_eng.bin", 0x0000, 0x2000, CRC(edc1fb3f) SHA1(78b4631fc3b1c038e14911047f9edd6c4e8bae58)) |
| 920 | ROM_REGION(0x2000, "speechint", 0) // speech data inside of the speech chip |
| 921 | ROM_FILL(0x0000, 0x1fff, 0x00) /* fill with 00, if no speech cart is present socrates will see this */ |
| 922 | ROM_LOAD_OPTIONAL("speech_internal.bin", 0x0000, 0x2000, CRC(edc1fb3f) SHA1(78b4631fc3b1c038e14911047f9edd6c4e8bae58)) // 8k on the speech chip itself |
| 923 | |
| 924 | ROM_REGION(0x10000, "speechext", 0) // speech serial modules outside of the speech chip but still on speech cart |
| 925 | ROM_LOAD_OPTIONAL("speech_eng_vsm1.bin", 0x0000, 0x4000, CRC(888e3ddd) SHA1(33AF6A21BA6D826071C9D48557B1C9012752570B)) // 16k in serial rom |
| 926 | ROM_LOAD_OPTIONAL("speech_eng_vsm2.bin", 0x4000, 0x4000, CRC(de4ac89d) SHA1(3DFA853B02DF756A9B72DEF94A39310992EE11C7)) // 16k in serial rom |
| 927 | ROM_LOAD_OPTIONAL("speech_eng_vsm3.bin", 0x8000, 0x4000, CRC(972384aa) SHA1(FFCB1D633CA6BFFC7F481EC505DA447E5B847F16)) // 16k in serial rom |
| 928 | ROM_FILL(0xC000, 0x4000, 0xff) // last vsm isn't present, FF fill |
| 904 | 929 | ROM_END |
| 905 | 930 | |
| 906 | 931 | ROM_START(socratfc) |
| r5350 | r5351 | |
| 913 | 938 | ROM_REGION(0x10000, "vram", 0) |
| 914 | 939 | ROM_FILL(0x0000, 0xffff, 0xff) /* fill with ff, driver_init changes this to the 'correct' startup pattern */ |
| 915 | 940 | |
| 916 | | ROM_REGION(0x10000, "speech", 0) |
| 917 | | ROM_FILL(0x0000, 0xffff, 0x00) /* fill with 00, if no speech cart is present socrates will see this */ |
| 918 | | ROM_LOAD_OPTIONAL("speech_eng.bin", 0x0000, 0x2000, BAD_DUMP CRC(edc1fb3f) SHA1(78b4631fc3b1c038e14911047f9edd6c4e8bae58)) // should be speech_fra.bin, but french speech cart is not dumped |
| 941 | ROM_REGION(0x2000, "speechint", 0) |
| 942 | ROM_FILL(0x0000, 0x1fff, 0x00) /* fill with 00, if no speech cart is present socrates will see this */ |
| 943 | ROM_LOAD_OPTIONAL("speech_fra_internal.bin", 0x0000, 0x2000, BAD_DUMP CRC(edc1fb3f) SHA1(78b4631fc3b1c038e14911047f9edd6c4e8bae58)) // probably same on french and english speech carts |
| 944 | |
| 945 | ROM_REGION(0x10000, "speechext", 0) // speech serial modules outside of the speech chip but still on speech cart |
| 946 | ROM_LOAD_OPTIONAL("speech_fra_vsm1.bin", 0x0000, 0x4000, NO_DUMP) // 16k in serial rom |
| 947 | ROM_LOAD_OPTIONAL("speech_fra_vsm2.bin", 0x4000, 0x4000, NO_DUMP) // 16k in serial rom |
| 948 | ROM_LOAD_OPTIONAL("speech_fra_vsm3.bin", 0x8000, 0x4000, NO_DUMP) // 16k in serial rom |
| 949 | ROM_FILL(0xC000, 0x4000, 0xff) // last vsm isn't present, FF fill |
| 919 | 950 | ROM_END |
| 920 | 951 | |
| 921 | 952 | |