Previous 15994 Revisions Next

r1010 Wednesday 19th September, 2007 at 14:36:35 UTC by Curt Coder
[ATARISTE] Added DMA sound skeleton
[src/mess/drivers]atarist.c

src/mess/drivers/atarist.c
r1009r1010
446446   if (~data & 0x80) ikbd.keylatch = readinputportbytag("P47");
447447}
448448
449/* DMA Sound */
450
451static struct DMASOUND
452{
453   UINT32 base, cntr, end;
454   UINT16 ctrl, mode;
455} dmasound;
456
457static READ16_HANDLER( atariste_sound_dma_control_r )
458{
459   return dmasound.ctrl;
460}
461
462static READ16_HANDLER( atariste_sound_dma_base_r )
463{
464   switch (offset)
465   {
466   case 0x00:
467      return (dmasound.base >> 16) & 0x3f;
468   case 0x01:
469      return (dmasound.base >> 8) & 0xff;
470   case 0x02:
471      return dmasound.base & 0xff;
472   }
473
474   return 0;
475}
476
477static READ16_HANDLER( atariste_sound_dma_counter_r )
478{
479   switch (offset)
480   {
481   case 0x00:
482      return (dmasound.cntr >> 16) & 0x3f;
483   case 0x01:
484      return (dmasound.cntr >> 8) & 0xff;
485   case 0x02:
486      return dmasound.cntr & 0xff;
487   }
488
489   return 0;
490}
491
492static READ16_HANDLER( atariste_sound_dma_end_r )
493{
494   switch (offset)
495   {
496   case 0x00:
497      return (dmasound.end >> 16) & 0x3f;
498   case 0x01:
499      return (dmasound.end >> 8) & 0xff;
500   case 0x02:
501      return dmasound.end & 0xff;
502   }
503
504   return 0;
505}
506
507static READ16_HANDLER( atariste_sound_mode_r )
508{
509   return dmasound.mode;
510}
511
512static WRITE16_HANDLER( atariste_sound_dma_control_w )
513{
514   dmasound.ctrl = data;
515}
516
517static WRITE16_HANDLER( atariste_sound_dma_base_w )
518{
519   switch (offset)
520   {
521   case 0x00:
522      dmasound.base = (dmasound.base & 0x00fffe) | (data & 0x3f) << 16;
523      break;
524   case 0x01:
525      dmasound.base = (dmasound.base & 0x3f00fe) | (data & 0xff) << 8;
526      break;
527   case 0x02:
528      dmasound.base = (dmasound.base & 0x3fff00) | (data & 0xfe);
529      break;
530   }
531}
532
533static WRITE16_HANDLER( atariste_sound_dma_end_w )
534{
535   switch (offset)
536   {
537   case 0x00:
538      dmasound.end = (dmasound.end & 0x00fffe) | (data & 0x3f) << 16;
539      break;
540   case 0x01:
541      dmasound.end = (dmasound.end & 0x3f00fe) | (data & 0xff) << 8;
542      break;
543   case 0x02:
544      dmasound.end = (dmasound.end & 0x3fff00) | (data & 0xfe);
545      break;
546   }
547}
548
549static WRITE16_HANDLER( atariste_sound_mode_w )
550{
551   dmasound.mode = data;
552}
553
449554/* Microwire */
450555
451556static struct MICROWIRE
r1009r1010
639744   AM_RANGE(0xff8608, 0xff860d) AM_READWRITE(atarist_fdc_dma_base_r, atarist_fdc_dma_base_w)
640745   AM_RANGE(0xff8800, 0xff8801) AM_READWRITE(AY8910_read_port_0_msb_r, AY8910_control_port_0_msb_w)
641746   AM_RANGE(0xff8802, 0xff8803) AM_WRITE(AY8910_write_port_0_msb_w)
642//   AM_RANGE(0xff8900, 0xff8901) AM_READWRITE(atariste_sound_dma_control_r, atariste_sound_dma_control_w)
643//   AM_RANGE(0xff8902, 0xff8906) AM_READWRITE(atariste_sound_dma_base_r, atariste_sound_dma_base_w)
644//   AM_RANGE(0xff8908, 0xff890d) AM_READ(atariste_sound_dma_counter_r)
645//   AM_RANGE(0xff890e, 0xff8912) AM_READWRITE(atariste_sound_dma_end_r, atariste_sound_dma_end_w)
646//   AM_RANGE(0xff8920, 0xff8920) AM_READWRITE(atariste_sound_mode_r, atariste_sound_mode_w)
747   AM_RANGE(0xff8900, 0xff8901) AM_READWRITE(atariste_sound_dma_control_r, atariste_sound_dma_control_w)
748   AM_RANGE(0xff8902, 0xff8907) AM_READWRITE(atariste_sound_dma_base_r, atariste_sound_dma_base_w)
749   AM_RANGE(0xff8908, 0xff890d) AM_READ(atariste_sound_dma_counter_r)
750   AM_RANGE(0xff890e, 0xff8913) AM_READWRITE(atariste_sound_dma_end_r, atariste_sound_dma_end_w)
751   AM_RANGE(0xff8920, 0xff8921) AM_READWRITE(atariste_sound_mode_r, atariste_sound_mode_w)
647752   AM_RANGE(0xff8922, 0xff8923) AM_READWRITE(atariste_microwire_data_r, atariste_microwire_data_w)
648753   AM_RANGE(0xff8924, 0xff8925) AM_READWRITE(atariste_microwire_mask_r, atariste_microwire_mask_w)
649754   AM_RANGE(0xff8a00, 0xff8a1f) AM_READWRITE(atarist_blitter_halftone_r, atarist_blitter_halftone_w)
r1009r1010
694799   AM_RANGE(0xff8608, 0xff860d) AM_READWRITE(atarist_fdc_dma_base_r, atarist_fdc_dma_base_w)
695800   AM_RANGE(0xff8800, 0xff8801) AM_READWRITE(AY8910_read_port_0_msb_r, AY8910_control_port_0_msb_w)
696801   AM_RANGE(0xff8802, 0xff8803) AM_WRITE(AY8910_write_port_0_msb_w)
697//   AM_RANGE(0xff8900, 0xff8901) AM_READWRITE(atariste_sound_dma_control_r, atariste_sound_dma_control_w)
698//   AM_RANGE(0xff8902, 0xff8906) AM_READWRITE(atariste_sound_dma_base_r, atariste_sound_dma_base_w)
699//   AM_RANGE(0xff8908, 0xff890d) AM_READ(atariste_sound_dma_counter_r)
700//   AM_RANGE(0xff890e, 0xff8912) AM_READWRITE(atariste_sound_dma_end_r, atariste_sound_dma_end_w)
701//   AM_RANGE(0xff8920, 0xff8920) AM_READWRITE(atariste_sound_mode_r, atariste_sound_mode_w)
802   AM_RANGE(0xff8900, 0xff8901) AM_READWRITE(atariste_sound_dma_control_r, atariste_sound_dma_control_w)
803   AM_RANGE(0xff8902, 0xff8907) AM_READWRITE(atariste_sound_dma_base_r, atariste_sound_dma_base_w)
804   AM_RANGE(0xff8908, 0xff890d) AM_READ(atariste_sound_dma_counter_r)
805   AM_RANGE(0xff890e, 0xff8913) AM_READWRITE(atariste_sound_dma_end_r, atariste_sound_dma_end_w)
806   AM_RANGE(0xff8920, 0xff8921) AM_READWRITE(atariste_sound_mode_r, atariste_sound_mode_w)
702807   AM_RANGE(0xff8922, 0xff8923) AM_READWRITE(atariste_microwire_data_r, atariste_microwire_data_w)
703808   AM_RANGE(0xff8924, 0xff8925) AM_READWRITE(atariste_microwire_mask_r, atariste_microwire_mask_w)
704809   AM_RANGE(0xff8a00, 0xff8a1f) AM_READWRITE(atarist_blitter_halftone_r, atarist_blitter_halftone_w)
r1009r1010
11641269
11651270   memset(&mwire, 0, sizeof(mwire));
11661271
1272   state_save_register_global(dmasound.base);
1273   state_save_register_global(dmasound.cntr);
1274   state_save_register_global(dmasound.end);
1275   state_save_register_global(dmasound.ctrl);
1276   state_save_register_global(dmasound.mode);
1277
11671278   state_save_register_global(mwire.data);
11681279   state_save_register_global(mwire.mask);
11691280   state_save_register_global(mwire.shift);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team