#include "bcd.h"
#include "rtc.h"
-#define DEBUG_CPM_SDIO 0 /* set to 1 to debug */
+#define DEBUG_CPM_SDIO 1 /* set to 1 to debug */
#define debug_cpmsd(fmt, args...) \
debug_cond(DEBUG_CPM_SDIO, fmt, ##args)
}
res = f_lseek(&drv_table[drv].fd, pos);
+#if 0
+ if (f_tell(&drv_table[drv].fd) != pos) {
+ return msg_cpm_result(subf, 0x05, res);
+ }
+#endif
while (!res && secs--) {
unsigned int brw;
buserr = 1;
break;
} else {
- z80_write_block(disk_buffer, addr, CONFIG_CPM_BLOCK_SIZE);
+ if (brw == 0) {
+ debug_cpmsd(" short read, brw: %d\n", brw);
+ z80_memset(addr, 0, CONFIG_CPM_BLOCK_SIZE);
+ brw = CONFIG_CPM_BLOCK_SIZE;
+ } else {
+ z80_write_block(disk_buffer, addr, CONFIG_CPM_BLOCK_SIZE);
+ }
z80_bus_cmd(Release);
}
}