Previous 15994 Revisions Next

r8891 Wednesday 25th August, 2010 at 00:28:13 UTC by Angelo Salese
[A310]: Some sound improvements
[src/mame/machine]archimds.c

src/mame/machine/archimds.c
r8890r8891
135135static TIMER_CALLBACK( vidc_audio_tick )
136136{
137137   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
138   INT16 res;
138139
139   dac_signed_data_w(space->machine->device("dac"), (space->read_byte(vidc_sndstart+vidc_sndcur)));
140   res = (space->read_word(vidc_sndstart+vidc_sndcur));
140141
142   dac_signed_data_w(space->machine->device("dac"), res);
143
141144   vidc_sndcur++;
142145
143   if (vidc_sndcur >= (vidc_sndend-vidc_sndstart)+0x10)
146   if (vidc_sndcur >= (vidc_sndend-vidc_sndstart)+0x40)
144147   {
145148      vidc_sndcur = 0;
146149      archimedes_request_irq_b(machine, ARCHIMEDES_IRQB_SOUND_EMPTY);
r8890r8891
148151      if(!audio_dma_on)
149152      {
150153         timer_adjust_oneshot(snd_timer, attotime_never, 0);
151         dac_signed_data_w(space->machine->device("dac"), 0x80);
154         dac_signed_data_16_w(space->machine->device("dac"), 0x8000);
152155      }
153156   }
154157}
r8890r8891
860863         case 5: /* sound end */
861864            //logerror("MEMC: SNDEND %08x\n",data);
862865            vidc_sndend = 0x2000000 | ((data>>2)&0x7fff)*16;
866            break;
867
868         case 6:
869            vidc_sndcur = 0;
863870            archimedes_request_irq_b(space->machine, ARCHIMEDES_IRQB_SOUND_EMPTY);
864871            break;
865872
r8890r8891
882889               double sndhz;
883890
884891               /* FIXME: is the frequency correct? */
885               sndhz = (250000.0) / (double)((vidc_regs[0xc0]&0xff)+2);
892               sndhz = (250000.0 * 4) / (double)((vidc_regs[0xc0]&0xff)+2);
886893
887894               printf("MEMC: Starting audio DMA at %f Hz, buffer from %x to %x\n", sndhz, vidc_sndstart, vidc_sndend);
888895
889               vidc_sndcur = 0;
890
891               timer_adjust_periodic(snd_timer, ATTOTIME_IN_HZ(sndhz), 0, ATTOTIME_IN_HZ(sndhz));
896               timer_adjust_periodic(snd_timer, attotime_zero, 0, ATTOTIME_IN_HZ(sndhz));
892897            }
893898
894899            break;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team