Wed, 16 Jan 2013 00:40:18 +0000
[wd2010] allow seek delay to be overridden at compile time
src/wd2010.c | file | annotate | diff | revisions |
1.1 diff -r 7fb4f58f620a -r d79a028161fd src/wd2010.c 1.2 --- a/src/wd2010.c Wed Jan 16 00:38:13 2013 +0000 1.3 +++ b/src/wd2010.c Wed Jan 16 00:40:18 2013 +0000 1.4 @@ -12,7 +12,9 @@ 1.5 #endif 1.6 #include "utils.h" 1.7 1.8 -#define SEEK_DELAY 30 1.9 +#ifndef WD2010_SEEK_DELAY 1.10 +#define WD2010_SEEK_DELAY 30 1.11 +#endif 1.12 1.13 #define CMD_ENABLE_RETRY 0x01 1.14 #define CMD_LONG_MODE 0x02 1.15 @@ -307,7 +309,7 @@ 1.16 case CMD_RESTORE: 1.17 // Restore. Set track to 0 and throw an IRQ. 1.18 ctx->track = 0; 1.19 - SDL_AddTimer(SEEK_DELAY, (SDL_NewTimerCallback)seek_complete, ctx); 1.20 + SDL_AddTimer(WD2010_SEEK_DELAY, (SDL_NewTimerCallback)seek_complete, ctx); 1.21 break; 1.22 case CMD_SCAN_ID: 1.23 ctx->cylinder_high_reg = (ctx->track >> 8) & 0xff; 1.24 @@ -337,7 +339,7 @@ 1.25 ctx->formatting = cmd == CMD_WRITE_FORMAT; 1.26 switch (cmd){ 1.27 case CMD_SEEK: 1.28 - SDL_AddTimer(SEEK_DELAY, (SDL_NewTimerCallback)seek_complete, ctx); 1.29 + SDL_AddTimer(WD2010_SEEK_DELAY, (SDL_NewTimerCallback)seek_complete, ctx); 1.30 break; 1.31 case CMD_READ_SECTOR: 1.32 /*XXX: does a separate function to set the head have to be added?*/ 1.33 @@ -387,7 +389,7 @@ 1.34 1.35 ctx->status = 0; 1.36 ctx->status |= (ctx->data_pos < ctx->data_len) ? SR_DRQ | SR_COMMAND_IN_PROGRESS | SR_BUSY : 0x00; 1.37 - SDL_AddTimer(SEEK_DELAY, (SDL_NewTimerCallback)transfer_seek_complete, ctx); 1.38 + SDL_AddTimer(WD2010_SEEK_DELAY, (SDL_NewTimerCallback)transfer_seek_complete, ctx); 1.39 1.40 break; 1.41 case CMD_WRITE_FORMAT: 1.42 @@ -429,7 +431,7 @@ 1.43 1.44 ctx->status = 0; 1.45 ctx->status |= (ctx->data_pos < ctx->data_len) ? SR_DRQ | SR_COMMAND_IN_PROGRESS | SR_BUSY : 0x00; 1.46 - SDL_AddTimer(SEEK_DELAY, (SDL_NewTimerCallback)transfer_seek_complete, ctx); 1.47 + SDL_AddTimer(WD2010_SEEK_DELAY, (SDL_NewTimerCallback)transfer_seek_complete, ctx); 1.48 1.49 break; 1.50 default: