Previous 199869 Revisions Next

r21198 Wednesday 20th February, 2013 at 01:00:31 UTC by Angelo Salese
Guessed m68k enable/disable
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21197r21198
486486   address_space &main_space = m_maincpu->space(AS_PROGRAM);
487487   address_space &sound_space = m_soundcpu->space(AS_PROGRAM);
488488
489   //printf("%08x %08x\n",offset*4,m_h1_unk[offset]);
490
489491   if(offset == 8)
490492   {
491      //bit 16 probably halts m68k
493      //probably writing to upper word disables m68k, to lower word enables it
494      machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, (data) ? ASSERT_LINE : CLEAR_LINE);
492495      return;
493496   }
494497
495498   if(offset == 2)
496499   {
497      if(!(data & 1) && (m_h1_unk[2] & 1)) // 1 -> 0 transition enables DMA
500      if(data & 1 && (!(m_h1_unk[2] & 1))) // 0 -> 1 transition enables DMA
498501      {
499502         UINT32 src = m_h1_unk[0];
500503         UINT32 dst = m_h1_unk[1];
501         UINT32 size = 0x200; // TODO
504         UINT32 size = (m_h1_unk[2]>>16)*0x40;
502505
503         if(src == 0x100000) // DMA for m68k program, TODO
504            return;
505
506         //printf("%08x %08x %08x\n",src,dst,size);
507
508506         for(int i = 0;i < size; i+=2)
509507         {
510508            sound_space.write_word(dst,main_space.read_word(src));
r21197r21198
516514
517515   if(offset == 6)
518516   {
519      if(!(data & 1) && (m_h1_unk[6] & 1)) // 1 -> 0 transition enables DMA
517      if(data & 1 && (!(m_h1_unk[6] & 1))) // 0 -> 1 transition enables DMA
520518      {
521519         UINT32 src = m_h1_unk[4];
522520         UINT32 dst = m_h1_unk[5];
523         UINT32 size = 0x200; // TODO
521         UINT32 size = (m_h1_unk[6]>>16)*0x40;
524522
525         if(src == 0x100000) // DMA for m68k program, TODO
526            return;
523         //printf("%08x %08x %08x %02x\n",src,dst,size,sound_data);
527524
528         //printf("%08x %08x %08x\n",src,dst,size);
529
530525         for(int i = 0;i < size; i+=2)
531526         {
532527            sound_space.write_word(dst,main_space.read_word(src));
r21197r21198
538533
539534   COMBINE_DATA(&m_h1_unk[offset]);
540535
541   //printf("%08x %08x\n",offset*4,m_h1_unk[offset]);
542536}
543537
544538
r21197r21198
14851479void coolridr_state::machine_reset()
14861480{
14871481//  machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
1488//   machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
1482   machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
14891483
1490   memcpy(m_soundram, memregion("soundcpu")->base()+0x80000, 0x80000);
1491   m_soundcpu->reset();
1484//   memcpy(m_soundram, memregion("soundcpu")->base()+0x80000, 0x80000);
1485//  m_soundcpu->reset();
14921486
14931487
1494
14951488}
14961489
14971490

Previous 199869 Revisions Next


© 1997-2024 The MAME Team