Gergely Szasz - 2021-05-31

This patch try to correct the motor on problem of WD1770/WD1772 emulation:

Changes:
* wd_fdc.h:
- add a new function to wd_fdc struct: fdd_motoron
* wd_fdc.c:
* in wd_fdc_master_reset():
* remove pending events
* switch off motor on drives
* in wd_fdc_alloc(): set fdd_motoron function to fdd_motoron(). Later in specific drive emulation code can override if needed.
* replace all fdd_motoron(..) with f->fdd_motoron(...)
* when force interrupt command, we add a motor_off event (force interrupt start motor but never stop...?) all this we do if WD1770/1772 (other chips there is no /MO output (maybe head load?)
* fdd.c:
* fdd_motoron(): remove motoron "guard" if there is no disk loaded (drive motoron now independent of disk loaded status)
* fdd_load(): "start" rotating the disk if motor already "running"
* fdd_unload(): remove motoroff
* beta.c:
* add beta_motoron() to override fdd_motoron() -- in beta_init() -- to start all drives motor if "head load"!
* disciple.c:
* add disciple_motoron() to override fdd_motoron() -- in disciple_init() --to start all drives motor if WD /MO activated
* in disciple_cn_write() remove the fdd_motoron() code and change the code to do drive select, head select and dden select only if register changed
* opus.c:
* add opus_motoron() to override fdd_motoron() -- in opus_init() -- to start all drives motor if if WD /MO activated
* plusd.c:
* add plusd_motoron() to override fdd_motoron() -- in plusd_init() --to start all drives motor if WD /MO activated
* in plusd_reset() we reset the plusd_control_register
* in plusd_dr_write() mask the controll register with the exists bits (4 bit B0,B1, B6, B7), and change the code to do drive select and head select only if register changed

 

Last edit: Gergely Szasz 2021-05-31