Previous 15994 Revisions Next

r6435 Sunday 22nd November, 2009 at 04:18:16 UTC by Harmony
[IP22] Improved WD33C93 controller hookup; it is now possible to format a disk image and launch the IRIX 6.5 installer, which subsequently crashes due to poor machine hardware emulation. [Harmony]
[src/mess/drivers]ip22.c
[src/mess/machine]sgi.c

src/mess/machine/sgi.c
r6434r6435
99#include "driver.h"
1010#include "sgi.h"
1111
12#define VERBOSE_LEVEL ( 1 )
12#define VERBOSE_LEVEL ( 2 )
1313
1414INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ... )
1515{
r6434r6435
7575   {
7676   case 0x0000:
7777   case 0x0004:
78      verboselog( space->machine, 2, "CPU Control 0 Read: %08x (%08x)\n", nMC_CPUControl0, mem_mask );
78      verboselog( space->machine, 3, "CPU Control 0 Read: %08x (%08x)\n", nMC_CPUControl0, mem_mask );
7979      return nMC_CPUControl0;
8080   case 0x0008:
8181   case 0x000c:
r6434r6435
305305      break;
306306   case 0x0088:
307307   case 0x008c:
308      verboselog( space->machine, 2, "Arbiter CPU Time Write: %08x (%08x)\n", data, mem_mask );
308      verboselog( space->machine, 3, "Arbiter CPU Time Write: %08x (%08x)\n", data, mem_mask );
309309      nMC_ArbCPUTime = data;
310310      break;
311311   case 0x0098:
312312   case 0x009c:
313      verboselog( space->machine, 2, "Arbiter Long Burst Time Write: %08x (%08x)\n", data, mem_mask );
313      verboselog( space->machine, 3, "Arbiter Long Burst Time Write: %08x (%08x)\n", data, mem_mask );
314314      nMC_ArbBurstTime = data;
315315      break;
316316   case 0x00c0:
src/mess/drivers/ip22.c
r6434r6435
373373   switch( offset )
374374   {
375375   case 0x0004/4:
376      verboselog(machine, 0, "HPC3 SCSI0DESC Read: %08x (%08x): %08x\n", 0x1fb90000 + ( offset << 2), mem_mask, nHPC_SCSI0Descriptor );
376377      return nHPC_SCSI0Descriptor;
377378   case 0x1004/4:
379      verboselog(machine, 0, "HPC3 SCSI0DMACTRL Read: %08x (%08x): %08x\n", 0x1fb90000 + ( offset << 2), mem_mask, nHPC_SCSI0DMACtrl );
378380      return nHPC_SCSI0DMACtrl;
379381   case 0x4000/4:
380382      verboselog(machine, 2, "HPC3 ENETR CBP Read: %08x (%08x): %08x\n", 0x1fb90000 + ( offset << 2), mem_mask, nHPC3_enetr_nbdp );
r6434r6435
396398   switch( offset )
397399   {
398400   case 0x0004/4:
401      verboselog(machine, 2, "HPC3 SCSI0DESC Write: %08x\n", data );
399402      nHPC_SCSI0Descriptor = data;
400403      break;
401404   case 0x1004/4:
405      verboselog(machine, 2, "HPC3 SCSI0DMACTRL Write: %08x\n", data );
402406      nHPC_SCSI0DMACtrl = data;
403407      break;
404408   case 0x4000/4:
r6434r6435
11331137   verboselog(machine, 0, "Unknown PBUS DMA Channel %d Write: 0x%08x: 0x%08x (%08x)\n", channel, 0x1fb80000 + offset*4, data, mem_mask );
11341138}
11351139
1140static UINT32 *unkpbus0;
1141static READ32_HANDLER( hpc3_unkpbus0_r )
1142{
1143   return 0;
1144   //verboselog(space->machine, 0, "Unknown PBUS Read: 0x%08x (%08x)\n", 0x1fbc8000 + offset*4, mem_mask );
1145   //return unkpbus0[offset];
1146}
1147
1148static WRITE32_HANDLER( hpc3_unkpbus0_w )
1149{
1150   //verboselog(space->machine, 0, "Unknown PBUS Write: 0x%08x = 0x%08x (%08x)\n", 0x1fbc8000 + offset*4, data, mem_mask );
1151   //COMBINE_DATA(&unkpbus0[offset]);
1152}
1153
11361154static ADDRESS_MAP_START( ip225015_map, ADDRESS_SPACE_PROGRAM, 32 )
11371155   AM_RANGE( 0x00000000, 0x0007ffff ) AM_READWRITE( SMH_BANK(1), SMH_BANK(1) )   /* mirror of first 512k of main RAM */
11381156   AM_RANGE( 0x08000000, 0x0fffffff ) AM_SHARE(1) AM_BASE( &ip22_mainram ) AM_RAM_WRITE(ip22_write_ram)      /* 128 MB of main RAM */
r6434r6435
11411159   AM_RANGE( 0x1fb90000, 0x1fb9ffff ) AM_READWRITE( hpc3_hd_enet_r, hpc3_hd_enet_w )
11421160   AM_RANGE( 0x1fbb0000, 0x1fbb0003 ) AM_RAM    /* unknown, but read a lot and discarded */
11431161   AM_RANGE( 0x1fbc0000, 0x1fbc7fff ) AM_READWRITE( hpc3_hd0_r, hpc3_hd0_w )
1162   AM_RANGE( 0x1fbc8000, 0x1fbcffff ) AM_READWRITE( hpc3_unkpbus0_r, hpc3_unkpbus0_w ) AM_BASE(&unkpbus0)
11441163   AM_RANGE( 0x1fb80000, 0x1fb8ffff ) AM_READWRITE( hpc3_pbusdma_r, hpc3_pbusdma_w )
11451164   AM_RANGE( 0x1fbd8000, 0x1fbd83ff ) AM_READWRITE( hal2_r, hal2_w )
1165   AM_RANGE( 0x1fbd8400, 0x1fbd87ff ) AM_RAM /* hack */
11461166   AM_RANGE( 0x1fbd9000, 0x1fbd93ff ) AM_READWRITE( hpc3_pbus4_r, hpc3_pbus4_w )
11471167   AM_RANGE( 0x1fbd9800, 0x1fbd9bff ) AM_READWRITE( hpc3_pbus6_r, hpc3_pbus6_w )
1168   AM_RANGE( 0x1fbdc000, 0x1fbdc7ff ) AM_RAM
1169   AM_RANGE( 0x1fbdd000, 0x1fbdd3ff ) AM_RAM
11481170   AM_RANGE( 0x1fbe0000, 0x1fbe04ff ) AM_READWRITE( rtc_r, rtc_w )
11491171   AM_RANGE( 0x1fc00000, 0x1fc7ffff ) AM_ROM AM_REGION( "user1", 0 )
11501172   AM_RANGE( 0x20000000, 0x27ffffff ) AM_SHARE(1) AM_RAM_WRITE(ip22_write_ram)
r6434r6435
11741196   memory_set_bankptr(machine, 1, ip22_mainram);
11751197
11761198   nPBUS_DMA_Active = 0;
1199
1200   mips3drc_set_options(cputag_get_cpu(machine, "maincpu"), MIPS3DRC_COMPATIBLE_OPTIONS);
11771201}
11781202
11791203static void dump_chain(const address_space *space, UINT32 ch_base)
11801204{
11811205
1182//  mame_printf_info("node: %08x %08x %08x (len = %x)\n", memory_read_dword(space, ch_base), memory_read_dword(space, ch_base+4), memory_read_dword(space, ch_base+8), memory_read_dword(space, ch_base+4) & 0x3fff);
1206   printf("node: %08x %08x %08x (len = %x)\n", memory_read_dword(space, ch_base), memory_read_dword(space, ch_base+4), memory_read_dword(space, ch_base+8), memory_read_dword(space, ch_base+4) & 0x3fff);
11831207
11841208   if ((memory_read_dword(space, ch_base+8) != 0) && !(memory_read_dword(space, ch_base+4) & 0x80000000))
11851209   {
r6434r6435
12031227   {
12041228      if (wd33c93_get_dma_count())
12051229      {
1230         printf("wd33c93_get_dma_count() is %d\n", wd33c93_get_dma_count() );
12061231         if (nHPC_SCSI0DMACtrl & HPC3_DMACTRL_ENABLE)
12071232         {
12081233            if (nHPC_SCSI0DMACtrl & HPC3_DMACTRL_IRQ) logerror("IP22: Unhandled SCSI DMA IRQ\n");
r6434r6435
12111236         // HPC3 DMA: host to device
12121237         if ((nHPC_SCSI0DMACtrl & HPC3_DMACTRL_ENABLE) && (nHPC_SCSI0DMACtrl & HPC3_DMACTRL_DIR))
12131238         {
1214            UINT32 rptr, dptr, tmpword;
1215            int length;
1239            UINT32 wptr, tmpword;
1240            int words, dptr, twords;
12161241
1217            rptr = memory_read_dword(space, nHPC_SCSI0Descriptor);
1218            length = memory_read_dword(space, nHPC_SCSI0Descriptor + 4) & 0x3fff;
1242            words = wd33c93_get_dma_count();
1243            words /= 4;
12191244
1220/*              mame_printf_info("DMA to device: length %x\n", length);
1221                mame_printf_info("first words: %08x %08x %08x %08x\n",
1222                    memory_read_dword(space, rptr),
1223                    memory_read_dword(space, rptr+4),
1224                    memory_read_dword(space, rptr+8),
1225                    memory_read_dword(space, rptr+12));*/
1245            wptr = memory_read_dword(space, nHPC_SCSI0Descriptor);
1246            nHPC_SCSI0Descriptor += words*4;
1247            dptr = 0;
12261248
1227            if (length <= 4096)
1249            printf("DMA to device: %d words @ %x\n", words, wptr);
1250
1251            dump_chain(space, nHPC_SCSI0Descriptor);
1252
1253            if (words <= (512/4))
12281254            {
1255               // one-shot
1256               //wd33c93_get_dma_data(wd33c93_get_dma_count(), dma_buffer);
1257
1258               while (words)
1259               {
1260                  tmpword = memory_read_dword(space, wptr);
1261
1262                  if (nHPC_SCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
1263                  {
1264                     dma_buffer[dptr+3] = (tmpword>>24)&0xff;
1265                     dma_buffer[dptr+2] = (tmpword>>16)&0xff;
1266                     dma_buffer[dptr+1] = (tmpword>>8)&0xff;
1267                     dma_buffer[dptr] = tmpword&0xff;
1268                  }
1269                  else
1270                  {
1271                     dma_buffer[dptr] = (tmpword>>24)&0xff;
1272                     dma_buffer[dptr+1] = (tmpword>>16)&0xff;
1273                     dma_buffer[dptr+2] = (tmpword>>8)&0xff;
1274                     dma_buffer[dptr+3] = tmpword&0xff;
1275                  }
1276
1277                  wptr += 4;
1278                  dptr += 4;
1279                  words--;
1280               }
1281
1282               words = wd33c93_get_dma_count();
1283               wd33c93_write_data(words, dma_buffer);
1284            }
1285            else
1286            {
1287               while (words)
1288               {
1289                  //wd33c93_get_dma_data(512, dma_buffer);
1290                  twords = 512/4;
1291                  nHPC_SCSI0Descriptor += 512;
1292                  dptr = 0;
1293
1294                  while (twords)
1295                  {
1296                     tmpword = memory_read_dword(space, wptr);
1297
1298                     if (nHPC_SCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
1299                     {
1300                        dma_buffer[dptr+3] = (tmpword>>24)&0xff;
1301                        dma_buffer[dptr+2] = (tmpword>>16)&0xff;
1302                        dma_buffer[dptr+1] = (tmpword>>8)&0xff;
1303                        dma_buffer[dptr] = tmpword&0xff;
1304                     }
1305                     else
1306                     {
1307                        dma_buffer[dptr] = (tmpword>>24)&0xff;
1308                        dma_buffer[dptr+1] = (tmpword>>16)&0xff;
1309                        dma_buffer[dptr+2] = (tmpword>>8)&0xff;
1310                        dma_buffer[dptr+3] = tmpword&0xff;
1311                     }
1312
1313                     wptr += 4;
1314                     dptr += 4;
1315                     twords--;
1316                  }
1317
1318                  wd33c93_write_data(512, dma_buffer);
1319
1320                  words -= (512/4);
1321               }
1322            }
1323
1324            // clear DMA on the controller too
1325            wd33c93_clear_dma();
1326            /*
1327            UINT32 dptr, tmpword;
1328            UINT32 bc = memory_read_dword(space, nHPC_SCSI0Descriptor + 4);
1329            UINT32 rptr = memory_read_dword(space, nHPC_SCSI0Descriptor);
1330            int length = bc & 0x3fff;
1331            int xie = (bc & 0x20000000) ? 1 : 0;
1332            int eox = (bc & 0x80000000) ? 1 : 0;
1333
1334            dump_chain(space, nHPC_SCSI0Descriptor);
1335
1336            printf("PC is %08x\n", cpu_get_pc(cputag_get_cpu(machine, "maincpu")));
1337            printf("DMA to device: length %x xie %d eox %d\n", length, xie, eox);
1338
1339            if (length <= 0x4000)
1340            {
12291341               dptr = 0;
12301342               while (length > 0)
12311343               {
r6434r6435
12601372            {
12611373               logerror("IP22: overly large host to device transfer, can't handle!\n");
12621374            }
1375            */
12631376         }
12641377
12651378         // HPC3 DMA: device to host
r6434r6435
13481461
13491462static const SCSIConfigTable dev_table =
13501463{
1351        1,                                      /* 1 SCSI device */
1352        { { SCSI_ID_4, "cdrom", SCSI_DEVICE_CDROM } }  /* SCSI ID 4, using CD 0, and it's a CD-ROM */
1353//    { SCSI_ID_2, "cdrom", SCSI_DEVICE_CDROM } } /* SCSI ID 2, using HD 0, and it's a CD-ROM */
1464        2,                                      /* 1 SCSI device */
1465        { { SCSI_ID_1, "harddisk1", SCSI_DEVICE_HARDDISK },
1466          { SCSI_ID_4, "cdrom", SCSI_DEVICE_CDROM } }  /* SCSI ID 4, using CD 0, and it's a CD-ROM */
13541467};
13551468
13561469static const struct WD33C93interface scsi_intf =
r6434r6435
15351648   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
15361649
15371650   MDRV_CDROM_ADD( "cdrom" )
1651   MDRV_HARDDISK_ADD( "harddisk1" )
15381652MACHINE_DRIVER_END
15391653
15401654static MACHINE_DRIVER_START( ip224613 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team