Previous 199869 Revisions Next

r23657 Wednesday 12th June, 2013 at 19:50:17 UTC by smf
a couple more over the fence (nw)
[src/emu/machine]idectrl.c idectrl.h idehd.c idehd.h

trunk/src/emu/machine/idectrl.c
r23656r23657
9393
9494void ide_controller_device::set_irq(int state)
9595{
96   ide_device_interface *dev = slot[cur_drive]->dev();
97
9698   if (state == ASSERT_LINE)
9799      LOG(("IDE interrupt assert\n"));
98100   else
r23656r23657
100102
101103   /* signal an interrupt */
102104   m_irq_handler(state);
103   interrupt_pending = state;
105   dev->interrupt_pending = state;
104106}
105107
106108void ide_controller_device::set_dmarq(int state)
r23656r23657
333335
334336      /* signal an interrupt */
335337      if (!dev->verify_only)
336         sectors_until_int--;
337      if (sectors_until_int == 0 || dev->sector_count == 1)
338         dev->sectors_until_int--;
339      if (dev->sectors_until_int == 0 || dev->sector_count == 1)
338340      {
339         sectors_until_int = ((command == IDE_COMMAND_READ_MULTIPLE) ? dev->block_count : 1);
341         dev->sectors_until_int = ((command == IDE_COMMAND_READ_MULTIPLE) ? dev->block_count : 1);
340342         set_irq(ASSERT_LINE);
341343      }
342344
r23656r23657
389391
390392void ide_controller_device::read_next_sector()
391393{
394   ide_device_interface *dev = slot[cur_drive]->dev();
395
392396   /* mark ourselves busy */
393397   status |= IDE_STATUS_BUSY;
394398
395399   if (command == IDE_COMMAND_READ_MULTIPLE)
396400   {
397      if (sectors_until_int != 1)
401      if (dev->sectors_until_int != 1)
398402         /* make ready now */
399403         read_sector_done();
400404      else
r23656r23657
427431
428432   if (command == IDE_COMMAND_WRITE_MULTIPLE)
429433   {
430      if (sectors_until_int != 1)
434      if (dev->sectors_until_int != 1)
431435      {
432436         /* ready to write now */
433437         write_sector_done();
r23656r23657
541545      error = IDE_ERROR_NONE;
542546
543547      /* signal an interrupt */
544      if (--sectors_until_int == 0 || dev->sector_count == 1)
548      if (--dev->sectors_until_int == 0 || dev->sector_count == 1)
545549      {
546         sectors_until_int = ((command == IDE_COMMAND_WRITE_MULTIPLE) ? dev->block_count : 1);
550         dev->sectors_until_int = ((command == IDE_COMMAND_WRITE_MULTIPLE) ? dev->block_count : 1);
547551         set_irq(ASSERT_LINE);
548552      }
549553
r23656r23657
598602
599603         /* reset the buffer */
600604         dev->buffer_offset = 0;
601         sectors_until_int = 1;
605         dev->sectors_until_int = 1;
602606         dev->dma_active = 0;
603607         dev->verify_only = 0;
604608
r23656r23657
612616
613617         /* reset the buffer */
614618         dev->buffer_offset = 0;
615         sectors_until_int = 1;
619         dev->sectors_until_int = 1;
616620         dev->dma_active = 0;
617621         dev->verify_only = 0;
618622
r23656r23657
627631
628632         /* reset the buffer */
629633         dev->buffer_offset = 0;
630         sectors_until_int = 1;
634         dev->sectors_until_int = 1;
631635         dev->dma_active = 0;
632636         dev->verify_only = 1;
633637
r23656r23657
641645
642646         /* reset the buffer */
643647         dev->buffer_offset = 0;
644         sectors_until_int = dev->sector_count;
648         dev->sectors_until_int = dev->sector_count;
645649         dev->dma_active = 1;
646650         dev->verify_only = 0;
647651
r23656r23657
656660
657661         /* reset the buffer */
658662         dev->buffer_offset = 0;
659         sectors_until_int = 1;
663         dev->sectors_until_int = 1;
660664         dev->dma_active = 0;
661665
662666         /* mark the buffer ready */
r23656r23657
669673
670674         /* reset the buffer */
671675         dev->buffer_offset = 0;
672         sectors_until_int = 1;
676         dev->sectors_until_int = 1;
673677         dev->dma_active = 0;
674678
675679         /* mark the buffer ready */
r23656r23657
682686
683687         /* reset the buffer */
684688         dev->buffer_offset = 0;
685         sectors_until_int = dev->sector_count;
689         dev->sectors_until_int = dev->sector_count;
686690         dev->dma_active = 1;
687691
688692         /* start the read going */
r23656r23657
694698
695699         /* reset the buffer */
696700         dev->buffer_offset = 0;
697         sectors_until_int = 0;
701         dev->sectors_until_int = 0;
698702         dev->dma_active = 0;
699703
700704         /* mark the buffer ready */
r23656r23657
802806
803807         /* reset the buffer */
804808         dev->buffer_offset = 0;
805         sectors_until_int = 0;
809         dev->sectors_until_int = 0;
806810         dev->dma_active = 0;
807811
808812         /* mark the buffer ready */
r23656r23657
10061010            result |= IDE_STATUS_HIT_INDEX;
10071011            last_status_timer->adjust(attotime::never);
10081012         }
1009         if (interrupt_pending == ASSERT_LINE)
1013         if (dev->interrupt_pending == ASSERT_LINE)
10101014            set_irq(CLEAR_LINE);
10111015         break;
10121016
r23656r23657
12731277   status(0),
12741278   error(0),
12751279   command(0),
1276   interrupt_pending(0),
1277   sectors_until_int(0),
12781280   config_unknown(0),
12791281   config_register_num(0),
12801282   cur_drive(0),
r23656r23657
12891291   device_t(mconfig, IDE_CONTROLLER, "IDE Controller", tag, owner, clock),
12901292   error(0),
12911293   command(0),
1292   interrupt_pending(0),
1293   sectors_until_int(0),
12941294   config_unknown(0),
12951295   config_register_num(0),
12961296   cur_drive(0),
r23656r23657
13181318   save_item(NAME(status));
13191319   save_item(NAME(error));
13201320   save_item(NAME(command));
1321   save_item(NAME(interrupt_pending));
13221321
1323   save_item(NAME(sectors_until_int));
13241322   save_item(NAME(config_unknown));
13251323   save_item(NAME(config_register));
13261324   save_item(NAME(config_register_num));
trunk/src/emu/machine/idectrl.h
r23656r23657
129129   UINT8           error;
130130   UINT8           command;
131131
132   UINT8           interrupt_pending;
133   UINT16          sectors_until_int;
134
135132   UINT8           config_unknown;
136133   UINT8           config_register[IDE_CONFIG_REGISTERS];
137134   UINT8           config_register_num;
trunk/src/emu/machine/idehd.c
r23656r23657
255255
256256   save_item(NAME(adapter_control));
257257   save_item(NAME(precomp_offset));
258
259258   save_item(NAME(sector_count));
260259
260   save_item(NAME(interrupt_pending));
261   save_item(NAME(sectors_until_int));
262
261263   save_item(NAME(master_password_enable));
262264   save_item(NAME(user_password_enable));
263265
trunk/src/emu/machine/idehd.h
r23656r23657
3636   UINT16          sector_count;
3737   UINT16          block_count;
3838
39   UINT8           interrupt_pending;
40   UINT16          sectors_until_int;
41
3942   UINT8           dma_active;
4043   UINT8           verify_only;
4144

Previous 199869 Revisions Next


© 1997-2024 The MAME Team