src/mess/machine/wd17xx.c
| r6011 | r6012 | |
| 2 | 2 | |
| 3 | 3 | wd17xx.c |
| 4 | 4 | |
| 5 | | Implementations of the Western Digitial 17xx and 19xx families of |
| 5 | Implementations of the Western Digital 17xx and 19xx families of |
| 6 | 6 | floppy disk controllers |
| 7 | 7 | |
| 8 | 8 | |
| r6011 | r6012 | |
| 232 | 232 | TYPE DEFINITIONS |
| 233 | 233 | ***************************************************************************/ |
| 234 | 234 | |
| 235 | | typedef struct _wd17xx_t wd17xx_t; |
| 236 | | struct _wd17xx_t |
| 235 | typedef struct _wd1770_state wd1770_state; |
| 236 | struct _wd1770_state |
| 237 | 237 | { |
| 238 | 238 | /* callbacks */ |
| 239 | 239 | devcb_resolved_write_line out_intrq_func; |
| r6011 | r6012 | |
| 337 | 337 | INLINE FUNCTIONS |
| 338 | 338 | *****************************************************************************/ |
| 339 | 339 | |
| 340 | | INLINE wd17xx_t *get_safe_token(const device_config *device) |
| 340 | INLINE wd1770_state *get_safe_token(const device_config *device) |
| 341 | 341 | { |
| 342 | 342 | assert(device != NULL); |
| 343 | 343 | assert(device->token != NULL); |
| 344 | 344 | |
| 345 | | return (wd17xx_t *)device->token; |
| 345 | return (wd1770_state *)device->token; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | |
| r6011 | r6012 | |
| 375 | 375 | |
| 376 | 376 | static int wd17xx_has_side_select(const device_config *device) |
| 377 | 377 | { |
| 378 | | wd17xx_t *w = get_safe_token(device); |
| 378 | wd1770_state *w = get_safe_token(device); |
| 379 | 379 | return (w->type == WD_TYPE_1773) || (w->type == WD_TYPE_1793) || (w->type == WD_TYPE_2793); |
| 380 | 380 | } |
| 381 | 381 | |
| r6011 | r6012 | |
| 399 | 399 | /* clear a data request */ |
| 400 | 400 | static void wd17xx_clear_drq(const device_config *device) |
| 401 | 401 | { |
| 402 | | wd17xx_t *w = get_safe_token(device); |
| 402 | wd1770_state *w = get_safe_token(device); |
| 403 | 403 | |
| 404 | 404 | w->status &= ~STA_2_DRQ; |
| 405 | 405 | |
| r6011 | r6012 | |
| 410 | 410 | /* set data request */ |
| 411 | 411 | static void wd17xx_set_drq(const device_config *device) |
| 412 | 412 | { |
| 413 | | wd17xx_t *w = get_safe_token(device); |
| 413 | wd1770_state *w = get_safe_token(device); |
| 414 | 414 | |
| 415 | 415 | if (w->status & STA_2_DRQ) |
| 416 | 416 | w->status |= STA_2_LOST_DAT; |
| r6011 | r6012 | |
| 424 | 424 | /* clear interrupt request */ |
| 425 | 425 | static void wd17xx_clear_intrq(const device_config *device) |
| 426 | 426 | { |
| 427 | | wd17xx_t *w = get_safe_token(device); |
| 427 | wd1770_state *w = get_safe_token(device); |
| 428 | 428 | |
| 429 | 429 | w->intrq = CLEAR_LINE; |
| 430 | 430 | devcb_call_write_line(&w->out_intrq_func, w->intrq); |
| r6011 | r6012 | |
| 433 | 433 | /* set interrupt request */ |
| 434 | 434 | static void wd17xx_set_intrq(const device_config *device) |
| 435 | 435 | { |
| 436 | | wd17xx_t *w = get_safe_token(device); |
| 436 | wd1770_state *w = get_safe_token(device); |
| 437 | 437 | |
| 438 | 438 | w->status &= ~STA_2_BUSY; |
| 439 | 439 | |
| r6011 | r6012 | |
| 446 | 446 | static TIMER_CALLBACK( wd17xx_busy_callback ) |
| 447 | 447 | { |
| 448 | 448 | const device_config *device = ptr; |
| 449 | | wd17xx_t *w = get_safe_token(device); |
| 449 | wd1770_state *w = get_safe_token(device); |
| 450 | 450 | wd17xx_set_intrq(device); |
| 451 | 451 | timer_reset(w->busy_timer, attotime_never); |
| 452 | 452 | } |
| r6011 | r6012 | |
| 455 | 455 | |
| 456 | 456 | static void wd17xx_set_busy(const device_config *device, attotime duration) |
| 457 | 457 | { |
| 458 | | wd17xx_t *w = get_safe_token(device); |
| 458 | wd1770_state *w = get_safe_token(device); |
| 459 | 459 | |
| 460 | 460 | w->status |= STA_1_BUSY; |
| 461 | 461 | timer_adjust_oneshot(w->busy_timer, duration, 0); |
| r6011 | r6012 | |
| 467 | 467 | |
| 468 | 468 | static void wd17xx_restore(const device_config *device) |
| 469 | 469 | { |
| 470 | | wd17xx_t *w = get_safe_token(device); |
| 470 | wd1770_state *w = get_safe_token(device); |
| 471 | 471 | UINT8 step_counter; |
| 472 | 472 | |
| 473 | 473 | if (w->drive == NULL) |
| r6011 | r6012 | |
| 515 | 515 | /* track writing, converted to format commands */ |
| 516 | 516 | static void write_track(const device_config *device) |
| 517 | 517 | { |
| 518 | | wd17xx_t *w = get_safe_token(device); |
| 518 | wd1770_state *w = get_safe_token(device); |
| 519 | 519 | int i; |
| 520 | 520 | for (i=0;i+4<w->data_offset;) |
| 521 | 521 | { |
| r6011 | r6012 | |
| 541 | 541 | /* read an entire track */ |
| 542 | 542 | static void read_track(const device_config *device) |
| 543 | 543 | { |
| 544 | | wd17xx_t *w = get_safe_token(device); |
| 544 | wd1770_state *w = get_safe_token(device); |
| 545 | 545 | #if 0 |
| 546 | 546 | UINT8 *psrc; /* pointer to track format structure */ |
| 547 | 547 | UINT8 *pdst; /* pointer to track buffer */ |
| r6011 | r6012 | |
| 680 | 680 | static void wd17xx_read_id(const device_config *device) |
| 681 | 681 | { |
| 682 | 682 | chrn_id id; |
| 683 | | wd17xx_t *w = get_safe_token(device); |
| 683 | wd1770_state *w = get_safe_token(device); |
| 684 | 684 | |
| 685 | 685 | w->status &= ~(STA_2_CRC_ERR | STA_2_REC_N_FND); |
| 686 | 686 | |
| r6011 | r6012 | |
| 736 | 736 | |
| 737 | 737 | static void wd17xx_index_pulse_callback(const device_config *controller, const device_config *img, int state) |
| 738 | 738 | { |
| 739 | | wd17xx_t *w = get_safe_token(controller); |
| 739 | wd1770_state *w = get_safe_token(controller); |
| 740 | 740 | |
| 741 | 741 | if (img != w->drive) |
| 742 | 742 | return; |
| r6011 | r6012 | |
| 753 | 753 | { |
| 754 | 754 | UINT8 revolution_count; |
| 755 | 755 | chrn_id id; |
| 756 | | wd17xx_t *w = get_safe_token(device); |
| 756 | wd1770_state *w = get_safe_token(device); |
| 757 | 757 | |
| 758 | 758 | revolution_count = 0; |
| 759 | 759 | |
| r6011 | r6012 | |
| 798 | 798 | |
| 799 | 799 | static int wd17xx_find_sector(const device_config *device) |
| 800 | 800 | { |
| 801 | | wd17xx_t *w = get_safe_token(device); |
| 801 | wd1770_state *w = get_safe_token(device); |
| 802 | 802 | if ( wd17xx_locate_sector(device) ) |
| 803 | 803 | { |
| 804 | 804 | return 1; |
| r6011 | r6012 | |
| 820 | 820 | /* read a sector */ |
| 821 | 821 | static void wd17xx_read_sector(const device_config *device) |
| 822 | 822 | { |
| 823 | | wd17xx_t *w = get_safe_token(device); |
| 823 | wd1770_state *w = get_safe_token(device); |
| 824 | 824 | w->data_offset = 0; |
| 825 | 825 | |
| 826 | 826 | /* side compare? */ |
| r6011 | r6012 | |
| 849 | 849 | { |
| 850 | 850 | const device_config *device = ptr; |
| 851 | 851 | int callback_type = param; |
| 852 | | wd17xx_t *w = get_safe_token(device); |
| 852 | wd1770_state *w = get_safe_token(device); |
| 853 | 853 | |
| 854 | 854 | switch(callback_type) { |
| 855 | 855 | case MISCCALLBACK_COMMAND: |
| r6011 | r6012 | |
| 879 | 879 | static void wd17xx_complete_command(const device_config *device, int delay) |
| 880 | 880 | { |
| 881 | 881 | int usecs; |
| 882 | | wd17xx_t *w = get_safe_token(device); |
| 882 | wd1770_state *w = get_safe_token(device); |
| 883 | 883 | |
| 884 | 884 | w->data_count = 0; |
| 885 | 885 | |
| r6011 | r6012 | |
| 905 | 905 | |
| 906 | 906 | static void wd17xx_write_sector(const device_config *device) |
| 907 | 907 | { |
| 908 | | wd17xx_t *w = get_safe_token(device); |
| 908 | wd1770_state *w = get_safe_token(device); |
| 909 | 909 | /* at this point, the disc is write enabled, and data |
| 910 | 910 | * has been transfered into our buffer - now write it to |
| 911 | 911 | * the disc image or to the real disc |
| r6011 | r6012 | |
| 934 | 934 | { |
| 935 | 935 | UINT8 revolution_count; |
| 936 | 936 | chrn_id id; |
| 937 | | wd17xx_t *w = get_safe_token(device); |
| 937 | wd1770_state *w = get_safe_token(device); |
| 938 | 938 | |
| 939 | 939 | revolution_count = 0; |
| 940 | 940 | |
| r6011 | r6012 | |
| 977 | 977 | static TIMER_CALLBACK( wd17xx_read_sector_callback ) |
| 978 | 978 | { |
| 979 | 979 | const device_config *device = ptr; |
| 980 | | wd17xx_t *w = get_safe_token(device); |
| 980 | wd1770_state *w = get_safe_token(device); |
| 981 | 981 | |
| 982 | 982 | /* ok, start that read! */ |
| 983 | 983 | |
| r6011 | r6012 | |
| 999 | 999 | static TIMER_CALLBACK(wd17xx_write_sector_callback) |
| 1000 | 1000 | { |
| 1001 | 1001 | const device_config *device = ptr; |
| 1002 | | wd17xx_t *w = get_safe_token(device); |
| 1002 | wd1770_state *w = get_safe_token(device); |
| 1003 | 1003 | |
| 1004 | 1004 | /* ok, start that write! */ |
| 1005 | 1005 | |
| r6011 | r6012 | |
| 1051 | 1051 | static void wd17xx_timed_data_request(const device_config *device) |
| 1052 | 1052 | { |
| 1053 | 1053 | int usecs; |
| 1054 | | wd17xx_t *w = get_safe_token(device); |
| 1054 | wd1770_state *w = get_safe_token(device); |
| 1055 | 1055 | |
| 1056 | 1056 | usecs = wd17xx_get_datarate_in_us(w->density); |
| 1057 | 1057 | |
| r6011 | r6012 | |
| 1065 | 1065 | static void wd17xx_timed_read_sector_request(const device_config *device) |
| 1066 | 1066 | { |
| 1067 | 1067 | int usecs; |
| 1068 | | wd17xx_t *w = get_safe_token(device); |
| 1068 | wd1770_state *w = get_safe_token(device); |
| 1069 | 1069 | |
| 1070 | 1070 | usecs = w->pause_time; /* How long should we wait? How about 40 micro seconds? */ |
| 1071 | 1071 | |
| r6011 | r6012 | |
| 1079 | 1079 | static void wd17xx_timed_write_sector_request(const device_config *device) |
| 1080 | 1080 | { |
| 1081 | 1081 | int usecs; |
| 1082 | | wd17xx_t *w = get_safe_token(device); |
| 1082 | wd1770_state *w = get_safe_token(device); |
| 1083 | 1083 | |
| 1084 | 1084 | usecs = w->pause_time; /* How long should we wait? How about 40 micro seconds? */ |
| 1085 | 1085 | |
| r6011 | r6012 | |
| 1095 | 1095 | /* use this to determine which drive is controlled by WD */ |
| 1096 | 1096 | void wd17xx_set_drive(const device_config *device, UINT8 drive) |
| 1097 | 1097 | { |
| 1098 | | wd17xx_t *w = get_safe_token(device); |
| 1098 | wd1770_state *w = get_safe_token(device); |
| 1099 | 1099 | |
| 1100 | 1100 | if (VERBOSE) |
| 1101 | 1101 | logerror("wd17xx_set_drive: $%02x\n", drive); |
| r6011 | r6012 | |
| 1106 | 1106 | |
| 1107 | 1107 | void wd17xx_set_side(const device_config *device, UINT8 head) |
| 1108 | 1108 | { |
| 1109 | | wd17xx_t *w = get_safe_token(device); |
| 1109 | wd1770_state *w = get_safe_token(device); |
| 1110 | 1110 | |
| 1111 | 1111 | if (VERBOSE) |
| 1112 | 1112 | { |
| r6011 | r6012 | |
| 1119 | 1119 | |
| 1120 | 1120 | void wd17xx_set_density(const device_config *device, DENSITY density) |
| 1121 | 1121 | { |
| 1122 | | wd17xx_t *w = get_safe_token(device); |
| 1122 | wd1770_state *w = get_safe_token(device); |
| 1123 | 1123 | |
| 1124 | 1124 | if (VERBOSE) |
| 1125 | 1125 | { |
| r6011 | r6012 | |
| 1132 | 1132 | |
| 1133 | 1133 | void wd17xx_set_pause_time(const device_config *device, int usec) |
| 1134 | 1134 | { |
| 1135 | | wd17xx_t *w = get_safe_token(device); |
| 1135 | wd1770_state *w = get_safe_token(device); |
| 1136 | 1136 | w->pause_time = usec; |
| 1137 | 1137 | } |
| 1138 | 1138 | |
| r6011 | r6012 | |
| 1143 | 1143 | |
| 1144 | 1144 | WRITE_LINE_DEVICE_HANDLER( wd17xx_rdy_w ) |
| 1145 | 1145 | { |
| 1146 | | wd17xx_t *w = get_safe_token(device); |
| 1146 | wd1770_state *w = get_safe_token(device); |
| 1147 | 1147 | w->rdy = state; |
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | 1150 | READ_LINE_DEVICE_HANDLER( wd17xx_mo_r ) |
| 1151 | 1151 | { |
| 1152 | | wd17xx_t *w = get_safe_token(device); |
| 1152 | wd1770_state *w = get_safe_token(device); |
| 1153 | 1153 | return w->mo; |
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | 1156 | WRITE_LINE_DEVICE_HANDLER( wd17xx_tr00_w ) |
| 1157 | 1157 | { |
| 1158 | | wd17xx_t *w = get_safe_token(device); |
| 1158 | wd1770_state *w = get_safe_token(device); |
| 1159 | 1159 | w->tr00 = state; |
| 1160 | 1160 | } |
| 1161 | 1161 | |
| 1162 | 1162 | WRITE_LINE_DEVICE_HANDLER( wd17xx_idx_w ) |
| 1163 | 1163 | { |
| 1164 | | wd17xx_t *w = get_safe_token(device); |
| 1164 | wd1770_state *w = get_safe_token(device); |
| 1165 | 1165 | w->idx = state; |
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | 1168 | WRITE_LINE_DEVICE_HANDLER( wd17xx_wprt_w ) |
| 1169 | 1169 | { |
| 1170 | | wd17xx_t *w = get_safe_token(device); |
| 1170 | wd1770_state *w = get_safe_token(device); |
| 1171 | 1171 | w->wprt = state; |
| 1172 | 1172 | } |
| 1173 | 1173 | |
| 1174 | 1174 | READ_LINE_DEVICE_HANDLER( wd17xx_drq_r ) |
| 1175 | 1175 | { |
| 1176 | | wd17xx_t *w = get_safe_token(device); |
| 1176 | wd1770_state *w = get_safe_token(device); |
| 1177 | 1177 | return w->drq; |
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | 1180 | READ_LINE_DEVICE_HANDLER( wd17xx_intrq_r ) |
| 1181 | 1181 | { |
| 1182 | | wd17xx_t *w = get_safe_token(device); |
| 1182 | wd1770_state *w = get_safe_token(device); |
| 1183 | 1183 | return w->intrq; |
| 1184 | 1184 | } |
| 1185 | 1185 | |
| 1186 | 1186 | /* read the FDC status register. This clears IRQ line too */ |
| 1187 | 1187 | READ8_DEVICE_HANDLER( wd17xx_status_r ) |
| 1188 | 1188 | { |
| 1189 | | wd17xx_t *w = get_safe_token(device); |
| 1189 | wd1770_state *w = get_safe_token(device); |
| 1190 | 1190 | int result = w->status; |
| 1191 | 1191 | |
| 1192 | 1192 | wd17xx_clear_intrq(device); |
| r6011 | r6012 | |
| 1243 | 1243 | /* read the FDC track register */ |
| 1244 | 1244 | READ8_DEVICE_HANDLER( wd17xx_track_r ) |
| 1245 | 1245 | { |
| 1246 | | wd17xx_t *w = get_safe_token(device); |
| 1246 | wd1770_state *w = get_safe_token(device); |
| 1247 | 1247 | |
| 1248 | 1248 | if (VERBOSE) |
| 1249 | 1249 | logerror("wd17xx_track_r: $%02X\n", w->track_reg); |
| r6011 | r6012 | |
| 1254 | 1254 | /* read the FDC sector register */ |
| 1255 | 1255 | READ8_DEVICE_HANDLER( wd17xx_sector_r ) |
| 1256 | 1256 | { |
| 1257 | | wd17xx_t *w = get_safe_token(device); |
| 1257 | wd1770_state *w = get_safe_token(device); |
| 1258 | 1258 | |
| 1259 | 1259 | if (VERBOSE) |
| 1260 | 1260 | logerror("wd17xx_sector_r: $%02X\n", w->sector); |
| r6011 | r6012 | |
| 1265 | 1265 | /* read the FDC data register */ |
| 1266 | 1266 | READ8_DEVICE_HANDLER( wd17xx_data_r ) |
| 1267 | 1267 | { |
| 1268 | | wd17xx_t *w = get_safe_token(device); |
| 1268 | wd1770_state *w = get_safe_token(device); |
| 1269 | 1269 | |
| 1270 | 1270 | if (w->data_count >= 1) |
| 1271 | 1271 | { |
| r6011 | r6012 | |
| 1342 | 1342 | /* write the FDC command register */ |
| 1343 | 1343 | WRITE8_DEVICE_HANDLER( wd17xx_command_w ) |
| 1344 | 1344 | { |
| 1345 | | wd17xx_t *w = get_safe_token(device); |
| 1345 | wd1770_state *w = get_safe_token(device); |
| 1346 | 1346 | |
| 1347 | 1347 | floppy_drive_set_motor_state(w->drive, 1); |
| 1348 | 1348 | floppy_drive_set_ready_state(w->drive, 1,0); |
| r6011 | r6012 | |
| 1652 | 1652 | /* write the FDC track register */ |
| 1653 | 1653 | WRITE8_DEVICE_HANDLER( wd17xx_track_w ) |
| 1654 | 1654 | { |
| 1655 | | wd17xx_t *w = get_safe_token(device); |
| 1655 | wd1770_state *w = get_safe_token(device); |
| 1656 | 1656 | |
| 1657 | 1657 | w->track_reg = data; |
| 1658 | 1658 | |
| r6011 | r6012 | |
| 1663 | 1663 | /* write the FDC sector register */ |
| 1664 | 1664 | WRITE8_DEVICE_HANDLER( wd17xx_sector_w ) |
| 1665 | 1665 | { |
| 1666 | | wd17xx_t *w = get_safe_token(device); |
| 1666 | wd1770_state *w = get_safe_token(device); |
| 1667 | 1667 | |
| 1668 | 1668 | w->sector = data; |
| 1669 | 1669 | |
| r6011 | r6012 | |
| 1674 | 1674 | /* write the FDC data register */ |
| 1675 | 1675 | WRITE8_DEVICE_HANDLER( wd17xx_data_w ) |
| 1676 | 1676 | { |
| 1677 | | wd17xx_t *w = get_safe_token(device); |
| 1677 | wd1770_state *w = get_safe_token(device); |
| 1678 | 1678 | |
| 1679 | 1679 | if (w->data_count > 0) |
| 1680 | 1680 | { |
| r6011 | r6012 | |
| 1743 | 1743 | |
| 1744 | 1744 | static DEVICE_START( wd1770 ) |
| 1745 | 1745 | { |
| 1746 | | wd17xx_t *w = get_safe_token(device); |
| 1746 | wd1770_state *w = get_safe_token(device); |
| 1747 | 1747 | |
| 1748 | 1748 | assert(device->static_config != NULL); |
| 1749 | 1749 | |
| r6011 | r6012 | |
| 1772 | 1772 | |
| 1773 | 1773 | static DEVICE_START( wd1771 ) |
| 1774 | 1774 | { |
| 1775 | | wd17xx_t *w = get_safe_token(device); |
| 1775 | wd1770_state *w = get_safe_token(device); |
| 1776 | 1776 | |
| 1777 | 1777 | DEVICE_START_CALL(wd1770); |
| 1778 | 1778 | |
| r6011 | r6012 | |
| 1781 | 1781 | |
| 1782 | 1782 | static DEVICE_START( wd1772 ) |
| 1783 | 1783 | { |
| 1784 | | wd17xx_t *w = get_safe_token(device); |
| 1784 | wd1770_state *w = get_safe_token(device); |
| 1785 | 1785 | |
| 1786 | 1786 | DEVICE_START_CALL(wd1770); |
| 1787 | 1787 | |
| r6011 | r6012 | |
| 1795 | 1795 | |
| 1796 | 1796 | static DEVICE_START( wd1773 ) |
| 1797 | 1797 | { |
| 1798 | | wd17xx_t *w = get_safe_token(device); |
| 1798 | wd1770_state *w = get_safe_token(device); |
| 1799 | 1799 | |
| 1800 | 1800 | DEVICE_START_CALL(wd1770); |
| 1801 | 1801 | |
| r6011 | r6012 | |
| 1809 | 1809 | |
| 1810 | 1810 | static DEVICE_START( wd179x ) |
| 1811 | 1811 | { |
| 1812 | | wd17xx_t *w = get_safe_token(device); |
| 1812 | wd1770_state *w = get_safe_token(device); |
| 1813 | 1813 | |
| 1814 | 1814 | DEVICE_START_CALL(wd1770); |
| 1815 | 1815 | |
| r6011 | r6012 | |
| 1818 | 1818 | |
| 1819 | 1819 | static DEVICE_START( wd1793 ) |
| 1820 | 1820 | { |
| 1821 | | wd17xx_t *w = get_safe_token(device); |
| 1821 | wd1770_state *w = get_safe_token(device); |
| 1822 | 1822 | |
| 1823 | 1823 | DEVICE_START_CALL(wd1770); |
| 1824 | 1824 | |
| r6011 | r6012 | |
| 1827 | 1827 | |
| 1828 | 1828 | static DEVICE_START( wd2793 ) |
| 1829 | 1829 | { |
| 1830 | | wd17xx_t *w = get_safe_token(device); |
| 1830 | wd1770_state *w = get_safe_token(device); |
| 1831 | 1831 | |
| 1832 | 1832 | DEVICE_START_CALL(wd1770); |
| 1833 | 1833 | |
| r6011 | r6012 | |
| 1836 | 1836 | |
| 1837 | 1837 | static DEVICE_START( wd177x ) |
| 1838 | 1838 | { |
| 1839 | | wd17xx_t *w = get_safe_token(device); |
| 1839 | wd1770_state *w = get_safe_token(device); |
| 1840 | 1840 | |
| 1841 | 1841 | DEVICE_START_CALL(wd1770); |
| 1842 | 1842 | |
| r6011 | r6012 | |
| 1845 | 1845 | |
| 1846 | 1846 | static DEVICE_START( mb8877 ) |
| 1847 | 1847 | { |
| 1848 | | wd17xx_t *w = get_safe_token(device); |
| 1848 | wd1770_state *w = get_safe_token(device); |
| 1849 | 1849 | |
| 1850 | 1850 | DEVICE_START_CALL(wd1770); |
| 1851 | 1851 | |
| r6011 | r6012 | |
| 1854 | 1854 | |
| 1855 | 1855 | static DEVICE_RESET( wd1770 ) |
| 1856 | 1856 | { |
| 1857 | | wd17xx_t *w = get_safe_token(device); |
| 1857 | wd1770_state *w = get_safe_token(device); |
| 1858 | 1858 | int i; |
| 1859 | 1859 | |
| 1860 | 1860 | for (i = 0; i < 4; i++) |
| r6011 | r6012 | |
| 1890 | 1890 | static const char DEVTEMPLATE_SOURCE[] = __FILE__; |
| 1891 | 1891 | |
| 1892 | 1892 | #define DEVTEMPLATE_ID(p,s) p##wd1770##s |
| 1893 | | #define DEVTEMPLATE_STATE wd17xx_t |
| 1894 | 1893 | #define DEVTEMPLATE_FEATURES DT_HAS_START | DT_HAS_RESET |
| 1895 | 1894 | #define DEVTEMPLATE_NAME "WD1770" |
| 1896 | 1895 | #define DEVTEMPLATE_FAMILY "WD17xx" |