Previous 15994 Revisions Next

r8049 Saturday 15th May, 2010 at 11:24:05 UTC by Fabio Priuli
slight improvement to error logging [Michael Zapf]
[src/mess/devices]ti99_hd.c
[src/mess/drivers]geneve.c ti99_4p.c ti99_4x.c ti99_8.c
[src/mess/machine]smc92x4.c

src/mess/devices/ti99_hd.c
r8048r8049
279279   memset(&trackdata[position], 0x4e, gap4);
280280   position += gap4;
281281
282   hd->status |= MFMHD_READY;
283
282284   *pbuffer = trackdata;
283285
284286   /* Remember to free the buffer! Except when an error has occured,
285       the function returns a newly allocated buffer. */
287    the function returns a newly allocated buffer.
288    Errors are indicated by READY=FALSE. */
286289}
287290
288291/*
r8048r8049
320323    may lead to sectors not being written. */
321324   if (current_pos==TI99HD_BLOCKNOTFOUND)
322325   {
323      logerror("ti99_hd Cannot find gap1 for cylinder %d, head %d.\n", hd->current_cylinder, head);
326      logerror("ti99_hd error: write track: Cannot find gap1 for cylinder %d, head %d.\n", hd->current_cylinder, head);
324327      /* What now? The track data are illegal, so we refuse to continue. */
328      hd->status |= MFMHD_WRFAULT;
325329      return;
326330   }
327331
r8048r8049
337341      {
338342         /* Forget about the rest; we're done. */
339343         if (found) break;  /* we were already successful, so all ok */
340         logerror("ti99_hd Cannot find sync for track %d, head %d.\n", hd->current_cylinder, head);
344         logerror("ti99_hd error: write track: Cannot find sync for track %d, head %d.\n", hd->current_cylinder, head);
345         hd->status |= MFMHD_WRFAULT;
341346         return;
342347      }
343348      found = TRUE;
r8048r8049
358363         {
359364            if (!harddisk_chs_to_lba(file, wcyl, whead, wsector, &lba))
360365            {
361               hd->status &= ~MFMHD_READY;
362366               hd->status |= MFMHD_WRFAULT;
363367               return;
364368            }
r8048r8049
372376               state = hard_disk_write(file, lba, track_image+current_pos);
373377               if (state==0)
374378               {
375                  logerror("ti99_hd Write error during formatting cylinder %d, head %d\n", wcyl, whead);
376                  hd->status &= ~MFMHD_READY;
379                  logerror("ti99_hd error: write track: Write error during formatting cylinder %d, head %d\n", wcyl, whead);
377380                  hd->status |= MFMHD_WRFAULT;
378381                  return;
379382               }
r8048r8049
381384            }
382385            else
383386            {
384               logerror("ti99_hd Cannot find DAM for cylinder %d, head %d, sector %d.\n", wcyl, whead, wsector);
387               logerror("ti99_hd error: write track: Cannot find DAM for cylinder %d, head %d, sector %d.\n", wcyl, whead, wsector);
388               hd->status |= MFMHD_WRFAULT;
385389               return;
386390            }
387391         }
388392         else
389393         {
390            logerror("ti99_hd cylinder/head mismatch. Drive is on cyl=%d, head=%d, track data say cyl=%d, head=%d\n", hd->current_cylinder, head, wcyl, whead);
394            logerror("ti99_hd error: write track: Cylinder/head mismatch. Drive is on cyl=%d, head=%d, track data say cyl=%d, head=%d\n", hd->current_cylinder, head, wcyl, whead);
395            hd->status |= MFMHD_WRFAULT;
391396         }
392397      }
393398      else
394399      {
395         printf("ti99_hd Cannot find IDAM for cylinder %d, head %d, sector %d.\n", wcyl, whead, wsector);
400         logerror("ti99_hd error: write track: Invalid track image for cyl=%d, head=%d. Cannot find any IDAM in track data.\n",  hd->current_cylinder, head);
401         hd->status |= MFMHD_WRFAULT;
396402         return;
397403      }
398404   }
src/mess/machine/smc92x4.c
r8048r8049
990990
991991   if (write_long)
992992   {
993      logerror("smc92x4 write sector: Write_long not supported. Performing a normal write.\n");
993      logerror("smc92x4 warn: write sector: Write_long not supported. Performing a normal write.\n");
994994   }
995995
996996   if (w->selected_drive_type & TYPE_FLOPPY)
r8048r8049
13871387      else
13881388      {
13891389         if (wait)
1390            logerror("smc92x4:seed_read_id: Waiting for seek_complete not implemented.\n");
1390            logerror("smc92x4 warn: seed_read_id: Waiting for seek_complete not implemented.\n");
13911391
13921392         if (verify_id)
13931393         {
r8048r8049
18081808
18091809   if (transfer_only_ids)
18101810   {
1811      logerror("smc92x4 read track: Ignoring transfer-only-ids. Reading complete track.\n");
1811      logerror("smc92x4 warn: read track: Ignoring transfer-only-ids. Reading complete track.\n");
18121812   }
18131813
18141814   smc92x4_set_dip(device, TRUE);
r8048r8049
18371837   (*w->intf->mfmhd_read_track)(w->register_w[DESIRED_HEAD]&0x0f, &buffer, &data_count);
18381838   sync_status_in(device);
18391839
1840   if (!(w->register_r[DRIVE_STATUS] & DS_READY))
1841   {
1842      logerror("smc92x4 error: read harddisk track failed.\n");
1843      /* no buffer was allocated */
1844   }
1845
18401846   /* Transfer the buffer to the external memory. We assume the memory
18411847    pointer has been set appropriately in the registers. */
18421848   set_dma_address(device, DMA23_16, DMA15_8, DMA7_0);
18431849
18441850   if (transfer_only_ids)
18451851   {
1846      logerror("smc92x4 read track: Ignoring transfer-only-ids. Reading complete track.\n");
1852      logerror("smc92x4 warn: read track: Ignoring transfer-only-ids. Reading complete track.\n");
18471853   }
18481854
18491855   smc92x4_set_dip(device, TRUE);
r8048r8049
19781984   {
19791985      /* DESELECT DRIVE */
19801986      /* done when no drive is in use */
1981      logerror("smc92x4 drdeselect command\n");
1987      logerror("smc92x4 info: drdeselect command\n");
19821988      w->output1 &= ~(OUT1_DRVSEL3|OUT1_DRVSEL2|OUT1_DRVSEL1|OUT1_DRVSEL0);
19831989      w->output2 |= OUT2_DRVSEL3_;
19841990      /* sync the latches on the PCB */
r8048r8049
19901996      /* RESTORE DRIVE */
19911997      /* bit 0: 0 -> command ends after last seek pulse, 1 -> command
19921998        ends when the drive asserts the seek complete pin */
1993      logerror("smc92x4 restore command %X\n", opcode);
1999      logerror("smc92x4 info: restore command %X\n", opcode);
19942000      restore_drive(device);
19952001   }
19962002   else if (opcode >= 0x04 && opcode <= 0x07)
19972003   {
19982004      /* STEP IN/OUT ONE CYLINDER */
1999      logerror("smc92x4 step in/out command %X\n", opcode);
2005      logerror("smc92x4 info: step in/out command %X\n", opcode);
20002006      step_in_out(device);
20012007   }
20022008   else if (opcode >= 0x08 && opcode <= 0x0f)
r8048r8049
20072013   else if (opcode >= 0x10 && opcode <= 0x1f)
20082014   {
20092015      /* POLLDRIVE */
2010      logerror("smc92x4 polldrive command %X\n", opcode);
2016      logerror("smc92x4 info: polldrive command %X\n", opcode);
20112017      poll_drives(device);
20122018   }
20132019   else if (opcode >= 0x20 && opcode <= 0x3f)
20142020   {
20152021      /* DRIVE SELECT */
2016      logerror("smc92x4 drselect command %X\n", opcode);
2022      logerror("smc92x4 info: drselect command %X\n", opcode);
20172023      drive_select(device, opcode&0x1f);
20182024   }
20192025   else if (opcode >= 0x40 && opcode <= 0x4f)
20202026   {
20212027      /* SETREGPTR */
2022      logerror("smc92x4 setregptr command %X\n", opcode);
2028      logerror("smc92x4 info: setregptr command %X\n", opcode);
20232029      w->register_pointer = opcode & 0xf;
20242030      /* Spec does not say anything about the effect of setting an
20252031        invalid value (only "care should be taken") */
r8048r8049
20402046      || (opcode >= 0x80))
20412047   {
20422048      /* READ/WRITE SECTORS PHYSICAL/LOGICAL */
2043      logerror("smc92x4 read/write sector command %X\n", opcode);
2049      logerror("smc92x4 info: read/write sector command %X\n", opcode);
20442050      read_write_sectors(device);
20452051   }
20462052   else if (opcode >= 0x5A && opcode <= 0x5b)
20472053   {
20482054      /* READ TRACK */
2049      logerror("smc92x4 read track command %X\n", opcode);
2055      logerror("smc92x4 info: read track command %X\n", opcode);
20502056      read_track(device);
20512057   }
20522058   else if (opcode >= 0x60 && opcode <= 0x7f)
20532059   {
20542060      /* FORMAT TRACK */
2055      logerror("smc92x4 format track command %X\n", opcode);
2061      logerror("smc92x4 info: format track command %X\n", opcode);
20562062      format_track(device);
20572063   }
20582064   else
src/mess/drivers/ti99_8.c
r8048r8049
274274      PORT_DIPSETTING( 0x03, "80 track HD, 2 ms")
275275
276276   PORT_START( "DRVSPD" )
277   PORT_DIPNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
278      PORT_DIPSETTING( 0x00, "No delay")
279      PORT_DIPSETTING( 0x01, "Realistic")
277   PORT_CONFNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
278      PORT_CONFSETTING( 0x00, "No delay")
279      PORT_CONFSETTING( 0x01, "Realistic")
280280
281281   /* 3 ports for mouse */
282282   PORT_START("MOUSEX") /* Mouse - X AXIS */
src/mess/drivers/geneve.c
r8048r8049
290290      PORT_DIPSETTING( 0xff, "80 track HD, 2 ms")
291291
292292   PORT_START( "DRVSPD" )
293   PORT_DIPNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
294      PORT_DIPSETTING( 0x00, "No delay")
295      PORT_DIPSETTING( 0x01, "Realistic")
293   PORT_CONFNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
294      PORT_CONFSETTING( 0x00, "No delay")
295      PORT_CONFSETTING( 0x01, "Realistic")
296296
297297   PORT_START("JOY")   /* col 1: "wired handset 1" (= joystick 1) */
298298      PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP/*, "(1UP)", CODE_NONE, OSD_JOY_UP*/) PORT_PLAYER(1)
src/mess/drivers/ti99_4p.c
r8048r8049
149149      PORT_DIPSETTING( 0xff, "80 track HD, 2 ms")
150150
151151   PORT_START( "DRVSPD" )
152   PORT_DIPNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
153      PORT_DIPSETTING( 0x00, "No delay")
154      PORT_DIPSETTING( 0x01, "Realistic")
152   PORT_CONFNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
153      PORT_CONFSETTING( 0x00, "No delay")
154      PORT_CONFSETTING( 0x01, "Realistic")
155155
156156   /* 3 ports for mouse */
157157   PORT_START("MOUSEX") /* Mouse - X AXIS */
src/mess/drivers/ti99_4x.c
r8048r8049
173173      PORT_DIPSETTING( 0xff, "80 track HD, 2 ms")
174174
175175   PORT_START( "DRVSPD" )
176   PORT_DIPNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
177      PORT_DIPSETTING( 0x00, "No delay")
178      PORT_DIPSETTING( 0x01, "Realistic")
176   PORT_CONFNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
177      PORT_CONFSETTING( 0x00, "No delay")
178      PORT_CONFSETTING( 0x01, "Realistic")
179179
180180   /* 3 ports for mouse */
181181   PORT_START("MOUSEX") /* Mouse - X AXIS */
r8048r8049
349349      PORT_DIPSETTING( 0xff, "80 track HD, 2 ms")
350350
351351   PORT_START( "DRVSPD" )
352   PORT_DIPNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
353      PORT_DIPSETTING( 0x00, "No delay")
354      PORT_DIPSETTING( 0x01, "Realistic")
352   PORT_CONFNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
353      PORT_CONFSETTING( 0x00, "No delay")
354      PORT_CONFSETTING( 0x01, "Realistic")
355355
356356   /* 3 ports for mouse */
357357   PORT_START("MOUSEX") /* Mouse - X AXIS */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team