Previous 15994 Revisions Next

r11987 Saturday 18th June, 2011 at 16:23:45 UTC by Miodrag Milanović
Some WIP on floppies (no whatsnew)
[src/emu/imagedev]flopdrv.h
[src/emu/machine]wd17xx.c wd17xx.h
[src/mess/drivers]osi.c prof80.c sg1000.c thomson.c
[src/mess/machine]thomflop.c thomflop.h

src/emu/imagedev/flopdrv.h
r11986r11987
7575   device_image_display_info_func   device_displayinfo;
7676};
7777
78/* sector has a deleted data address mark */
79#define ID_FLAG_DELETED_DATA   0x0001
80/* CRC error in id field */
81#define ID_FLAG_CRC_ERROR_IN_ID_FIELD 0x0002
82/* CRC error in data field */
83#define ID_FLAG_CRC_ERROR_IN_DATA_FIELD 0x0004
84
8578struct chrn_id
8679{
8780   unsigned char C;
src/emu/machine/wd17xx.c
r11986r11987
386386
387387static void wd17xx_complete_command(device_t *device, int delay);
388388static void wd17xx_timed_data_request(device_t *device);
389static void wd17xx_index_pulse_callback(device_t *controller, device_t *img, int state);
390389static int wd17xx_locate_sector(device_t *device);
391390static void wd17xx_timed_read_sector_request(device_t *device);
392391
r11986r11987
899898
900899
901900
902static void wd17xx_index_pulse_callback(device_t *controller, device_t *img, int state)
901void wd17xx_index_pulse_callback(device_t *controller, device_t *img, int state)
903902{
904903   wd1770_state *w = get_safe_token(controller);
905904
src/emu/machine/wd17xx.h
r11986r11987
5858void wd17xx_set_side(device_t *device, UINT8);      /* set side wd179x is accessing */
5959
6060void wd17xx_set_pause_time(device_t *device, int usec);       /* default is 40 usec if not set */
61void wd17xx_index_pulse_callback(device_t *controller, device_t *img, int state);
6162
6263READ8_DEVICE_HANDLER( wd17xx_status_r );
6364READ8_DEVICE_HANDLER( wd17xx_track_r );
src/mess/machine/thomflop.c
r11986r11987
434434         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
435435         floppy_drive_set_rpm( img, 300. );
436436         floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
437         floppy_drive_set_index_pulse_callback( img, to7_5p14_index_pulse_callback );
438437      }
439438   }
440439}
r11986r11987
837836   {
838837      device_t * img = floppy_get_device( machine, i );
839838      if (img) {
840         floppy_drive_set_index_pulse_callback( img, to7_qdd_index_pulse_cb );
841839         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
842840
843841         motor_on = CLEAR_LINE;
r11986r11987
15341532   {
15351533      device_t * img = floppy_get_device( machine, i );
15361534      if (img) {
1537         floppy_drive_set_index_pulse_callback( img, thmfc_floppy_index_pulse_cb );
15381535         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
15391536         floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
15401537      }
r11986r11987
19271924   else
19281925      to7_5p14_w( space, offset, data );
19291926}
1927
1928WRITE_LINE_DEVICE_HANDLER(thomson_index_callback)
1929{
1930   switch ( to7_controller_type )
1931   {
1932   case 1:
1933      to7_5p14_index_pulse_callback(NULL, device, state);
1934      break;
1935
1936   case 2:
1937      wd17xx_index_pulse_callback(device->machine().device("wd2793"), device, state);
1938      break;
1939
1940   case 3:
1941      thmfc_floppy_index_pulse_cb(NULL, device, state);
1942      break;
1943
1944   case 4:
1945      to7_qdd_index_pulse_cb(NULL, device, state);
1946      break;
1947
1948   default:
1949      break;
1950   }
1951}
src/mess/machine/thomflop.h
r11986r11987
4848extern READ8_HANDLER  ( thmfc_floppy_r );
4949extern WRITE8_HANDLER ( thmfc_floppy_w );
5050
51extern WRITE_LINE_DEVICE_HANDLER(thomson_index_callback);
5152
5253#endif /* THOMFLOP_H_ */
src/mess/drivers/thomson.c
r11986r11987
587587
588588static const floppy_interface thomson_floppy_interface =
589589{
590   DEVCB_LINE(thomson_index_callback),
590591   DEVCB_NULL,
591592   DEVCB_NULL,
592593   DEVCB_NULL,
593594   DEVCB_NULL,
594   DEVCB_NULL,
595595   FLOPPY_STANDARD_5_25_DSHD,
596596   FLOPPY_OPTIONS_NAME(thomson),
597597   NULL,
src/mess/drivers/sg1000.c
r11986r11987
920920FLOPPY_OPTIONS_END
921921
922922/*-------------------------------------------------
923    sf7000_fdc_index_callback -
924-------------------------------------------------*/
925
926static WRITE_LINE_DEVICE_HANDLER(sf7000_fdc_index_callback)
927{
928   sf7000_state *driver_state = device->machine().driver_data<sf7000_state>();
929
930   driver_state->m_fdc_index = state;
931}
932
933/*-------------------------------------------------
923934    floppy_interface sf7000_floppy_interface
924935-------------------------------------------------*/
925936
926937static const floppy_interface sf7000_floppy_interface =
927938{
939   DEVCB_LINE(sf7000_fdc_index_callback),
928940   DEVCB_NULL,
929941   DEVCB_NULL,
930942   DEVCB_NULL,
931943   DEVCB_NULL,
932   DEVCB_NULL,
933944   FLOPPY_STANDARD_5_25_DSHD,
934945   FLOPPY_OPTIONS_NAME(sf7000),
935946   NULL,
r11986r11987
941952***************************************************************************/
942953
943954/*-------------------------------------------------
944    sf7000_fdc_index_callback -
945-------------------------------------------------*/
946
947static void sf7000_fdc_index_callback(device_t *controller, device_t *img, int state)
948{
949   sf7000_state *driver_state = img->machine().driver_data<sf7000_state>();
950
951   driver_state->m_fdc_index = state;
952}
953
954/*-------------------------------------------------
955955    TIMER_CALLBACK( lightgun_tick )
956956-------------------------------------------------*/
957957
r11986r11987
10131013{
10141014   /* configure VDP */
10151015   TMS9928A_configure(&tms9928a_interface);
1016
1017   /* configure FDC */
1018   floppy_drive_set_index_pulse_callback(m_floppy0, sf7000_fdc_index_callback);
1019
1016   
10201017   /* configure memory banking */
10211018   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(Z80_TAG)->base(), 0);
10221019   memory_configure_bank(machine(), "bank1", 1, 1, ram_get_ptr(m_ram), 0);
src/mess/drivers/osi.c
r11986r11987
332332    C011 ACIAIO         DISK CONTROLLER ACIA I/O PORT
333333*/
334334
335static void osi470_index_callback(device_t *controller, device_t *img, int state)
335static WRITE_LINE_DEVICE_HANDLER(osi470_index_callback)
336336{
337   sb2m600_state *driver_state = img->machine().driver_data<sb2m600_state>();
337   sb2m600_state *driver_state = device->machine().driver_data<sb2m600_state>();
338338
339339   driver_state->m_fdc_index = state;
340340}
r11986r11987
691691void c1pmf_state::machine_start()
692692{
693693   c1p_state::machine_start();
694
695   /* set floppy index hole callback */
696   floppy_drive_set_index_pulse_callback(m_floppy, osi470_index_callback);
697694}
698695
699696static FLOPPY_OPTIONS_START(osi)
r11986r11987
707704
708705static const floppy_interface osi_floppy_interface =
709706{
707   DEVCB_LINE(osi470_index_callback),
710708   DEVCB_NULL,
711709   DEVCB_NULL,
712710   DEVCB_NULL,
713711   DEVCB_NULL,
714   DEVCB_NULL,
715712   FLOPPY_STANDARD_5_25_SSDD_40,
716713   FLOPPY_OPTIONS_NAME(osi),
717714   NULL,
src/mess/drivers/prof80.c
r11986r11987
10271027
10281028// UPD765 Interface
10291029
1030static void prof80_fdc_index_callback(device_t *controller, device_t *img, int state)
1031{
1032   prof80_state *driver_state = img->machine().driver_data<prof80_state>();
1033
1034   driver_state->m_fdc_index = state;
1035}
1036
10371030static const struct upd765_interface fdc_intf =
10381031{
10391032   DEVCB_NULL,
r11986r11987
12241217   m_rtc->cs_w(1);
12251218   m_rtc->oe_w(1);
12261219
1227   // configure FDC
1228   floppy_drive_set_index_pulse_callback(m_floppy0, prof80_fdc_index_callback);
1229
12301220   // allocate floppy motor off timer
12311221   m_floppy_motor_off_timer = machine().scheduler().timer_alloc(FUNC(floppy_motor_off_tick));
12321222
r11986r11987
12901280   save_item(NAME(m_dpage));
12911281}
12921282
1283static WRITE_LINE_DEVICE_HANDLER(prof80_fdc_index_callback)
1284{
1285   prof80_state *driver_state = device->machine().driver_data<prof80_state>();
1286
1287   driver_state->m_fdc_index = state;
1288}
1289
12931290static const floppy_interface prof80_floppy_interface =
12941291{
1292   DEVCB_LINE(prof80_fdc_index_callback),
12951293   DEVCB_NULL,
12961294   DEVCB_NULL,
12971295   DEVCB_NULL,
12981296   DEVCB_NULL,
1299   DEVCB_NULL,
13001297   FLOPPY_STANDARD_5_25_DSHD,
13011298   FLOPPY_OPTIONS_NAME(default),
13021299   NULL,

Previous 15994 Revisions Next


© 1998-2018 The MESS Team