src/wd279x.c

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