| Previous | 15994 Revisions | Next |
| r1958 Tuesday 11th March, 2008 at 23:50:43 UTC by Wilbert Pol |
|---|
| Updated WD17xx implementation to pass running_machine around. |
| [src/mess/devices] | coco_fdc.c thomflop.c thomflop.h |
| [src/mess/drivers] | a310.c apf.c atarist.c einstein.c enterp.c exidy.c spectrum.c |
| [src/mess/machine] | 99_dsk.c bbc.c cgenie.c coco.c concept.c coupe.c dgn_beta.c mbee.c msx.c nascom1.c oric.c osborne1.c svi318.c thomson.c trs80.c wd17xx.c wd17xx.h |
| r1957 | r1958 | |
|---|---|---|
| 109 | 109 | fdc_callback - callback from the FDC |
| 110 | 110 | -------------------------------------------------*/ |
| 111 | 111 | |
| 112 | static void fdc_callback(wd17xx_state_t state, void *param) | |
| 112 | static void fdc_callback(running_machine *machine, wd17xx_state_t state, void *param) | |
| 113 | 113 | { |
| 114 | 114 | coco_cartridge *cartridge = (coco_cartridge *) param; |
| 115 | 115 | fdc_info *info = fdc_get_info(cartridge); |
| r1957 | r1958 | |
| 155 | 155 | info->drq = initial_drq ? 1 : 0; |
| 156 | 156 | |
| 157 | 157 | /* initialize FDC */ |
| 158 | wd17xx_init(type, fdc_callback, (void *) cartridge); | |
| 158 | wd17xx_init(Machine, type, fdc_callback, (void *) cartridge); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 |
| r1957 | r1958 | |
|---|---|---|
| 349 | 349 | |
| 350 | 350 | |
| 351 | 351 | |
| 352 | static void to7_5p14_init( | |
| 352 | static void to7_5p14_init( running_machine *machine ) | |
| 353 | 353 | { |
| 354 | 354 | LOG(( "to7_5p14_init: CD 90-640 controller\n" )); |
| 355 | wd17xx_init( WD_TYPE_2793, NULL, NULL ); | |
| 355 | wd17xx_init( machine, WD_TYPE_2793, NULL, NULL ); | |
| 356 | 356 | state_save_register_global( to7_5p14_select ); |
| 357 | 357 | } |
| 358 | 358 | |
| r1957 | r1958 | |
| 1758 | 1758 | UINT8 to7_floppy_bank; |
| 1759 | 1759 | |
| 1760 | 1760 | |
| 1761 | void to7_floppy_init ( void* base ) | |
| 1761 | void to7_floppy_init ( running_machine *machine, void* base ) | |
| 1762 | 1762 | { |
| 1763 | 1763 | memory_configure_bank( THOM_FLOP_BANK, 0, TO7_NB_FLOP_BANK, base, 0x800 ); |
| 1764 | 1764 | state_save_register_global( to7_controller_type ); |
| 1765 | 1765 | state_save_register_global( to7_floppy_bank ); |
| 1766 | 1766 | to7_5p14sd_init(); |
| 1767 | to7_5p14_init(); | |
| 1767 | to7_5p14_init(machine); | |
| 1768 | 1768 | to7_qdd_init(); |
| 1769 | 1769 | thmfc_floppy_init(); |
| 1770 | 1770 | to7_network_init(); |
| r1957 | r1958 | |
| 1884 | 1884 | |
| 1885 | 1885 | |
| 1886 | 1886 | |
| 1887 | void to9_floppy_init( void* int_base, void* ext_base ) | |
| 1887 | void to9_floppy_init( running_machine *machine, void* int_base, void* ext_base ) | |
| 1888 | 1888 | { |
| 1889 | to7_floppy_init( ext_base ); | |
| 1889 | to7_floppy_init( machine, ext_base ); | |
| 1890 | 1890 | memory_configure_bank( THOM_FLOP_BANK, TO7_NB_FLOP_BANK, 1, int_base, 0x800 ); |
| 1891 | 1891 | } |
| 1892 | 1892 |
| r1957 | r1958 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /* external controllers */ |
| 30 | extern void to7_floppy_init ( void* base ); | |
| 30 | extern void to7_floppy_init ( running_machine *machine, void* base ); | |
| 31 | 31 | extern void to7_floppy_reset ( void ); |
| 32 | 32 | extern READ8_HANDLER ( to7_floppy_r ); |
| 33 | 33 | extern WRITE8_HANDLER ( to7_floppy_w ); |
| 34 | 34 | |
| 35 | 35 | /* TO9 internal (WD2793) & external controllers */ |
| 36 | extern void to9_floppy_init ( void* int_base, void* ext_base ); | |
| 36 | extern void to9_floppy_init ( running_machine *machine, void* int_base, void* ext_base ); | |
| 37 | 37 | extern void to9_floppy_reset ( void ); |
| 38 | 38 | extern READ8_HANDLER ( to9_floppy_r ); |
| 39 | 39 | extern WRITE8_HANDLER ( to9_floppy_w ); |
| r1957 | r1958 | |
|---|---|---|
| 901 | 901 | /* Dragon Beta onboard FDC */ |
| 902 | 902 | /********************************************************************************************/ |
| 903 | 903 | |
| 904 | static void dgnbeta_fdc_callback(wd17xx_state_t event, void *param) | |
| 904 | static void dgnbeta_fdc_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 905 | 905 | { |
| 906 | running_machine *machine = Machine; | |
| 907 | 906 | /* The INTRQ line goes through pia2 ca1, in exactly the same way as DRQ from DragonDos does */ |
| 908 | 907 | /* DRQ is routed through various logic to the FIRQ inturrupt line on *BOTH* CPUs */ |
| 909 | 908 | |
| r1957 | r1958 | |
| 1100 | 1099 | |
| 1101 | 1100 | init_video(machine); |
| 1102 | 1101 | |
| 1103 | wd17xx_init(WD_TYPE_179X,dgnbeta_fdc_callback, NULL); | |
| 1102 | wd17xx_init(machine, WD_TYPE_179X,dgnbeta_fdc_callback, NULL); | |
| 1104 | 1103 | #ifdef ENABLE_DEBUGGER |
| 1105 | 1104 | cpuintrf_set_dasm_override(0,dgnbeta_dasm_override); |
| 1106 | 1105 | #endif /* ENABLE_DEBUGGER */ |
| r1957 | r1958 | |
|---|---|---|
| 31 | 31 | static UINT8 fdc_den = 0; |
| 32 | 32 | static UINT8 fdc_status = 0; |
| 33 | 33 | static void pio_interrupt(int state); |
| 34 | static void mbee_fdc_callback(wd17xx_state_t event, void *param); | |
| 34 | static void mbee_fdc_callback(running_machine *machine, wd17xx_state_t event, void *param); | |
| 35 | 35 | |
| 36 | 36 | UINT8 *mbee_workram; |
| 37 | 37 | |
| r1957 | r1958 | |
| 69 | 69 | |
| 70 | 70 | MACHINE_START( mbee ) |
| 71 | 71 | { |
| 72 | wd17xx_init(WD_TYPE_179X,mbee_fdc_callback, NULL); | |
| 72 | wd17xx_init(machine, WD_TYPE_179X,mbee_fdc_callback, NULL); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static mess_image *cassette_device_image(void) |
| r1957 | r1958 | |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | static void mbee_fdc_callback(wd17xx_state_t state, void *param) | |
| 117 | static void mbee_fdc_callback(running_machine *machine, wd17xx_state_t state, void *param) | |
| 118 | 118 | { |
| 119 | 119 | switch( state ) |
| 120 | 120 | { |
| r1957 | r1958 | |
|---|---|---|
| 1574 | 1574 | /* Dragon Alpha onboard FDC */ |
| 1575 | 1575 | /********************************************************************************************/ |
| 1576 | 1576 | |
| 1577 | static void dgnalpha_fdc_callback(wd17xx_state_t event, void *param) | |
| 1577 | static void dgnalpha_fdc_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 1578 | 1578 | { |
| 1579 | running_machine *machine = Machine; | |
| 1580 | ||
| 1581 | 1579 | /* The NMI line on the alphaAlpha is gated through IC16 (early PLD), and is gated by pia2 CA2 */ |
| 1582 | 1580 | /* The DRQ line goes through pia2 cb1, in exactly the same way as DRQ from DragonDos does */ |
| 1583 | 1581 | /* for pia1 cb1 */ |
| r1957 | r1958 | |
| 2947 | 2945 | /* by the WD2797, it is reset to 0 after the first inurrupt */ |
| 2948 | 2946 | dgnalpha_just_reset=1; |
| 2949 | 2947 | |
| 2950 | wd17xx_init(WD_TYPE_179X, dgnalpha_fdc_callback, NULL); | |
| 2948 | wd17xx_init(machine, WD_TYPE_179X, dgnalpha_fdc_callback, NULL); | |
| 2951 | 2949 | } |
| 2952 | 2950 | |
| 2953 | 2951 | /******* Machine Setups CoCos **********/ |
| r1957 | r1958 | |
|---|---|---|
| 568 | 568 | LC_FMMFM_mask = (1 << LC_FMMFM_bit) |
| 569 | 569 | }; |
| 570 | 570 | |
| 571 | static void fdc_callback(wd17xx_state_t event, void *param); | |
| 571 | static void fdc_callback(running_machine *machine, wd17xx_state_t event, void *param); | |
| 572 | 572 | |
| 573 | 573 | static READ8_HANDLER(concept_fdc_reg_r); |
| 574 | 574 | static WRITE8_HANDLER(concept_fdc_reg_w); |
| r1957 | r1958 | |
| 579 | 579 | fdc_local_status = 0; |
| 580 | 580 | fdc_local_command = 0; |
| 581 | 581 | |
| 582 | wd17xx_init(WD_TYPE_179X, fdc_callback, NULL); | |
| 582 | wd17xx_init(Machine, WD_TYPE_179X, fdc_callback, NULL); | |
| 583 | 583 | |
| 584 | 584 | install_expansion_slot(slot, concept_fdc_reg_r, concept_fdc_reg_w, concept_fdc_rom_r, NULL); |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | static void fdc_callback(wd17xx_state_t event, void *param) | |
| 587 | static void fdc_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 588 | 588 | { |
| 589 | 589 | switch (event) |
| 590 | 590 | { |
| r1957 | r1958 | |
|---|---|---|
| 368 | 368 | /* |
| 369 | 369 | callback called whenever DRQ/IRQ state change |
| 370 | 370 | */ |
| 371 | static void fdc_callback(wd17xx_state_t event, void *param) | |
| 371 | static void fdc_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 372 | 372 | { |
| 373 | 373 | switch (event) |
| 374 | 374 | { |
| r1957 | r1958 | |
| 399 | 399 | void ti99_floppy_controllers_init_all(void) |
| 400 | 400 | { |
| 401 | 401 | /* initialize the controller chip for TI FDC, CC, BwG */ |
| 402 | wd17xx_init(WD_TYPE_179X, fdc_callback, NULL); | |
| 402 | wd17xx_init(Machine, WD_TYPE_179X, fdc_callback, NULL); | |
| 403 | 403 | |
| 404 | 404 | /* initialize the controller chip for HFDC */ |
| 405 | 405 | smc92x4_init(0, & hfdc_intf); |
| r1957 | r1958 | |
| 418 | 418 | */ |
| 419 | 419 | |
| 420 | 420 | /* prototypes */ |
| 421 | static void fdc_callback(wd17xx_state_t event, void *param); | |
| 421 | static void fdc_callback(running_machine *machine, wd17xx_state_t event, void *param); | |
| 422 | 422 | static TIMER_CALLBACK(motor_on_timer_callback); |
| 423 | 423 | static int fdc_cru_r(running_machine *machine, int offset); |
| 424 | 424 | static void fdc_cru_w(running_machine *machine, int offset, int data); |
| r1957 | r1958 | |
|---|---|---|
| 313 | 313 | msx_ch_reset_core (); |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | static void msx_wd179x_int (wd17xx_state_t state, void *param); | |
| 316 | static void msx_wd179x_int (running_machine *machine, wd17xx_state_t state, void *param); | |
| 317 | 317 | |
| 318 | 318 | static WRITE8_HANDLER ( msx_ppi_port_a_w ); |
| 319 | 319 | static WRITE8_HANDLER ( msx_ppi_port_c_w ); |
| r1957 | r1958 | |
| 349 | 349 | msx1.cart_state[i] = cart_state[i]; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | wd17xx_init (WD_TYPE_179X, msx_wd179x_int, NULL); | |
| 352 | wd17xx_init (Machine, WD_TYPE_179X, msx_wd179x_int, NULL); | |
| 353 | 353 | wd17xx_set_density (DEN_FM_HI); |
| 354 | 354 | msx1.dsk_stat = 0x7f; |
| 355 | 355 | |
| r1957 | r1958 | |
| 644 | 644 | |
| 645 | 645 | */ |
| 646 | 646 | |
| 647 | static void msx_wd179x_int (wd17xx_state_t state, void *param) | |
| 647 | static void msx_wd179x_int (running_machine *machine, wd17xx_state_t state, void *param) | |
| 648 | 648 | { |
| 649 | 649 | switch (state) |
| 650 | 650 | { |
| r1957 | r1958 | |
|---|---|---|
| 1293 | 1293 | pia_config( THOM_PIA_SYS, &to7_sys ); |
| 1294 | 1294 | mc6846_config( &to7_timer ); |
| 1295 | 1295 | to7_game_init(); |
| 1296 | to7_floppy_init( mem + 0x20000 ); | |
| 1296 | to7_floppy_init( machine, mem + 0x20000 ); | |
| 1297 | 1297 | to7_io_init(); |
| 1298 | 1298 | to7_modem_init(); |
| 1299 | 1299 | to7_midi_init(); |
| r1957 | r1958 | |
| 1526 | 1526 | pia_config( THOM_PIA_SYS, &to770_sys ); |
| 1527 | 1527 | mc6846_config( &to770_timer ); |
| 1528 | 1528 | to7_game_init(); |
| 1529 | to7_floppy_init( mem + 0x20000 ); | |
| 1529 | to7_floppy_init( machine, mem + 0x20000 ); | |
| 1530 | 1530 | to7_io_init(); |
| 1531 | 1531 | to7_modem_init(); |
| 1532 | 1532 | to7_midi_init(); |
| r1957 | r1958 | |
| 1873 | 1873 | thom_irq_init(); |
| 1874 | 1874 | pia_config( THOM_PIA_SYS, &mo5_sys ); |
| 1875 | 1875 | to7_game_init(); |
| 1876 | to7_floppy_init( mem + 0x20000 ); | |
| 1876 | to7_floppy_init( machine, mem + 0x20000 ); | |
| 1877 | 1877 | to7_io_init(); |
| 1878 | 1878 | to7_modem_init(); |
| 1879 | 1879 | to7_midi_init(); |
| r1957 | r1958 | |
| 2814 | 2814 | centronics_config( 0, &to9_centronics ); |
| 2815 | 2815 | mc6846_config( &to9_timer ); |
| 2816 | 2816 | to7_game_init(); |
| 2817 | to9_floppy_init( mem + 0xe000, mem + 0x40000 ); | |
| 2817 | to9_floppy_init( machine, mem + 0xe000, mem + 0x40000 ); | |
| 2818 | 2818 | to9_kbd_init(); |
| 2819 | 2819 | to9_palette_init(); |
| 2820 | 2820 | to7_modem_init(); |
| r1957 | r1958 | |
| 3343 | 3343 | |
| 3344 | 3344 | |
| 3345 | 3345 | |
| 3346 | static void to8_floppy_init( | |
| 3346 | static void to8_floppy_init( running_machine *machine ) | |
| 3347 | 3347 | { |
| 3348 | 3348 | UINT8* mem = memory_region(REGION_CPU1); |
| 3349 | to7_floppy_init( mem + 0x34000 ); | |
| 3349 | to7_floppy_init( machine, mem + 0x34000 ); | |
| 3350 | 3350 | } |
| 3351 | 3351 | |
| 3352 | 3352 | |
| r1957 | r1958 | |
| 3750 | 3750 | centronics_config( 0, &to9_centronics ); |
| 3751 | 3751 | mc6846_config( &to8_timer ); |
| 3752 | 3752 | to7_game_init(); |
| 3753 | to8_floppy_init(); | |
| 3753 | to8_floppy_init( machine ); | |
| 3754 | 3754 | to8_kbd_init(); |
| 3755 | 3755 | to9_palette_init(); |
| 3756 | 3756 | to7_modem_init(); |
| r1957 | r1958 | |
| 3912 | 3912 | centronics_config( 0, &to9_centronics ); |
| 3913 | 3913 | mc6846_config( &to9p_timer ); |
| 3914 | 3914 | to7_game_init(); |
| 3915 | to8_floppy_init(); | |
| 3915 | to8_floppy_init( machine ); | |
| 3916 | 3916 | to9_kbd_init(); |
| 3917 | 3917 | to9_palette_init(); |
| 3918 | 3918 | to7_modem_init(); |
| r1957 | r1958 | |
| 4479 | 4479 | pia_config( THOM_PIA_SYS, &mo6_sys ); |
| 4480 | 4480 | centronics_config( 0, &to9_centronics ); |
| 4481 | 4481 | mo6_game_init(); |
| 4482 | to7_floppy_init( mem + 0x30000 ); | |
| 4482 | to7_floppy_init( machine, mem + 0x30000 ); | |
| 4483 | 4483 | to9_palette_init(); |
| 4484 | 4484 | to7_modem_init(); |
| 4485 | 4485 | to7_midi_init(); |
| r1957 | r1958 | |
| 4746 | 4746 | pia_config( THOM_PIA_SYS, &mo5nr_sys ); |
| 4747 | 4747 | centronics_config( 0, &to9_centronics ); |
| 4748 | 4748 | mo5nr_game_init(); |
| 4749 | to7_floppy_init( mem + 0x30000 ); | |
| 4749 | to7_floppy_init( machine, mem + 0x30000 ); | |
| 4750 | 4750 | to9_palette_init(); |
| 4751 | 4751 | to7_modem_init(); |
| 4752 | 4752 | to7_midi_init(); |
| r1957 | r1958 | |
|---|---|---|
| 212 | 212 | return address; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | static void cgenie_fdc_callback(wd17xx_state_t event, void *param); | |
| 215 | static void cgenie_fdc_callback(running_machine *machine, wd17xx_state_t event, void *param); | |
| 216 | 216 | |
| 217 | 217 | MACHINE_RESET( cgenie ) |
| 218 | 218 | { |
| r1957 | r1958 | |
| 332 | 332 | memory_set_bankptr(1, mess_ram); |
| 333 | 333 | |
| 334 | 334 | /* set up FDC */ |
| 335 | wd17xx_init(WD_TYPE_179X, cgenie_fdc_callback, NULL); | |
| 335 | wd17xx_init(machine, WD_TYPE_179X, cgenie_fdc_callback, NULL); | |
| 336 | 336 | |
| 337 | 337 | add_exit_callback(machine, tape_put_close); |
| 338 | 338 | } |
| r1957 | r1958 | |
| 984 | 984 | } |
| 985 | 985 | } |
| 986 | 986 | |
| 987 | void cgenie_fdc_callback(wd17xx_state_t event, void *param) | |
| 987 | void cgenie_fdc_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 988 | 988 | { |
| 989 | 989 | /* if disc hardware is not enabled, do not cause an int */ |
| 990 | 990 | if (!( readinputport(0) & 0x80 )) |
| r1957 | r1958 | |
| 996 | 996 | irq_status &= ~IRQ_FDC; |
| 997 | 997 | break; |
| 998 | 998 | case WD17XX_IRQ_SET: |
| 999 | cgenie_fdc_interrupt( | |
| 999 | cgenie_fdc_interrupt(machine, 0); | |
| 1000 | 1000 | break; |
| 1001 | 1001 | case WD17XX_DRQ_CLR: |
| 1002 | 1002 | case WD17XX_DRQ_SET: |
| r1957 | r1958 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | UINT8 *oric_ram; |
| 37 | 37 | |
| 38 | static int enable_logging = | |
| 38 | static int enable_logging = 1; | |
| 39 | 39 | /* static int save_done = 0; */ |
| 40 | 40 | |
| 41 | 41 | |
| r1957 | r1958 | |
| 1060 | 1060 | /*********************************************************/ |
| 1061 | 1061 | |
| 1062 | 1062 | |
| 1063 | static void oric_wd179x_callback(wd17xx_state_t State, void *param) | |
| 1063 | static void oric_wd179x_callback(running_machine *machine, wd17xx_state_t State, void *param) | |
| 1064 | 1064 | { |
| 1065 | 1065 | switch (readinputport(9) & 0x07) |
| 1066 | 1066 | { |
| r1957 | r1958 | |
| 1131 | 1131 | |
| 1132 | 1132 | oric_ram_0x0c000 = auto_malloc(16384); |
| 1133 | 1133 | |
| 1134 | wd17xx_init(WD_TYPE_179X,oric_wd179x_callback, NULL); | |
| 1134 | wd17xx_init(machine, WD_TYPE_179X,oric_wd179x_callback, NULL); | |
| 1135 | 1135 | } |
| 1136 | 1136 | |
| 1137 | 1137 | |
| r1957 | r1958 | |
| 1521 | 1521 | via_config(1, &telestrat_via2_interface); |
| 1522 | 1522 | via_set_clock(1,1000000); |
| 1523 | 1523 | |
| 1524 | wd17xx_init(WD_TYPE_179X,oric_wd179x_callback, NULL); | |
| 1524 | wd17xx_init(machine, WD_TYPE_179X,oric_wd179x_callback, NULL); | |
| 1525 | 1525 | } |
| r1957 | r1958 | |
|---|---|---|
| 55 | 55 | * |
| 56 | 56 | *************************************/ |
| 57 | 57 | |
| 58 | static void nascom2_fdc_callback(wd17xx_state_t event, void *param) | |
| 58 | static void nascom2_fdc_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 59 | 59 | { |
| 60 | 60 | switch (event) |
| 61 | 61 | { |
| r1957 | r1958 | |
| 302 | 302 | break; |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | wd17xx_init(WD_TYPE_1793, nascom2_fdc_callback, NULL); | |
| 305 | wd17xx_init(machine, WD_TYPE_1793, nascom2_fdc_callback, NULL); | |
| 306 | 306 | } |
| r1957 | r1958 | |
|---|---|---|
| 456 | 456 | // acia6850_config( 0, &osborne1_6850_config ); |
| 457 | 457 | |
| 458 | 458 | /* Configure the floppy disk interface */ |
| 459 | wd17xx_init( WD_TYPE_MB8877, NULL, NULL ); | |
| 459 | wd17xx_init( machine, WD_TYPE_MB8877, NULL, NULL ); | |
| 460 | 460 | } |
| 461 | 461 |
| r1957 | r1958 | |
|---|---|---|
| 142 | 142 | typedef struct _wd17xx_info wd17xx_info; |
| 143 | 143 | struct _wd17xx_info |
| 144 | 144 | { |
| 145 | void (*callback)(wd17xx_state_t event, void *param); /* callback for IRQ status */ | |
| 145 | void (*callback)(running_machine *, wd17xx_state_t event, void *param); /* callback for IRQ status */ | |
| 146 | 146 | void *callback_param; |
| 147 | 147 | DENSITY density; /* FM/MFM, single / double density */ |
| 148 | 148 | wd17xx_type_t type; |
| r1957 | r1958 | |
| 242 | 242 | ***************************************************************************/ |
| 243 | 243 | |
| 244 | 244 | static void wd17xx_complete_command(wd17xx_info *, int delay); |
| 245 | static void wd17xx_clear_data_request(void); | |
| 246 | static void wd17xx_set_data_request(void); | |
| 245 | static void wd17xx_clear_data_request(running_machine *); | |
| 246 | static void wd17xx_set_data_request(running_machine *); | |
| 247 | 247 | static void wd17xx_timed_data_request(void); |
| 248 | static void wd17xx_set_irq(wd17xx_info *); | |
| 248 | static void wd17xx_set_irq(running_machine *, wd17xx_info *); | |
| 249 | 249 | static emu_timer *busy_timer = NULL; |
| 250 | 250 | |
| 251 | 251 | /* one wd controlling multiple drives */ |
| r1957 | r1958 | |
| 304 | 304 | static TIMER_CALLBACK(wd17xx_busy_callback) |
| 305 | 305 | { |
| 306 | 306 | wd17xx_info *info = (wd17xx_info *) ptr; |
| 307 | wd17xx_set_irq(info); | |
| 307 | wd17xx_set_irq(machine, info); | |
| 308 | 308 | timer_reset(busy_timer, attotime_never); |
| 309 | 309 | } |
| 310 | 310 | |
| r1957 | r1958 | |
| 387 | 387 | |
| 388 | 388 | |
| 389 | 389 | |
| 390 | void wd17xx_init(wd17xx_type_t type, void (*callback)(wd17xx_state_t, void *), void *param) | |
| 390 | void wd17xx_init(running_machine *machine, wd17xx_type_t type, void (*callback)(running_machine *, wd17xx_state_t, void *), void *param) | |
| 391 | 391 | { |
| 392 | assert_always(mame_get_phase( | |
| 392 | assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call wd17xx_init at init time!"); | |
| 393 | 393 | |
| 394 | 394 | memset(&wd, 0, sizeof(wd)); |
| 395 | 395 | wd.status = STA_1_TRACK0; |
| r1957 | r1958 | |
| 436 | 436 | |
| 437 | 437 | |
| 438 | 438 | /* read an entire track */ |
| 439 | static void read_track(wd17xx_info * w) | |
| 439 | static void read_track(running_machine *machine, wd17xx_info * w) | |
| 440 | 440 | { |
| 441 | 441 | #if 0 |
| 442 | 442 | UINT8 *psrc; /* pointer to track format structure */ |
| r1957 | r1958 | |
| 563 | 563 | |
| 564 | 564 | w->data_offset = 0; |
| 565 | 565 | |
| 566 | wd17xx_set_data_request(); | |
| 566 | wd17xx_set_data_request(machine); | |
| 567 | 567 | w->status |= STA_2_BUSY; |
| 568 | 568 | w->busy_count = 0; |
| 569 | 569 | } |
| r1957 | r1958 | |
| 596 | 596 | |
| 597 | 597 | |
| 598 | 598 | /* read the next data address mark */ |
| 599 | static void wd17xx_read_id(wd17xx_info * w) | |
| 599 | static void wd17xx_read_id(running_machine *machine, wd17xx_info * w) | |
| 600 | 600 | { |
| 601 | 601 | chrn_id id; |
| 602 | 602 | |
| r1957 | r1958 | |
| 634 | 634 | w->status |= STA_2_BUSY; |
| 635 | 635 | w->busy_count = 0; |
| 636 | 636 | |
| 637 | wd17xx_set_data_request(); | |
| 637 | wd17xx_set_data_request(machine); | |
| 638 | 638 | |
| 639 | 639 | logerror("read id succeeded.\n"); |
| 640 | 640 | } |
| r1957 | r1958 | |
| 761 | 761 | |
| 762 | 762 | |
| 763 | 763 | |
| 764 | static void wd17xx_callback(wd17xx_info *w, wd17xx_state_t state) | |
| 764 | static void wd17xx_callback(running_machine *machine, wd17xx_info *w, wd17xx_state_t state) | |
| 765 | 765 | { |
| 766 | 766 | if (w->callback) |
| 767 | (*w->callback)(state, w->callback_param); | |
| 767 | (*w->callback)(machine, state, w->callback_param); | |
| 768 | 768 | } |
| 769 | 769 | |
| 770 | 770 | |
| 771 | 771 | |
| 772 | static void wd17xx_set_irq(wd17xx_info *w) | |
| 772 | static void wd17xx_set_irq(running_machine *machine, wd17xx_info *w) | |
| 773 | 773 | { |
| 774 | 774 | w->status &= ~STA_2_BUSY; |
| 775 | 775 | /* generate an IRQ */ |
| 776 | wd17xx_callback(w, WD17XX_IRQ_SET); | |
| 776 | wd17xx_callback(machine, w, WD17XX_IRQ_SET); | |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | 779 | |
| r1957 | r1958 | |
| 795 | 795 | switch(callback_type) { |
| 796 | 796 | case MISCCALLBACK_COMMAND: |
| 797 | 797 | /* command callback */ |
| 798 | wd17xx_set_irq(w); | |
| 798 | wd17xx_set_irq(machine, w); | |
| 799 | 799 | break; |
| 800 | 800 | |
| 801 | 801 | case MISCCALLBACK_DATA: |
| 802 | 802 | /* data callback */ |
| 803 | 803 | /* ok, trigger data request now */ |
| 804 | wd17xx_set_data_request(); | |
| 804 | wd17xx_set_data_request(machine); | |
| 805 | 805 | break; |
| 806 | 806 | } |
| 807 | 807 | |
| r1957 | r1958 | |
| 902 | 902 | |
| 903 | 903 | |
| 904 | 904 | /* clear a data request */ |
| 905 | static void wd17xx_clear_data_request( | |
| 905 | static void wd17xx_clear_data_request(running_machine *machine) | |
| 906 | 906 | { |
| 907 | 907 | wd17xx_info *w = &wd; |
| 908 | 908 | |
| 909 | 909 | // w->status_drq = 0; |
| 910 | wd17xx_callback(w, WD17XX_DRQ_CLR); | |
| 910 | wd17xx_callback(machine, w, WD17XX_DRQ_CLR); | |
| 911 | 911 | w->status &= ~STA_2_DRQ; |
| 912 | 912 | } |
| 913 | 913 | |
| 914 | 914 | |
| 915 | 915 | |
| 916 | 916 | /* set data request */ |
| 917 | static void wd17xx_set_data_request( | |
| 917 | static void wd17xx_set_data_request(running_machine *machine) | |
| 918 | 918 | { |
| 919 | 919 | wd17xx_info *w = &wd; |
| 920 | 920 | |
| r1957 | r1958 | |
| 926 | 926 | |
| 927 | 927 | /* set drq */ |
| 928 | 928 | // w->status_drq = STA_2_DRQ; |
| 929 | wd17xx_callback(w, WD17XX_DRQ_SET); | |
| 929 | wd17xx_callback(machine, w, WD17XX_DRQ_SET); | |
| 930 | 930 | w->status |= STA_2_DRQ; |
| 931 | 931 | } |
| 932 | 932 | |
| r1957 | r1958 | |
| 990 | 990 | w->data_offset = 0; |
| 991 | 991 | w->data_count = w->sector_length; |
| 992 | 992 | |
| 993 | wd17xx_set_data_request(); | |
| 993 | wd17xx_set_data_request(machine); | |
| 994 | 994 | |
| 995 | 995 | w->status |= STA_2_BUSY; |
| 996 | 996 | w->busy_count = 0; |
| r1957 | r1958 | |
| 1052 | 1052 | wd17xx_info *w = &wd; |
| 1053 | 1053 | int result = w->status; |
| 1054 | 1054 | |
| 1055 | wd17xx_callback(w, WD17XX_IRQ_CLR); | |
| 1055 | wd17xx_callback(machine, w, WD17XX_IRQ_CLR); | |
| 1056 | 1056 | // if (w->busy_count) |
| 1057 | 1057 | // { |
| 1058 | 1058 | // if (!--w->busy_count) |
| r1957 | r1958 | |
| 1135 | 1135 | if (w->data_count >= 1) |
| 1136 | 1136 | { |
| 1137 | 1137 | /* clear data request */ |
| 1138 | wd17xx_clear_data_request(); | |
| 1138 | wd17xx_clear_data_request(machine); | |
| 1139 | 1139 | |
| 1140 | 1140 | /* yes */ |
| 1141 | 1141 | w->data = w->buffer[w->data_offset++]; |
| r1957 | r1958 | |
| 1210 | 1210 | floppy_drive_set_motor_state(wd17xx_current_image(), 1); |
| 1211 | 1211 | floppy_drive_set_ready_state(wd17xx_current_image(), 1,0); |
| 1212 | 1212 | /* also cleared by writing command */ |
| 1213 | wd17xx_callback(w, WD17XX_IRQ_CLR); | |
| 1213 | wd17xx_callback(machine, w, WD17XX_IRQ_CLR); | |
| 1214 | 1214 | |
| 1215 | 1215 | /* clear write protected. On read sector, read track and read dam, write protected bit is clear */ |
| 1216 | 1216 | w->status &= ~((1<<6) | (1<<5) | (1<<4)); |
| r1957 | r1958 | |
| 1224 | 1224 | w->data_offset = 0; |
| 1225 | 1225 | w->status &= ~(STA_2_BUSY); |
| 1226 | 1226 | |
| 1227 | wd17xx_clear_data_request(); | |
| 1227 | wd17xx_clear_data_request(machine); | |
| 1228 | 1228 | |
| 1229 | 1229 | if (data & 0x0f) |
| 1230 | 1230 | { |
| r1957 | r1958 | |
| 1255 | 1255 | w->command = data & ~FDC_MASK_TYPE_II; |
| 1256 | 1256 | w->command_type = TYPE_II; |
| 1257 | 1257 | w->status &= ~STA_2_LOST_DAT; |
| 1258 | wd17xx_clear_data_request(); | |
| 1258 | wd17xx_clear_data_request(machine); | |
| 1259 | 1259 | |
| 1260 | 1260 | wd17xx_timed_read_sector_request(); |
| 1261 | 1261 | |
| r1957 | r1958 | |
| 1271 | 1271 | w->command = data & ~FDC_MASK_TYPE_II; |
| 1272 | 1272 | w->command_type = TYPE_II; |
| 1273 | 1273 | w->status &= ~STA_2_LOST_DAT; |
| 1274 | wd17xx_clear_data_request(); | |
| 1274 | wd17xx_clear_data_request(machine); | |
| 1275 | 1275 | |
| 1276 | 1276 | wd17xx_timed_write_sector_request(); |
| 1277 | 1277 | |
| r1957 | r1958 | |
| 1286 | 1286 | w->command = data & ~FDC_MASK_TYPE_III; |
| 1287 | 1287 | w->command_type = TYPE_III; |
| 1288 | 1288 | w->status &= ~STA_2_LOST_DAT; |
| 1289 | wd17xx_clear_data_request(); | |
| 1289 | wd17xx_clear_data_request(machine); | |
| 1290 | 1290 | #if 1 |
| 1291 | 1291 | // w->status = seek(w, w->track, w->head, w->sector); |
| 1292 | 1292 | if (w->status == 0) |
| 1293 | read_track(w); | |
| 1293 | read_track(machine, w); | |
| 1294 | 1294 | #endif |
| 1295 | 1295 | return; |
| 1296 | 1296 | } |
| r1957 | r1958 | |
| 1302 | 1302 | |
| 1303 | 1303 | w->command_type = TYPE_III; |
| 1304 | 1304 | w->status &= ~STA_2_LOST_DAT; |
| 1305 | wd17xx_clear_data_request(); | |
| 1305 | wd17xx_clear_data_request(machine); | |
| 1306 | 1306 | |
| 1307 | 1307 | if (!floppy_drive_get_flag_state(wd17xx_current_image(), FLOPPY_DRIVE_READY)) |
| 1308 | 1308 | { |
| r1957 | r1958 | |
| 1324 | 1324 | w->command = data & ~FDC_MASK_TYPE_III; |
| 1325 | 1325 | w->data_offset = 0; |
| 1326 | 1326 | w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD; |
| 1327 | wd17xx_set_data_request(); | |
| 1327 | wd17xx_set_data_request(machine); | |
| 1328 | 1328 | |
| 1329 | 1329 | w->status |= STA_2_BUSY; |
| 1330 | 1330 | w->busy_count = 0; |
| r1957 | r1958 | |
| 1340 | 1340 | |
| 1341 | 1341 | w->command_type = TYPE_III; |
| 1342 | 1342 | w->status &= ~STA_2_LOST_DAT; |
| 1343 | wd17xx_clear_data_request(); | |
| 1343 | wd17xx_clear_data_request(machine); | |
| 1344 | 1344 | |
| 1345 | 1345 | if (!floppy_drive_get_flag_state(wd17xx_current_image(), FLOPPY_DRIVE_READY)) |
| 1346 | 1346 | { |
| r1957 | r1958 | |
| 1348 | 1348 | } |
| 1349 | 1349 | else |
| 1350 | 1350 | { |
| 1351 | wd17xx_read_id(w); | |
| 1351 | wd17xx_read_id(machine, w); | |
| 1352 | 1352 | } |
| 1353 | 1353 | return; |
| 1354 | 1354 | } |
| r1957 | r1958 | |
| 1540 | 1540 | if (w->data_count > 0) |
| 1541 | 1541 | { |
| 1542 | 1542 | /* clear data request */ |
| 1543 | wd17xx_clear_data_request(); | |
| 1543 | wd17xx_clear_data_request(machine); | |
| 1544 | 1544 | |
| 1545 | 1545 | /* put byte into buffer */ |
| 1546 | 1546 | if (VERBOSE_DATA) |
| r1957 | r1958 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | ***************************************************************************/ |
| 53 | 53 | |
| 54 | void wd17xx_init(wd17xx_type_t type, void (*callback)(wd17xx_state_t, void *), void *param); | |
| 54 | void wd17xx_init(running_machine *machine, wd17xx_type_t type, void (*callback)(running_machine *, wd17xx_state_t, void *), void *param); | |
| 55 | 55 | void wd17xx_reset(void); |
| 56 | 56 | |
| 57 | 57 | /* the following are not strictly part of the wd179x hardware/emulation |
| r1957 | r1958 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | MACHINE_START( coupe ) |
| 138 | 138 | { |
| 139 | wd17xx_init(WD_TYPE_177X,NULL, NULL); | |
| 139 | wd17xx_init(machine, WD_TYPE_177X,NULL, NULL); | |
| 140 | 140 | add_reset_callback(machine, coupe_reset); |
| 141 | 141 | } |
| r1957 | r1958 | |
|---|---|---|
| 281 | 281 | return INIT_PASS; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | static void trs80_fdc_callback(wd17xx_state_t event, void *param); | |
| 284 | static void trs80_fdc_callback(running_machine *machine, wd17xx_state_t event, void *param); | |
| 285 | 285 | |
| 286 | 286 | MACHINE_RESET( trs80 ) |
| 287 | 287 | { |
| r1957 | r1958 | |
| 353 | 353 | |
| 354 | 354 | MACHINE_START( trs80 ) |
| 355 | 355 | { |
| 356 | wd17xx_init(WD_TYPE_179X,trs80_fdc_callback, NULL); | |
| 356 | wd17xx_init(machine, WD_TYPE_179X,trs80_fdc_callback, NULL); | |
| 357 | 357 | add_exit_callback(machine, tape_put_close); |
| 358 | 358 | } |
| 359 | 359 | |
| r1957 | r1958 | |
| 651 | 651 | } |
| 652 | 652 | } |
| 653 | 653 | |
| 654 | void trs80_fdc_callback(wd17xx_state_t event, void *param) | |
| 654 | void trs80_fdc_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 655 | 655 | { |
| 656 | 656 | switch (event) |
| 657 | 657 | { |
| r1957 | r1958 | |
| 659 | 659 | irq_status &= ~IRQ_FDC; |
| 660 | 660 | break; |
| 661 | 661 | case WD17XX_IRQ_SET: |
| 662 | trs80_fdc_interrupt( | |
| 662 | trs80_fdc_interrupt(machine, 0); | |
| 663 | 663 | break; |
| 664 | 664 | case WD17XX_DRQ_CLR: |
| 665 | 665 | case WD17XX_DRQ_SET: |
| r1957 | r1958 | |
|---|---|---|
| 326 | 326 | |
| 327 | 327 | static SVI318_FDC_STRUCT svi318_fdc; |
| 328 | 328 | |
| 329 | static void svi_fdc_callback(wd17xx_state_t state, void *param) | |
| 329 | static void svi_fdc_callback(running_machine *machine, wd17xx_state_t state, void *param) | |
| 330 | 330 | { |
| 331 | 331 | switch( state ) |
| 332 | 332 | { |
| r1957 | r1958 | |
| 591 | 591 | } |
| 592 | 592 | |
| 593 | 593 | /* floppy */ |
| 594 | wd17xx_init(WD_TYPE_179X, svi_fdc_callback, NULL); | |
| 594 | wd17xx_init(machine, WD_TYPE_179X, svi_fdc_callback, NULL); | |
| 595 | 595 | |
| 596 | 596 | /* serial */ |
| 597 | 597 | uart8250_init(0, svi318_uart8250_interface); |
| r1957 | r1958 | |
|---|---|---|
| 1613 | 1613 | |
| 1614 | 1614 | static int bbc_1770_IntEnabled; |
| 1615 | 1615 | |
| 1616 | static void bbc_wd177x_callback(wd17xx_state_t event, void *param) | |
| 1616 | static void bbc_wd177x_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 1617 | 1617 | { |
| 1618 | 1618 | int state; |
| 1619 | 1619 | /* wd177x_IRQ_SET and latch bit 4 (nmi_enable) are NAND'ED together |
| r1957 | r1958 | |
| 1679 | 1679 | { |
| 1680 | 1680 | /* I'll pulse it because if I used hold-line I'm not sure |
| 1681 | 1681 | it would clear - to be checked */ |
| 1682 | cpunum_set_input_line( | |
| 1682 | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI,PULSE_LINE); | |
| 1683 | 1683 | } |
| 1684 | 1684 | } |
| 1685 | 1685 | |
| r1957 | r1958 | |
| 2142 | 2142 | // break; |
| 2143 | 2143 | //case 4: case 5: case 6: |
| 2144 | 2144 | previous_wd177x_int_state=1; |
| 2145 | wd17xx_init(WD_TYPE_177X,bbc_wd177x_callback, NULL); | |
| 2145 | wd17xx_init(machine, WD_TYPE_177X,bbc_wd177x_callback, NULL); | |
| 2146 | 2146 | // break; |
| 2147 | 2147 | //} |
| 2148 | 2148 | } |
| r1957 | r1958 | |
| 2201 | 2201 | via_config(1, &bbcb_user_via); |
| 2202 | 2202 | via_set_clock(1,1000000); |
| 2203 | 2203 | |
| 2204 | wd17xx_init(WD_TYPE_177X,bbc_wd177x_callback, NULL); | |
| 2204 | wd17xx_init(machine, WD_TYPE_177X,bbc_wd177x_callback, NULL); | |
| 2205 | 2205 | } |
| 2206 | 2206 | |
| 2207 | 2207 | MACHINE_RESET( bbcbp ) |
| r1957 | r1958 | |
| 2238 | 2238 | via_config(1, &bbcb_user_via); |
| 2239 | 2239 | via_set_clock(1,1000000); |
| 2240 | 2240 | |
| 2241 | wd17xx_init(WD_TYPE_177X,bbc_wd177x_callback, NULL); | |
| 2241 | wd17xx_init(machine, WD_TYPE_177X,bbc_wd177x_callback, NULL); | |
| 2242 | 2242 | } |
| 2243 | 2243 | |
| 2244 | 2244 | MACHINE_RESET( bbcm ) |
| r1957 | r1958 | |
|---|---|---|
| 1419 | 1419 | } |
| 1420 | 1420 | #endif |
| 1421 | 1421 | |
| 1422 | static void betadisk_wd179x_callback(wd17xx_state_t state, void *param) | |
| 1422 | static void betadisk_wd179x_callback(running_machine *machine, wd17xx_state_t state, void *param) | |
| 1423 | 1423 | { |
| 1424 | 1424 | switch (state) |
| 1425 | 1425 | { |
| r1957 | r1958 | |
| 1480 | 1480 | } |
| 1481 | 1481 | #endif |
| 1482 | 1482 | |
| 1483 | static void betadisk_init( | |
| 1483 | static void betadisk_init(running_machine *machine) | |
| 1484 | 1484 | { |
| 1485 | 1485 | betadisk_active = 0; |
| 1486 | 1486 | betadisk_status = 0x03f; |
| 1487 | wd17xx_init(WD_TYPE_179X, betadisk_wd179x_callback, NULL); | |
| 1487 | wd17xx_init(machine, WD_TYPE_179X, betadisk_wd179x_callback, NULL); | |
| 1488 | 1488 | } |
| 1489 | 1489 | |
| 1490 | 1490 | /****************************************************************************************************/ |
| r1957 | r1958 | |
| 1721 | 1721 | |
| 1722 | 1722 | scorpion_update_memory(); |
| 1723 | 1723 | |
| 1724 | betadisk_init(); | |
| 1724 | betadisk_init(machine); | |
| 1725 | 1725 | } |
| 1726 | 1726 | |
| 1727 | 1727 | /****************************************************************************************************/ |
| r1957 | r1958 | |
| 1757 | 1757 | memory_set_bankptr(3, spectrum_ram + (2<<14)); |
| 1758 | 1758 | memory_set_bankptr(7, spectrum_ram + (2<<14)); |
| 1759 | 1759 | |
| 1760 | betadisk_init(); | |
| 1760 | betadisk_init(machine); | |
| 1761 | 1761 | } |
| 1762 | 1762 | |
| 1763 | 1763 | /****************************************************************************************************/ |
| r1957 | r1958 | |
|---|---|---|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | static void atarist_fdc_callback(wd17xx_state_t event, void *param) | |
| 128 | static void atarist_fdc_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 129 | 129 | { |
| 130 | 130 | switch (event) |
| 131 | 131 | { |
| r1957 | r1958 | |
| 1528 | 1528 | atarist_state_save(); |
| 1529 | 1529 | |
| 1530 | 1530 | centronics_config(0, atarist_centronics_config); |
| 1531 | wd17xx_init(WD_TYPE_1772, atarist_fdc_callback, NULL); | |
| 1531 | wd17xx_init(machine, WD_TYPE_1772, atarist_fdc_callback, NULL); | |
| 1532 | 1532 | acia6850_config(0, &acia_ikbd_intf); |
| 1533 | 1533 | acia6850_config(1, &acia_midi_intf); |
| 1534 | 1534 | state->mfp = devtag_get_token(machine, MC68901, "mfp"); |
| r1957 | r1958 | |
| 1618 | 1618 | atariste_state_save(); |
| 1619 | 1619 | |
| 1620 | 1620 | centronics_config(0, atarist_centronics_config); |
| 1621 | wd17xx_init(WD_TYPE_1772, atarist_fdc_callback, NULL); | |
| 1621 | wd17xx_init(machine, WD_TYPE_1772, atarist_fdc_callback, NULL); | |
| 1622 | 1622 | acia6850_config(0, &acia_ikbd_intf); |
| 1623 | 1623 | acia6850_config(1, &acia_midi_intf); |
| 1624 | 1624 | state->mfp = devtag_get_token(machine, MC68901, "mfp"); |
| r1957 | r1958 | |
| 1757 | 1757 | state_save_register_global(ktxd); |
| 1758 | 1758 | |
| 1759 | 1759 | centronics_config(0, atarist_centronics_config); |
| 1760 | wd17xx_init(WD_TYPE_1772, atarist_fdc_callback, NULL); | |
| 1760 | wd17xx_init(machine, WD_TYPE_1772, atarist_fdc_callback, NULL); | |
| 1761 | 1761 | acia6850_config(0, &stbook_acia_ikbd_intf); |
| 1762 | 1762 | acia6850_config(1, &acia_midi_intf); |
| 1763 | 1763 | state->mfp = devtag_get_token(machine, MC68901, "mfp"); |
| r1957 | r1958 | |
|---|---|---|
| 258 | 258 | serial_timer = timer_alloc(exidy_serial_timer_callback, NULL); |
| 259 | 259 | cassette_timer = timer_alloc(exidy_cassette_timer_callback, NULL); |
| 260 | 260 | |
| 261 | wd17xx_init(WD_TYPE_179X, NULL, NULL); | |
| 261 | wd17xx_init(machine, WD_TYPE_179X, NULL, NULL); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | static MACHINE_RESET( exidy ) |
| r1957 | r1958 | |
|---|---|---|
| 174 | 174 | }; |
| 175 | 175 | |
| 176 | 176 | |
| 177 | static void enterp_wd177x_callback(wd17xx_state_t event, void *param); | |
| 177 | static void enterp_wd177x_callback(running_machine *machine, wd17xx_state_t event, void *param); | |
| 178 | 178 | |
| 179 | 179 | static void enterprise_reset(running_machine *machine) |
| 180 | 180 | { |
| r1957 | r1958 | |
| 236 | 236 | |
| 237 | 237 | static MACHINE_START(enterprise) |
| 238 | 238 | { |
| 239 | wd17xx_init(WD_TYPE_177X, enterp_wd177x_callback, NULL); | |
| 239 | wd17xx_init(machine, WD_TYPE_177X, enterp_wd177x_callback, NULL); | |
| 240 | 240 | add_reset_callback(machine, enterprise_reset); |
| 241 | 241 | } |
| 242 | 242 | |
| r1957 | r1958 | |
| 318 | 318 | |
| 319 | 319 | static char EXDOS_CARD_R = 0; |
| 320 | 320 | |
| 321 | static void enterp_wd177x_callback(wd17xx_state_t State, void *param) | |
| 321 | static void enterp_wd177x_callback(running_machine *machine, wd17xx_state_t State, void *param) | |
| 322 | 322 | { |
| 323 | 323 | if (State==WD17XX_IRQ_CLR) |
| 324 | 324 | { |
| r1957 | r1958 | |
|---|---|---|
| 333 | 333 | { |
| 334 | 334 | pia_config(1,&apf_imagination_pia_interface); |
| 335 | 335 | apf_common_init(); |
| 336 | wd17xx_init(WD_TYPE_179X, NULL, NULL); | |
| 336 | wd17xx_init(machine, WD_TYPE_179X, NULL, NULL); | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | static MACHINE_START( apf_m1000 ) |
| r1957 | r1958 | |
|---|---|---|
| 1422 | 1422 | static MACHINE_START( einstein ) |
| 1423 | 1423 | { |
| 1424 | 1424 | TMS9928A_configure(&tms9928a_interface); |
| 1425 | wd17xx_init(WD_TYPE_177X, NULL, NULL); | |
| 1425 | wd17xx_init(machine, WD_TYPE_177X, NULL, NULL); | |
| 1426 | 1426 | } |
| 1427 | 1427 | |
| 1428 | 1428 | static MACHINE_RESET( einstein ) |
| r1957 | r1958 | |
|---|---|---|
| 178 | 178 | a310_memc_reset(); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | static void a310_wd177x_callback(wd17xx_state_t event, void *param) | |
| 181 | static void a310_wd177x_callback(running_machine *machine, wd17xx_state_t event, void *param) | |
| 182 | 182 | { |
| 183 | 183 | switch (event) |
| 184 | 184 | { |
| r1957 | r1958 | |
| 204 | 204 | static MACHINE_START( a310 ) |
| 205 | 205 | { |
| 206 | 206 | a310_pagesize = 0; |
| 207 | wd17xx_init(WD_TYPE_1772, a310_wd177x_callback, NULL); | |
| 207 | wd17xx_init(machine, WD_TYPE_1772, a310_wd177x_callback, NULL); | |
| 208 | 208 | |
| 209 | 209 | vbl_timer = timer_alloc(a310_vblank, NULL); |
| 210 | 210 | timer_adjust_oneshot(vbl_timer, attotime_never, 0); |
| Previous | 15994 Revisions | Next |