![Cool 8)](./images/smilies/icon_cool.gif)
I'm OK now... I recommend the link posted by urxae. Thanks!
Lster
According to this thread, you should wait for an IRQ after the first two IO-outs, then call "floppy_check_interrupt" (code quoted below for convenience) ignoring the results, and only then send the last IO-out (to CCR). (Then he does some more stuff to set the "steprate" and "load time", followed by recalibration)Lprogster wrote:Code: Select all
// Reset the floppy disk void reset_floppy ( ) { // Reset the floppy out_port ( DOR, 0x00 ); out_port ( DOR, 0x0C ); out_port ( CCR, 0x00 ); // Wait for interupt floppy_flag = 1; while ( floppy_flag == 1 ) ; }
(Disclaimer: My own floppy driver, based on that thread, doesn't yet work on any real hardware I have available...)mystran wrote:Code: Select all
unsigned char floppy_read_data(int base) { int i; // do timeout, 60 seconds for(i = 0; i < 600; i++) { timer_sleep(1); // sleep 10 ms if(0x80 & in8_p(base+FLOPPY_MSR)) { return in8_p(base+FLOPPY_FIFO); } } panic("floppy_read_data: timeout"); return 0; // not reached }