Previous 15994 Revisions Next

r8853 Sunday 22nd August, 2010 at 12:49:43 UTC by Angelo Salese
[A310]: Updated to the latest source tree
[src/mame/includes]archimds.h
[src/mame/machine]archimds.c

src/mame/machine/archimds.c
r8852r8853
4646static UINT32 ioc_timercnt[4], ioc_timerout[4];
4747static UINT32 vidc_vidstart, vidc_vidend, vidc_vidinit,vidc_vidcur;
4848static UINT32 vidc_sndstart, vidc_sndend, vidc_sndcur;
49static UINT8 video_dma_on;
49static UINT8 video_dma_on,audio_dma_on;
5050UINT8 i2c_clk;
51INT16 memc_pages[(32*1024*1024)/(4096)];   // the logical RAM area is 32 megs, and the smallest page size is 4k
51INT16 memc_pages[0x2000];   // the logical RAM area is 32 megs, and the smallest page size is 4k
5252UINT32 vidc_regs[256];
5353UINT8 ioc_regs[0x80/4];
5454UINT8 vidc_bpp_mode;
r8852r8853
122122
123123   if(video_dma_on)
124124   {
125      if (vidc_vidcur >= vidc_vidend)
125      if (vidc_vidcur >= vidc_vidend-vidc_vidstart)
126126         vidc_vidcur = 0;
127127
128128      timer_adjust_oneshot(vid_timer, ATTOTIME_IN_USEC(1), 0);
r8852r8853
135135{
136136   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
137137
138   dac_signed_data_w(space->machine->device("dac"), (space->read_byte(vidc_sndcur)));
138   dac_signed_data_w(space->machine->device("dac"), (space->read_byte(vidc_sndstart+vidc_sndcur)));
139139
140140   vidc_sndcur++;
141141
142   if (vidc_sndcur >= vidc_sndend)
142   if (vidc_sndcur >= vidc_sndend-vidc_sndstart)
143143   {
144      vidc_sndcur = 0;
144145      archimedes_request_irq_b(machine, ARCHIMEDES_IRQB_SOUND_EMPTY);
145146
146      /* TODO */
147      timer_adjust_oneshot(snd_timer, attotime_never, 0);
148      dac_signed_data_w(space->machine->device("dac"), 0x80);
147      if(!audio_dma_on)
148      {
149         timer_adjust_oneshot(snd_timer, attotime_never, 0);
150         dac_signed_data_w(space->machine->device("dac"), 0x80);
151      }
149152   }
150153}
151154
r8852r8853
641644               logerror("IOC: Econet Write %02x at %08x\n",data,ioc_addr);
642645               return;
643646            case 3:
644               logerror("IOC: Serial Write\n");
647               logerror("IOC: Serial Write %02x (%c) at %08x\n",data,data,ioc_addr);
645648               return;
646649            case 4:
647650               logerror("IOC: Internal Podule Write\n");
r8852r8853
831834
832835         case 1: /* video start */
833836            logerror("MEMC: VIDSTART %08x\n",data);
834            vidc_vidstart = ((data>>2)&0x7fff)*16;
837            vidc_vidstart = 0x2000000 | (((data>>2)&0x7fff)*16);
835838            break;
836839
837840         case 2: /* video end */
838841            logerror("MEMC: VIDEND %08x\n",data);
839            vidc_vidend = ((data>>2)&0x7fff)*16;
842            vidc_vidend = 0x2000000 | (((data>>2)&0x7fff)*16);
840843            break;
841844
842845         case 4:   /* sound start */
843846            logerror("MEMC: VIDSNDSTART %08x\n",data);
844            vidc_sndstart = ((data>>2)&0x7fff)*16;
847            vidc_sndstart = 0x2000000 | ((data>>2)&0x7fff)*16;
845848            break;
846849
847850         case 5: /* sound end */
848851            logerror("MEMC: VIDSNDEND %08x\n",data);
849            vidc_sndend = ((data>>2)&0x7fff)*16;
852            vidc_sndend = 0x2000000 | ((data>>2)&0x7fff)*16;
850853            break;
851854
852855         case 7:   /* Control */
r8852r8853
855858            logerror("(PC = %08x) MEMC: %x to Control (page size %d, %s, %s)\n", cpu_get_pc(space->cpu), data & 0x1ffc, page_sizes[memc_pagesize], ((data>>10)&1) ? "Video DMA on" : "Video DMA off", ((data>>11)&1) ? "Sound DMA on" : "Sound DMA off");
856859
857860            video_dma_on = ((data>>10)&1);
861            audio_dma_on = ((data>>11)&1);
858862
859863            if ((data>>10)&1)
860864            {
r8852r8853
869873               /* FIXME: is the frequency correct? */
870874               sndhz = (250000.0) / (double)((vidc_regs[0xc0]&0xff)+2);
871875
872               logerror("MEMC: Starting audio DMA at %f Hz, buffer from %x to %x\n", sndhz, vidc_sndstart, vidc_sndend);
876               printf("MEMC: Starting audio DMA at %f Hz, buffer from %x to %x\n", sndhz, vidc_sndstart, vidc_sndend);
873877
874               vidc_sndcur = vidc_sndstart;
878               vidc_sndcur = 0;
875879
876880               timer_adjust_periodic(snd_timer, ATTOTIME_IN_HZ(sndhz), 0, ATTOTIME_IN_HZ(sndhz));
877881            }
878            else
879            {
880               //timer_adjust_oneshot(snd_timer, attotime_never, 0);
881               //dac_signed_data_w(space->machine->device("dac"), 0x80);
882            }
882
883883            break;
884884
885885         default:
src/mame/includes/archimds.h
r8852r8853
6060extern WRITE32_HANDLER(archimedes_vidc_w);
6161
6262extern UINT8 i2c_clk;
63extern INT16 memc_pages[(32*1024*1024)/(4096)];   // the logical RAM area is 32 megs, and the smallest page size is 4k
63extern INT16 memc_pages[0x2000];   // the logical RAM area is 32 megs, and the smallest page size is 4k
6464extern UINT32 vidc_regs[256];
6565extern UINT8 ioc_regs[0x80/4];
6666extern UINT8 vidc_bpp_mode;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team