Previous 15994 Revisions Next

r5351 Wednesday 5th August, 2009 at 10:44:59 UTC by Jonathan Gevaryahu
[socrates] support for all speech roms, both on-chip and 'external' (on-speech-cart) serial roms. Still no actual speech rendering yet.
[src/mess/drivers]socrates.c

src/mess/drivers/socrates.c
r5350r5351
100100UINT8 vblankstate; // are we in vblank?
101101UINT8 speech_running; // is speech synth talking?
102102UINT32 speech_address; // address in speech space
103UINT8 speech_settings; // speech settings (nybble 0: ? externrom ? ?; nybble 1: ? ? ? ?)
103104UINT8 speech_dummy_read; // have we done a dummy read yet?
104105UINT8 speech_load_address_count; // number of times load address has happened
106UINT8 speech_load_settings_count; // number of times load settings has happened
105107
106108} socrates={ {0}};
107109
r5350r5351
188190 socrates.vblankstate = 0;
189191 socrates.speech_running = 0;
190192 socrates.speech_address = 0;
193 socrates.speech_settings = 0;
191194 socrates.speech_dummy_read = 0;
192195 socrates.speech_load_address_count = 0;
196 socrates.speech_load_settings_count = 0;
193197}
194198
195199DRIVER_INIT( socrates )
r5350r5351
249253// bit 2 - speech chip bit 2
250254// bit 1 - speech chip bit 1
251255// bit 0 - speech chip bit 0
252UINT8 *speechrom = memory_region(space->machine, "speech");
256UINT8 *speechromint = memory_region(space->machine, "speechint");
257UINT8 *speechromext = memory_region(space->machine, "speechext");
253258   int temp = 0;
254259   temp |= (socrates.speech_running)?0x80:0;
255260   temp |= 0x40; // unknown
r5350r5351
258263   switch(socrates.io40_latch&0xF0) // what was last opcode sent?
259264   {
260265      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         }
263276         if (socrates.speech_dummy_read == 0) // if we havent done the dummy read yet, do so now
264277         {
265278            socrates.speech_dummy_read++;
r5350r5351
280293{
281294   socrates.speech_running = 0;
282295   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;
283297}
284298
285299WRITE8_HANDLER( speech_command ) // write 0x4x, some sort of bitfield; speech chip is probably hitachi hd38880 related but not exact, w/4 bit interface
r5350r5351
356370         socrates.speech_load_address_count++;
357371         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);
358372         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++;
361376         break;
362377      case 0xE0: // read byte, handled elsewhere
363378         break;
r5350r5351
371386         {
372387            socrates.speech_running = 0;
373388            socrates.speech_address = 0;
389            socrates.speech_settings = 0;
374390            socrates.speech_dummy_read = 0;
375391            socrates.speech_load_address_count = 0;
392            socrates.speech_load_settings_count = 0;
376393            socrates.io40_latch &= 0x0f; // set last command to 0 to prevent problems
377394         }
378395         else // other
r5350r5351
412429{
413430 socrates.speech_running = 0;
414431 socrates.speech_address = 0;
432 socrates.speech_settings = 0;
415433 socrates.speech_dummy_read = 0;
416434 socrates.speech_load_address_count = 0;
435 socrates.speech_load_settings_count = 0;
417436 socrates.io40_latch &= 0x0f; // set last command to 0 to prevent problems
418437logerror("write to i/o 0x60 of %x\n",data);
419438}
r5350r5351
898917    ROM_REGION(0x10000, "vram", 0)
899918    ROM_FILL(0x0000, 0xffff, 0xff) /* fill with ff, driver_init changes this to the 'correct' startup pattern */
900919
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
904929ROM_END
905930   
906931ROM_START(socratfc)
r5350r5351
913938    ROM_REGION(0x10000, "vram", 0)
914939    ROM_FILL(0x0000, 0xffff, 0xff) /* fill with ff, driver_init changes this to the 'correct' startup pattern */
915940
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
919950ROM_END
920951
921952

Previous 15994 Revisions Next


© 1998-2018 The MESS Team