fix side-select bug in WDC FDC driver, was causing all reads to occur on side0... now the Loader boots!

Mon, 06 Dec 2010 01:43:04 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Mon, 06 Dec 2010 01:43:04 +0000
changeset 54
57c6ef81ae81
parent 53
e1693c4b8a0c
child 55
ba6b8e570062
child 75
976dfa068839

fix side-select bug in WDC FDC driver, was causing all reads to occur on side0... now the Loader boots!

Loader will boot, but immediately gives up on the floppy drive... Not sure why.

src/wd279x.c file | annotate | diff | revisions
     1.1 diff -r e1693c4b8a0c -r 57c6ef81ae81 src/wd279x.c
     1.2 --- a/src/wd279x.c	Mon Dec 06 01:26:37 2010 +0000
     1.3 +++ b/src/wd279x.c	Mon Dec 06 01:43:04 2010 +0000
     1.4 @@ -351,6 +351,7 @@
     1.5  			switch (cmd) {
     1.6  				case CMD_READ_ADDRESS:
     1.7  					// Read Address
     1.8 +					ctx->head = (val & 0x02) ? 1 : 0;
     1.9  
    1.10  					// reset data pointers
    1.11  					ctx->data_pos = ctx->data_len = 0;
    1.12 @@ -380,7 +381,8 @@
    1.13  
    1.14  				case CMD_READ_SECTOR:
    1.15  				case CMD_READ_SECTOR_MULTI:
    1.16 -					printf("WD279X: READ SECTOR chs=%d:%d:%d\n", ctx->track, ctx->head, ctx->sector);
    1.17 +					ctx->head = (val & 0x02) ? 1 : 0;
    1.18 +					printf("WD279X: READ SECTOR cmd=%02X chs=%d:%d:%d\n", cmd, ctx->track, ctx->head, ctx->sector);
    1.19  					// Read Sector or Read Sector Multiple
    1.20  					// reset data pointers
    1.21  					ctx->data_pos = ctx->data_len = 0;
    1.22 @@ -416,6 +418,7 @@
    1.23  				case CMD_READ_TRACK:
    1.24  					// Read Track
    1.25  					// TODO! implement this
    1.26 +					ctx->head = (val & 0x02) ? 1 : 0;
    1.27  					ctx->status = 0;
    1.28  					// B6, B5, B4, B3 = 0
    1.29  					// B2 = Lost Data. Caused if DRQ isn't serviced in time. FIXME-not emulated
    1.30 @@ -427,6 +430,7 @@
    1.31  				case CMD_WRITE_SECTOR_MULTI:
    1.32  					// Write Sector or Write Sector Multiple
    1.33  
    1.34 +					ctx->head = (val & 0x02) ? 1 : 0;
    1.35  					// reset data pointers
    1.36  					ctx->data_pos = ctx->data_len = 0;
    1.37  
    1.38 @@ -444,6 +448,7 @@
    1.39  
    1.40  				case CMD_FORMAT_TRACK:
    1.41  					// Write Track (aka Format Track)
    1.42 +					ctx->head = (val & 0x02) ? 1 : 0;
    1.43  					ctx->status = 0;
    1.44  					// B6 = Write Protect. FIXME -- emulate this!
    1.45  					// B5, B4, B3 = 0