Previous 15994 Revisions Next

r3970 Tuesday 23rd December, 2008 at 20:25:00 UTC by Miodrag Milanović
Enabled rest of drivers
[src/mess]mess.mak messdriv.c
[src/mess/devices]thomflop.c
[src/mess/machine]99_dsk.c mc6843.c smc92x4.c smc92x4.h thomson.c

src/mess/messdriv.c
r3969r3970
517517   DRIVER( ip244415 )
518518
519519   /* TEXAS INSTRUMENTS */
520//0128u7   DRIVER( ti990_10 )   /* 1975 TI 990/10                           */
521//0128u7   DRIVER( ti990_4 )   /* 1976 TI 990/4                           */
522//0128u7   DRIVER( 990189 )   /* 1978 TM 990/189                           */
523//0128u7   DRIVER( 990189v )   /* 1980 TM 990/189 with Color Video Board         */
520   DRIVER( ti990_10 )   /* 1975 TI 990/10                           */
521   DRIVER( ti990_4 )   /* 1976 TI 990/4                           */
522   DRIVER( 990189 )   /* 1978 TM 990/189                           */
523   DRIVER( 990189v )   /* 1980 TM 990/189 with Color Video Board         */
524524
525//0128u7   DRIVER( ti99_224 )   /* 1983 TI 99/2 (24kb ROMs)                     */
526//0128u7   DRIVER( ti99_232 )   /* 1983 TI 99/2 (32kb ROMs)                     */
527//0128u7   DRIVER( ti99_4 )   /* 1979 TI-99/4                              */
528//0128u7   DRIVER( ti99_4e )   /* 1980 TI-99/4 with 50Hz video                  */
529//0128u7   DRIVER( ti99_4a )   /* 1981 TI-99/4A                           */
530//0128u7   DRIVER( ti99_4ae )   /* 1981 TI-99/4A with 50Hz video               */
531//0128u7   DRIVER( ti99_4ev)   /* 1994 TI-99/4A with EVPC video card            */
532//0128u7   DRIVER( ti99_8 )   /* 1983 TI-99/8                              */
533//0128u7   DRIVER( ti99_8e )   /* 1983 TI-99/8 with 50Hz video                  */
525   DRIVER( ti99_224 )   /* 1983 TI 99/2 (24kb ROMs)                     */
526   DRIVER( ti99_232 )   /* 1983 TI 99/2 (32kb ROMs)                     */
527   DRIVER( ti99_4 )   /* 1979 TI-99/4                              */
528   DRIVER( ti99_4e )   /* 1980 TI-99/4 with 50Hz video                  */
529   DRIVER( ti99_4a )   /* 1981 TI-99/4A                           */
530   DRIVER( ti99_4ae )   /* 1981 TI-99/4A with 50Hz video               */
531   DRIVER( ti99_4ev)   /* 1994 TI-99/4A with EVPC video card            */
532   DRIVER( ti99_8 )   /* 1983 TI-99/8                              */
533   DRIVER( ti99_8e )   /* 1983 TI-99/8 with 50Hz video                  */
534534
535535   /* TI 99 clones */
536//0128u7   DRIVER( tutor)      /* 1983? Tomy Tutor                           */
537//0128u7   DRIVER( geneve )   /* 1987? Myarc Geneve 9640                     */
538//0128u7   DRIVER( genmod )   /* 199?? Myarc Geneve 9640                     */
539//0128u7   DRIVER( ti99_4p )   /* 1996 SNUG 99/4P (a.k.a. SGCPU)               */
536   DRIVER( tutor)      /* 1983? Tomy Tutor                           */
537   DRIVER( geneve )   /* 1987? Myarc Geneve 9640                     */
538   DRIVER( genmod )   /* 199?? Myarc Geneve 9640                     */
539   DRIVER( ti99_4p )   /* 1996 SNUG 99/4P (a.k.a. SGCPU)               */
540540
541541   DRIVER( avigo )      /*                                       */
542542
r3969r3970
917917   DRIVER( gamecom )   /* Tiger Game.com                           */
918918
919919   /* Thomson */
920//0128u7   DRIVER( t9000 )      /* 1980 Thomson T9000 (TO7 prototype)            */
921//0128u7   DRIVER( to7 )      /* 1982 Thomson TO7                           */
922//0128u7   DRIVER( to770 )      /* 1984 Thomson TO7/70                        */
923//0128u7   DRIVER( to770a )   /* 198? Thomson TO7/70 arabic version            */
924//0128u7   DRIVER( mo5 )      /* 1984 Thomson MO5                           */
925//0128u7   DRIVER( mo5e )      /* 1986 Thomson MO5E (export version)            */
926//0128u7   DRIVER( to9 )      /* 1985 Thomson T09                           */
927//0128u7   DRIVER( to8 )      /* 1986 Thomson T08                           */
928//0128u7   DRIVER( to8d )      /* 1987 Thomson T08D                        */
929//0128u7   DRIVER( to9p )      /* 1986 Thomson T09+                        */
930//0128u7   DRIVER( mo6 )      /* 1986 Thomson MO6                           */
931//0128u7   DRIVER( mo5nr )      /* 1986 Thomson MO5 NR                        */
932//0128u7   DRIVER( pro128 )   /* 1986 Olivetti Prodest PC 128                  */
920   DRIVER( t9000 )      /* 1980 Thomson T9000 (TO7 prototype)            */
921   DRIVER( to7 )      /* 1982 Thomson TO7                           */
922   DRIVER( to770 )      /* 1984 Thomson TO7/70                        */
923   DRIVER( to770a )   /* 198? Thomson TO7/70 arabic version            */
924   DRIVER( mo5 )      /* 1984 Thomson MO5                           */
925   DRIVER( mo5e )      /* 1986 Thomson MO5E (export version)            */
926   DRIVER( to9 )      /* 1985 Thomson T09                           */
927   DRIVER( to8 )      /* 1986 Thomson T08                           */
928   DRIVER( to8d )      /* 1987 Thomson T08D                        */
929   DRIVER( to9p )      /* 1986 Thomson T09+                        */
930   DRIVER( mo6 )      /* 1986 Thomson MO6                           */
931   DRIVER( mo5nr )      /* 1986 Thomson MO5 NR                        */
932   DRIVER( pro128 )   /* 1986 Olivetti Prodest PC 128                  */
933933
934934   /* Cybiko, Inc. */
935935//   DRIVER( cybikov1 )   /* Cybiko Wireless Intertainment System - Classic V1 */
src/mess/machine/99_dsk.c
r3969r3970
352352   FLOPPY_OPTION( ti99, "dsk",   "TI99 disk image",   ti99_floppy_identify,   ti99_floppy_construct, NULL)
353353FLOPPY_OPTIONS_END
354354
355static void ti99_install_tracktranslate_procs(void)
355static void ti99_install_tracktranslate_procs(running_machine *machine)
356356{
357357   int id;
358358   const device_config *image;
r3969r3970
403403   /* initialize the controller chip for HFDC */
404404   smc92x4_init(0, & hfdc_intf);
405405
406   ti99_install_tracktranslate_procs();
406   ti99_install_tracktranslate_procs(machine);
407407
408408   motor_on_timer = timer_alloc(machine, motor_on_timer_callback, NULL);
409409}
r3969r3970
14031403      switch (offset)
14041404      {
14051405      case 0x0fd0:
1406         reply = smc92x4_r(0, 0);
1406         reply = smc92x4_r(space->machine,0, 0);
14071407         //logerror("hfdc9234 data read\n");
14081408         break;
14091409
14101410      case 0x0fd4:
1411         reply = smc92x4_r(0, 1);
1411         reply = smc92x4_r(space->machine,0, 1);
14121412         //logerror("hfdc9234 status read\n");
14131413         break;
14141414      }
r3969r3970
14531453      switch (offset)
14541454      {
14551455      case 0x0fd2:
1456         smc92x4_w(0, 0, data);
1456         smc92x4_w(space->machine,0, 0, data);
14571457         //logerror("hfdc9234 data write %d\n", data);
14581458         break;
14591459
14601460      case 0x0fd6:
1461         smc92x4_w(0, 1, data);
1461         smc92x4_w(space->machine,0, 1, data);
14621462         //logerror("hfdc9234 command write %d\n", data);
14631463         break;
14641464      }
src/mess/machine/thomson.c
r3969r3970
741741{
742742   if ( printer_is_ready(printer_device(machine) ) )
743743      return TO7_IO_CENTRONICS;
744   else if ( image_exists( image_from_devtype_and_index( IO_SERIAL, THOM_SERIAL_CC90323 ) ) )
744   else if ( image_exists( image_from_devtype_and_index( machine, IO_SERIAL, THOM_SERIAL_CC90323 ) ) )
745745      return TO7_IO_RS232;
746746   return TO7_IO_NONE;
747747}
src/mess/machine/mc6843.c
r3969r3970
123123static const device_config* mc6843_floppy_image ( const device_config *device )
124124{
125125   mc6843_t* mc6843 = get_safe_token( device );
126   return image_from_devtype_and_index( IO_FLOPPY, mc6843->drive );
126   return image_from_devtype_and_index( device->machine, IO_FLOPPY, mc6843->drive );
127127}
128128
129129
r3969r3970
783783   /* setup/reset floppy drive */
784784   for ( i = 0; i < device_count( device->machine, IO_FLOPPY ); i++ )
785785   {
786      const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i );
786      const device_config * img = image_from_devtype_and_index( device->machine, IO_FLOPPY, i );
787787      floppy_drive_set_motor_state( img, 1 );
788788      floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
789789      floppy_drive_set_rpm( img, 300. );
src/mess/machine/smc92x4.c
r3969r3970
129129   disk_unit: floppy drive index
130130   head: selected head
131131*/
132static int floppy_read_id(int which, int disk_unit, int head)
132static int floppy_read_id(running_machine *machine,int which, int disk_unit, int head)
133133{
134134   const device_config *disk_img = image_from_devtype_and_index(machine, IO_FLOPPY, disk_unit);
135135   UINT8 revolution_count;
r3969r3970
161161   which: udc controller index
162162   disk_unit: floppy drive index
163163*/
164static int floppy_find_sector(int which, int disk_unit, int cylinder, int head, int check_secnum, int sector, int *sector_data_id, int *sector_len)
164static int floppy_find_sector(running_machine *machine,int which, int disk_unit, int cylinder, int head, int check_secnum, int sector, int *sector_data_id, int *sector_len)
165165{
166166   const device_config *disk_img = image_from_devtype_and_index(machine, IO_FLOPPY, disk_unit);
167167   UINT8 revolution_count;
r3969r3970
202202   return FALSE;
203203}
204204
205static int smc92x4_floppy_read_sector(int which, int disk_unit, int cylinder, int head, int check_secnum, int sector, int *dma_address)
205static int smc92x4_floppy_read_sector(running_machine *machine,int which, int disk_unit, int cylinder, int head, int check_secnum, int sector, int *dma_address)
206206{
207207   int sector_data_id, sector_len;
208208   UINT8 buf[MAX_SECTOR_LEN];
209209   int i;
210210   const device_config *disk_img = image_from_devtype_and_index(machine, IO_FLOPPY, disk_unit);
211211
212   if (! floppy_find_sector(which, disk_unit, cylinder, head, check_secnum, sector, & sector_data_id, & sector_len))
212   if (! floppy_find_sector(machine,which, disk_unit, cylinder, head, check_secnum, sector, & sector_data_id, & sector_len))
213213   {
214214      hfdc[which].status |= ST_TC_RDIDERR;
215215      return FALSE;
r3969r3970
224224   return TRUE;
225225}
226226
227static int smc92x4_floppy_write_sector(int which, int disk_unit, int cylinder, int head, int check_secnum, int sector, int *dma_address)
227static int smc92x4_floppy_write_sector(running_machine *machine,int which, int disk_unit, int cylinder, int head, int check_secnum, int sector, int *dma_address)
228228{
229229   int sector_data_id, sector_len;
230230   UINT8 buf[MAX_SECTOR_LEN];
231231   int i;
232232   const device_config *disk_img = image_from_devtype_and_index(machine, IO_FLOPPY, disk_unit);
233233
234   if (! floppy_find_sector(which, disk_unit, cylinder, head, check_secnum, sector, & sector_data_id, & sector_len))
234   if (! floppy_find_sector(machine,which, disk_unit, cylinder, head, check_secnum, sector, & sector_data_id, & sector_len))
235235   {
236236      hfdc[which].status |= ST_TC_RDIDERR;
237237      return FALSE;
r3969r3970
246246   return TRUE;
247247}
248248
249static void floppy_step(int which, int disk_unit, int direction)
249static void floppy_step(running_machine *machine,int which, int disk_unit, int direction)
250250{
251251   const device_config *disk_img = image_from_devtype_and_index(machine, IO_FLOPPY, disk_unit);
252252   floppy_drive_seek(disk_img, direction);
253253}
254254
255static UINT8 floppy_get_disk_status(int which, int disk_unit)
255static UINT8 floppy_get_disk_status(running_machine *machine,int which, int disk_unit)
256256{
257257   const device_config *disk_img = image_from_devtype_and_index(machine, IO_FLOPPY, disk_unit);
258258   int status = floppy_status(disk_img, -1);
r3969r3970
570570      smc92x4_set_interrupt(which, 1);
571571}
572572
573INLINE void step(int which, select_mode_t select_mode, int disk_unit, int direction)
573INLINE void step(running_machine *machine,int which, select_mode_t select_mode, int disk_unit, int direction)
574574{
575575   switch (select_mode)
576576   {
r3969r3970
588588
589589   case sm_floppy_slow:
590590   case sm_floppy_fast:
591      floppy_step(which, disk_unit, direction);
591      floppy_step(machine,which, disk_unit, direction);
592592      break;
593593   }
594594}
r3969r3970
596596/*
597597   Perform the read_id phase on a drive
598598*/
599INLINE int read_id(int which, select_mode_t select_mode, int disk_unit, int head,
599INLINE int read_id(running_machine *machine,int which, select_mode_t select_mode, int disk_unit, int head,
600600               int do_implied_seek, int desired_cylinder)
601601{
602602   int reply;
r3969r3970
618618
619619   case sm_floppy_slow:
620620   case sm_floppy_fast:
621      reply = floppy_read_id(which, disk_unit, head);
621      reply = floppy_read_id(machine,which, disk_unit, head);
622622      break;
623623   }
624624
r3969r3970
668668      }
669669
670670      for (i=0; i<step_count; i++)
671         step(which, select_mode, disk_unit, step_direction);
671         step(machine,which, select_mode, disk_unit, step_direction);
672672   }
673673
674674   return reply;
r3969r3970
677677/*
678678   Get the status of a drive
679679*/
680INLINE UINT8 get_disk_status(int which, select_mode_t select_mode, int disk_unit)
680INLINE UINT8 get_disk_status(running_machine *machine,int which, select_mode_t select_mode, int disk_unit)
681681{
682682   UINT8 reply;
683683
r3969r3970
698698
699699   case sm_floppy_slow:
700700   case sm_floppy_fast:
701      reply = floppy_get_disk_status(which, disk_unit);
701      reply = floppy_get_disk_status(machine,which, disk_unit);
702702      break;
703703
704704   }
r3969r3970
709709/*
710710   Handle the step command
711711*/
712static void do_step(int which, int mode)
712static void do_step(running_machine *machine,int which, int mode)
713713{
714714   select_mode_t select_mode;
715715   int disk_unit = 0;
r3969r3970
727727      goto cleanup;
728728   }
729729
730   step(which, select_mode, disk_unit, (mode & 2) ? -1 : +1);
730   step(machine,which, select_mode, disk_unit, (mode & 2) ? -1 : +1);
731731
732732cleanup:
733733   /* update register state */
734734   set_command_done(which);
735735
736736   /* set drive status */
737   hfdc[which].regs[hfdc_reg_drive_stat] = get_disk_status(which, select_mode, disk_unit);
737   hfdc[which].regs[hfdc_reg_drive_stat] = get_disk_status(machine,which, select_mode, disk_unit);
738738}
739739
740740/*
741741   Handle the restore command
742742*/
743static void do_restore(int which, int mode)
743static void do_restore(running_machine *machine,int which, int mode)
744744{
745745   select_mode_t select_mode;
746746   int disk_unit = 0;
r3969r3970
773773   case sm_floppy_fast:
774774      seek_count = 0;
775775      /* limit iterations to 2048 to prevent an endless loop if the disc is locked */
776      while ((seek_count < 2048) && ! (get_disk_status(which, select_mode, disk_unit) & DS_TRK00))
776      while ((seek_count < 2048) && ! (get_disk_status(machine,which, select_mode, disk_unit) & DS_TRK00))
777777      {
778         step(which, select_mode, disk_unit, -1);
778         step(machine,which, select_mode, disk_unit, -1);
779779         seek_count++;
780780      }
781781      break;
r3969r3970
786786   set_command_done(which);
787787
788788   /* set drive status */
789   hfdc[which].regs[hfdc_reg_drive_stat] = get_disk_status(which, select_mode, disk_unit);
789   hfdc[which].regs[hfdc_reg_drive_stat] = get_disk_status(machine,which, select_mode, disk_unit);
790790}
791791
792792/*
r3969r3970
796796   physical_flag: if 1, read consecutive sectors, ignoring sector IDs
797797   mode: extra flags (ignored)
798798*/
799static void do_read(int which, int physical_flag, int mode)
799static void do_read(running_machine *machine,int which, int physical_flag, int mode)
800800{
801801   select_mode_t select_mode;
802802   int disk_unit = 0;
r3969r3970
825825      goto cleanup;
826826   }
827827
828   if (! (get_disk_status(which, select_mode, disk_unit) & DS_READY))
828   if (! (get_disk_status(machine,which, select_mode, disk_unit) & DS_READY))
829829   {
830830      /* unit is not ready */
831831      hfdc[which].status |= ST_TC_RDIDERR;
r3969r3970
837837   /* if we enable write-protect test in read operations, the ti99 HFDC DSR is
838838   unable to read write-protected floppies! */
839839   if ((hfdc[which].regs[hfdc_reg_term] & TC_TWPROT)
840         && (get_disk_status(which, select_mode, disk_unit) & DS_WRPROT))
840         && (get_disk_status(machine,which, select_mode, disk_unit) & DS_WRPROT))
841841   {
842842      /* unit is write protected */
843843      hfdc[which].status |= ST_TC_RDIDERR;   /* right??? */
r3969r3970
845845   }
846846#endif
847847
848   read_id(which, select_mode, disk_unit, head, ! (mode & 0x02), cylinder);
848   read_id(machine,which, select_mode, disk_unit, head, ! (mode & 0x02), cylinder);
849849
850850   while (hfdc[which].regs[hfdc_reg_sector_count])
851851   {
r3969r3970
867867
868868      case sm_floppy_slow:
869869      case sm_floppy_fast:
870         if (! smc92x4_floppy_read_sector(which, disk_unit, cylinder, head, 1, sector, &dma_address))
870         if (! smc92x4_floppy_read_sector(machine,which, disk_unit, cylinder, head, 1, sector, &dma_address))
871871            goto cleanup;
872872         break;
873873      }
r3969r3970
898898   hfdc[which].regs[hfdc_reg_des_sector] = sector;
899899
900900   /* set drive status */
901   hfdc[which].regs[hfdc_reg_drive_stat] = get_disk_status(which, select_mode, disk_unit);
901   hfdc[which].regs[hfdc_reg_drive_stat] = get_disk_status(machine,which, select_mode, disk_unit);
902902}
903903
904904/*
r3969r3970
908908   physical_flag: if 1, ignore CRC/ECC bytes??? (ignored)
909909   mode: extra flags (ignored)
910910*/
911static void do_write(int which, int physical_flag, int mode)
911static void do_write(running_machine *machine,int which, int physical_flag, int mode)
912912{
913913   select_mode_t select_mode;
914914   int disk_unit = 0;
r3969r3970
937937      goto cleanup;
938938   }
939939
940   if (! (get_disk_status(which, select_mode, disk_unit) & DS_READY))
940   if (! (get_disk_status(machine,which, select_mode, disk_unit) & DS_READY))
941941   {
942942      /* unit is not ready */
943943      hfdc[which].status |= ST_TC_RDIDERR;
r3969r3970
946946   }
947947
948948   if ((hfdc[which].regs[hfdc_reg_term] & TC_TWPROT)
949         && (get_disk_status(which, select_mode, disk_unit) & DS_WRPROT))
949         && (get_disk_status(machine,which, select_mode, disk_unit) & DS_WRPROT))
950950   {
951951      /* unit is write protected */
952952      hfdc[which].status |= ST_TC_RDIDERR;   /* right??? */
r3969r3970
954954   }
955955
956956
957   read_id(which, select_mode, disk_unit, head, ! (mode & 0x40), cylinder);
957   read_id(machine,which, select_mode, disk_unit, head, ! (mode & 0x40), cylinder);
958958
959959   while (hfdc[which].regs[hfdc_reg_sector_count])
960960   {
r3969r3970
976976
977977      case sm_floppy_slow:
978978      case sm_floppy_fast:
979         if (!smc92x4_floppy_write_sector(which, disk_unit, cylinder, head, 1, sector, &dma_address))
979         if (!smc92x4_floppy_write_sector(machine,which, disk_unit, cylinder, head, 1, sector, &dma_address))
980980            goto cleanup;
981981         break;
982982      }
r3969r3970
10071007   hfdc[which].regs[hfdc_reg_des_sector] = sector;
10081008
10091009   /* set drive status */
1010   hfdc[which].regs[hfdc_reg_drive_stat] = get_disk_status(which, select_mode, disk_unit);
1010   hfdc[which].regs[hfdc_reg_drive_stat] = get_disk_status(machine,which, select_mode, disk_unit);
10111011}
10121012
10131013/*
10141014   Process a command
10151015*/
1016static void smc92x4_process_command(int which, int opcode)
1016static void smc92x4_process_command(running_machine *machine,int which, int opcode)
10171017{
10181018   if (opcode < 0x80)
10191019   {
r3969r3970
10431043               /* bit 0: 0 -> command ends after last seek pulse, 1 -> command
10441044                  ends when the drive asserts the seek complete pin */
10451045               logerror("smc92x4 restore command %X\n", opcode & 0x01);
1046               do_restore(which, opcode & 0x01);
1046               do_restore(machine,which, opcode & 0x01);
10471047               break;
10481048            }
10491049         }
r3969r3970
10541054            /* bit 0: 0 -> command ends after last seek pulse, 1 -> command
10551055               ends when the drive asserts the seek complete pin */
10561056            logerror("smc92x4 step command %X\n", opcode & 0x3);
1057            do_step(which, opcode & 0x03);
1057            do_step(machine,which, opcode & 0x03);
10581058         }
10591059         else
10601060         {
r3969r3970
11071107            {
11081108            case 0:
11091109               logerror("smc92x4 read physical command %X\n", opcode & 0x1);
1110               do_read(which, 1, opcode & 0x3);
1110               do_read(machine,which, 1, opcode & 0x3);
11111111               break;
11121112            case 1:
11131113               logerror("smc92x4 read track command %X\n", opcode & 0x1);
r3969r3970
11151115            case 2:
11161116            case 3:
11171117               logerror("smc92x4 read logical command %X\n", opcode & 0x3);
1118               do_read(which, 0, opcode & 0x3);
1118               do_read(machine,which, 0, opcode & 0x3);
11191119               break;
11201120            }
11211121         }
r3969r3970
11441144      {
11451145      case 0:
11461146         logerror("smc92x4 write physical command %X\n", opcode & 0x7f);
1147         do_write(which, 1, opcode & 0x7f);
1147         do_write(machine,which, 1, opcode & 0x7f);
11481148         break;
11491149      case 1:
11501150         logerror("smc92x4 write logical command %X\n", opcode & 0x7f);
1151         do_write(which, 0, opcode & 0x7f);
1151         do_write(machine,which, 0, opcode & 0x7f);
11521152         break;
11531153      case 2:
11541154         logerror("smc92x4 write physical command??? %X\n", opcode & 0x7f);
1155         do_write(which, 1, opcode & 0x7f);
1155         do_write(machine,which, 1, opcode & 0x7f);
11561156         break;
11571157      case 3:
11581158         logerror("smc92x4 write logical command??? %X\n", opcode & 0x7f);
1159         do_write(which, 0, opcode & 0x7f);
1159         do_write(machine,which, 0, opcode & 0x7f);
11601160         break;
11611161      }
11621162   }
r3969r3970
11691169/*
11701170   Read a byte of data from a smc99x4 controller
11711171*/
1172int smc92x4_r(int which, int offset)
1172int smc92x4_r(running_machine *machine,int which, int offset)
11731173{
11741174   int reply = 0;
11751175
r3969r3970
12081208/*
12091209   Write a byte to a smc99x4 controller
12101210*/
1211void smc92x4_w(int which, int offset, int data)
1211void smc92x4_w(running_machine *machine,int which, int offset, int data)
12121212{
12131213   data &= 0xff;
12141214
r3969r3970
12351235
12361236   case 1:
12371237      /* command register */
1238      smc92x4_process_command(which, data);
1238      smc92x4_process_command(machine,which, data);
12391239      break;
12401240   }
12411241}
12421242
12431243 READ8_HANDLER(smc92x4_0_r)
12441244{
1245   return smc92x4_r(0, offset);
1245   return smc92x4_r(space->machine,0, offset);
12461246}
12471247
12481248WRITE8_HANDLER(smc92x4_0_w)
12491249{
1250   smc92x4_w(0, offset, data);
1250   smc92x4_w(space->machine,0, offset, data);
12511251}
12521252
12531253static const struct harddisk_callback_config smc92x4_harddisk_config =
src/mess/machine/smc92x4.h
r3969r3970
4444
4545void smc92x4_init(int which, const smc92x4_intf *intf);
4646void smc92x4_reset(int which);
47int smc92x4_r(int which, int offset);
48void smc92x4_w(int which, int offset, int data);
47int smc92x4_r(running_machine *machine,int which, int offset);
48void smc92x4_w(running_machine *machine,int which, int offset, int data);
4949 READ8_HANDLER(smc92x4_0_r);
5050WRITE8_HANDLER(smc92x4_0_w);
5151
src/mess/mess.mak
r3969r3970
474474   $(MESSOBJ)/vc4000.a \
475475   $(MESSOBJ)/vector06.a \
476476   $(MESSOBJ)/votrax.a \
477   $(MESSOBJ)/shared.a \
478477   $(MESSOBJ)/super80.a \
479478   $(MESSOBJ)/acorn.a \
480479   $(MESSOBJ)/kramermc.a \
r3969r3970
484483   $(MESSOBJ)/nascom1.a \
485484   $(MESSOBJ)/sord.a \
486485   $(MESSOBJ)/tatung.a \
486   $(MESSOBJ)/ti99.a \
487   $(MESSOBJ)/thomson.a \
487488   $(MESSOBJ)/veb.a \
488489   $(MESSOBJ)/vtech.a \
490   $(MESSOBJ)/shared.a \
489491
490#   $(MESSOBJ)/ti99.a \
491#   $(MESSOBJ)/thomson.a \
492492
493493
494494#-------------------------------------------------
src/mess/devices/thomflop.c
r3969r3970
987987
988988
989989
990static int thmfc_floppy_find_sector ( chrn_id* dst )
990static int thmfc_floppy_find_sector ( running_machine *machine,chrn_id* dst )
991991{
992   const device_config* img = thmfc_floppy_image();
992   const device_config* img = thmfc_floppy_image(machine);
993993   chrn_id id;
994994   int r = 0;
995995
r3969r3970
10331033   if ( thmfc1->op == THMFC1_OP_WRITE_SECT )
10341034   {
10351035      /* TODO: detect ddam (?) */
1036      const device_config * img = thmfc_floppy_image();
1036      const device_config * img = thmfc_floppy_image(machine);
10371037      floppy_drive_write_sector_data( img, thmfc1->side, thmfc1->sector, thmfc1->data + 3, thmfc1->data_size - 3, 0 );
10381038   }
10391039   thmfc1->op = THMFC1_OP_RESET;
r3969r3970
10851085   {
10861086      if ( thmfc_floppy_is_qdd() )
10871087         /* QDD: track = whole disk */
1088         thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(), thmfc1->data );
1088         thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(machine), thmfc1->data );
10891089      else
10901090      {
10911091         thmfc1->data_raw_idx = 0;
1092         thmfc1->data_raw_size = thom_floppy_make_track( thmfc_floppy_image(), thmfc1->data,
1092         thmfc1->data_raw_size = thom_floppy_make_track( thmfc_floppy_image(machine), thmfc1->data,
10931093                           thmfc1->sector_size, thmfc1->side );
10941094      }
10951095      assert( thmfc1->data_raw_size < sizeof( thmfc1->data ) );
r3969r3970
11231123
11241124      if ( ! thmfc1->data_raw_size )
11251125      {
1126         thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(), thmfc1->data );
1126         thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(machine), thmfc1->data );
11271127         assert( thmfc1->data_raw_size < sizeof( thmfc1->data ) );
11281128      }
11291129
r3969r3970
11531153
11541154         LOG(( "%f $%04x thmfc_floppy_qdd_write_byte: id field, sector=%i\n", attotime_to_double(timer_get_time(machine)), cpu_get_previouspc( machine->cpu[0] ), sector ));
11551155
1156         floppy_drive_format_sector( thmfc_floppy_image(), 0, sector, 0, 0, sector, 128, filler );
1156         floppy_drive_format_sector( thmfc_floppy_image(machine), 0, sector, 0, 0, sector, 128, filler );
11571157         thmfc1->data_idx = 0;
11581158      }
11591159
r3969r3970
11751175         if ( i >= 0 )
11761176         {
11771177            /* got an id & a data field => write */
1178            const device_config * img = thmfc_floppy_image();
1178            const device_config * img = thmfc_floppy_image(machine);
11791179            int sector = (int) thmfc1->data[ i + 1 ] * 256 +
11801180               (int) thmfc1->data[ i + 2 ];
11811181
r3969r3970
12351235         if ( !memcmp ( thmfc1->data, header, sizeof( header ) ) )
12361236         {
12371237            /* got id field => format */
1238            const device_config * img = thmfc_floppy_image();
1238            const device_config * img = thmfc_floppy_image(machine);
12391239            UINT8 track  = thmfc1->data[4];
12401240            UINT8 side   = thmfc1->data[5];
12411241            UINT8 sector = thmfc1->data[6];
r3969r3970
12651265   case 1: /* STAT1 */
12661266   {
12671267      UINT8 data = 0;
1268      const device_config * img = thmfc_floppy_image();
1268      const device_config * img = thmfc_floppy_image(space->machine);
12691269      int flags = floppy_drive_get_flag_state( img, -1 );
12701270      if ( thmfc_floppy_is_qdd() )
12711271      {
r3969r3970
13521352      case THMFC1_OP_WRITE_SECT:
13531353         if ( qdd )
13541354            logerror( "thmfc_floppy_w: smart operation 1 not supported for QDD\n" );
1355         else if ( thmfc_floppy_find_sector( NULL ) )
1355         else if ( thmfc_floppy_find_sector( space->machine, NULL ) )
13561356         {
13571357            thmfc1->data_idx = 0;
13581358            thmfc1->data_size = thmfc1->sector_size + 3; /* A1 A1 FB <data> */
r3969r3970
13661366      case THMFC1_OP_READ_ADDR:
13671367         if ( qdd )
13681368            logerror( "thmfc_floppy_w: smart operation 2 not supported for QDD\n" );
1369         else if ( thmfc_floppy_find_sector( &id ) )
1369         else if ( thmfc_floppy_find_sector( space->machine, &id ) )
13701370         {
13711371            thmfc1->data_size =
13721372               thom_floppy_make_addr( id, thmfc1->data, thmfc1->sector_size );
r3969r3970
13821382      case THMFC1_OP_READ_SECT:
13831383         if ( qdd )
13841384            logerror( "thmfc_floppy_w: smart operation 3 not supported for QDD\n" );
1385         else if ( thmfc_floppy_find_sector( &id ) )
1385         else if ( thmfc_floppy_find_sector( space->machine, &id ) )
13861386         {
13871387            thmfc1->data_size = thom_floppy_make_sector
1388               ( thmfc_floppy_image(), id, thmfc1->data, thmfc1->sector_size );
1388               ( thmfc_floppy_image(space->machine), id, thmfc1->data, thmfc1->sector_size );
13891389            assert( thmfc1->data_size < sizeof( thmfc1->data ) );
13901390            thmfc1->data_finish = thmfc1->sector_size + 4;
13911391            thmfc1->data_idx = 1;
r3969r3970
13991399      /* synchronize to word, if needed (QDD only) */
14001400      if ( wsync && qdd ) {
14011401         if ( ! thmfc1->data_raw_size )
1402            thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(), thmfc1->data );
1402            thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(space->machine), thmfc1->data );
14031403         while ( thmfc1->data_raw_idx < thmfc1->data_raw_size &&
14041404            thmfc1->data[ thmfc1->data_raw_idx ] != thmfc1->wsync )
14051405         {
r3969r3970
14471447         thmfc1->drive |= 1 ^ ((data >> 6) & 1);
14481448      }
14491449
1450      img = thmfc_floppy_image();
1450      img = thmfc_floppy_image(space->machine);
14511451      thom_floppy_active( space->machine, 0 );
14521452
14531453      LOG (( "%f $%04x thmfc_floppy_w: CMD2=$%02X drv=%i step=%i motor=%i\n",
r3969r3970
15031503      thmfc1->track = data;
15041504      LOG (( "%f $%04x thmfc_floppy_w: WTRCK=%i (real=%i)\n",
15051505             attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc( space->machine->cpu[0] ), data,
1506             floppy_drive_get_current_track( thmfc_floppy_image() ) ));
1506             floppy_drive_get_current_track( thmfc_floppy_image(space->machine) ) ));
15071507      break;
15081508
15091509   case 7: /* WCELL */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team