Previous 15994 Revisions Next

r3101 Monday 25th August, 2008 at 03:02:43 UTC by R. Belmont
[MAC/NCR5380] Necessary fixes to NCR5380 so Mac SE and Mac Classic can boot from SCSI harddisks.
[src/mess/machine]mac.c ncr5380.c

src/mess/machine/ncr5380.c
r3100r3101
302302   switch( reg )
303303   {
304304      case R5380_CURDATA:
305      case R5380_INPUTDATA:
305306         rv = n5380_Registers[reg];
306307
307         // if we're in the data transfer phase, readback device data instead
308         if ((n5380_Registers[R5380_BUSSTATUS] & 0x1c) == 0x04)
308         // if we're in the data transfer phase or DMA, readback device data instead
309         if (((n5380_Registers[R5380_BUSSTATUS] & 0x1c) == 0x04) || (n5380_Registers[R5380_BUSSTATUS] & 0x40))
309310         {
310311            rv = n5380_Data[d_ptr];
311312
r3100r3101
333334                  {
334335                     ncr5380_read_data((d_limit < 512) ? d_limit : 512, n5380_Data);
335336                  }
337                  else
338                  {
339                     // if this is DMA, signal DMA end
340                     if (n5380_Registers[R5380_BUSSTATUS] & 0x40)
341                     {
342                        n5380_Registers[R5380_BUSSTATUS] |= 0x80;
343                     }
344                  }
336345               }
337346            }
338347
src/mess/machine/mac.c
r3100r3101
151151static UINT32 mac_overlay = 0;
152152static mac_model_t mac_model;
153153static int mac_drive_select = 0;
154static int mac_scsiirq_enable = 0;
154155
155156// returns non-zero if this Mac has ADB
156157static int has_adb(void)
r3100r3101
211212   Interrupt handling
212213*/
213214
214static int scc_interrupt, via_interrupt;
215static int scc_interrupt, via_interrupt, scsi_interrupt;
215216
216217static void mac_field_interrupts(running_machine *machine)
217218{
218   if (scc_interrupt)
219      /* SCC interrupt */
219   if ((scc_interrupt) || (scsi_interrupt))
220       /* SCC interrupt, SCSI on SE and Classic */
220221      cpunum_set_input_line(machine, 0, 2, ASSERT_LINE);
221222   else if (via_interrupt)
222223      /* VIA interrupt */
r3100r3101
784785   ncr5380_w(machine, reg, data);
785786}
786787
788static void mac_scsi_irq(running_machine *machine, int state)
789{
790   if ((mac_scsiirq_enable) && ((mac_model == MODEL_MAC_SE) || (mac_model == MODEL_MAC_CLASSIC)))
791   {
792      scsi_interrupt = state;
793      mac_field_interrupts(machine);
794   }
795}
796
787797/* *************************************************************************
788798 * SCC
789799 *
r3100r3101
15741584   int new_rtc_rTCClk;
15751585
15761586   mac_enable_sound((data & 0x80) == 0);
1587
1588   // SE and Classic have SCSI enable/disable here
1589   if (mac_model >= MODEL_MAC_SE)
1590   {
1591      mac_scsiirq_enable = (data & 0x40) ? 1 : 0;
1592   }
1593
15771594   rtc_write_rTCEnb(data & 0x04);
15781595   new_rtc_rTCClk = (data >> 1) & 0x01;
15791596   if ((! new_rtc_rTCClk) && (rtc_rTCClk))
r3100r3101
16581675      memset(mess_ram, 0, mess_ram_size);
16591676   }
16601677
1678   scsi_interrupt = 0;
1679
16611680   mac_scanline_timer = timer_alloc(mac_scanline_tick, NULL);
16621681   timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
16631682}
r3100r3101
16891708static void mac_driver_init(running_machine *machine, mac_model_t model)
16901709{
16911710   mac_overlay = -1;
1711   scsi_interrupt = 0;
16921712   mac_model = model;
16931713
16941714   /* set up RAM mirror at 0x600000-0x6fffff (0x7fffff ???) */
r3100r3101
17461766
17471767static const SCSIConfigTable dev_table =
17481768{
1749   1,                                      /* 2 SCSI devices */
1769   2,                                      /* 2 SCSI devices */
17501770   {
17511771    { SCSI_ID_5, "harddisk1", SCSI_DEVICE_HARDDISK },  /* SCSI ID 5, using CHD 1, and it's a harddisk */
17521772    { SCSI_ID_6, "harddisk2", SCSI_DEVICE_HARDDISK }   /* SCSI ID 6, using CHD 0, and it's a harddisk */
17531773   }
17541774};
1755
1775                   // 41a868       41a5ac = data copy
17561776static const struct NCR5380interface macplus_5380intf =
17571777{
17581778   &dev_table,   // SCSI device table
1759   NULL      // IRQ (unconnected on the Mac Plus)
1779   mac_scsi_irq   // IRQ (unconnected on the Mac Plus)
17601780};
17611781
17621782static void macscsi_exit(running_machine *machine)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team