o fix sector calc
This commit is contained in:
@@ -20,4 +20,4 @@
|
||||
#define SHARED_ADDR 0x3d0000
|
||||
|
||||
|
||||
#define MMIO_DEBUG
|
||||
#undef MMIO_DEBUG
|
||||
|
||||
@@ -93,7 +93,7 @@ void _print_screen(word y, char *buffer){
|
||||
*(byte*)0x2118 = *buffer-32;
|
||||
x++;
|
||||
buffer++;
|
||||
//waitForVBlank();
|
||||
waitForVBlank();
|
||||
}
|
||||
}
|
||||
void _print_console(const char *buffer){
|
||||
|
||||
@@ -40,22 +40,22 @@ DSTATUS disk_initialize (BYTE drv) {
|
||||
|
||||
byte retval;
|
||||
#ifdef MMIO_DEBUG
|
||||
printfc("SNES::disk_initialize called drv=%i stat=%i\n",drv,Stat);
|
||||
printfc("SNES::disk_initialize: called drv=%i stat=%i\n",drv,Stat);
|
||||
#endif
|
||||
if (drv) return STA_NOINIT; /* Supports only single drive */
|
||||
Stat |= STA_NOINIT;
|
||||
#ifdef MMIO_DEBUG
|
||||
printfc("SNES::disk_initialize stat=%i\n",Stat);
|
||||
printfc("SNES::disk_initialize: stat=%i\n",Stat);
|
||||
#endif
|
||||
*(byte*) MMIO_RETVAL = STA_VOID;
|
||||
*(byte*) MMIO_CMD = CMD_INIT;
|
||||
#ifdef MMIO_DEBUG
|
||||
printfc("SNES::disk_initialize poll retval\n");
|
||||
printfc("SNES::disk_initialize: poll retval\n");
|
||||
#endif
|
||||
while((retval = *(byte*) MMIO_RETVAL) == STA_VOID);
|
||||
Stat &= ~STA_NOINIT; /* When device goes ready, clear STA_NOINIT */
|
||||
#ifdef MMIO_DEBUG
|
||||
printfc("SNES::disk_initialize done Stat=%i\n",Stat);
|
||||
printfc("SNES::disk_initialize: done Stat=%i\n",Stat);
|
||||
#endif
|
||||
return Stat;
|
||||
}
|
||||
@@ -88,15 +88,15 @@ DRESULT disk_read (
|
||||
word i;
|
||||
|
||||
//#ifdef MMIO_DEBUG
|
||||
printfc("SNES::disk_read called sector=%li count=%i\n",sector,count);
|
||||
printfc("SNES::disk_read: sector=%li count=%i\n",sector,count);
|
||||
//#endif
|
||||
if (drv || !count) return RES_PARERR;
|
||||
#ifdef MMIO_DEBUG
|
||||
printfc("SNES::disk_read drv ok\n");
|
||||
printfc("SNES::disk_read: drv ok\n");
|
||||
#endif
|
||||
if (Stat & STA_NOINIT) return RES_NOTRDY;
|
||||
#ifdef MMIO_DEBUG
|
||||
printfc("SNES::disk_read sta ok\n");
|
||||
printfc("SNES::disk_read: sta ok\n");
|
||||
#endif
|
||||
|
||||
*(byte*) MMIO_RETVAL = STA_VOID;
|
||||
@@ -110,13 +110,13 @@ DRESULT disk_read (
|
||||
*(byte*) MMIO_COUNT = count;
|
||||
|
||||
#ifdef MMIO_DEBUG
|
||||
printfc("SNES::disk_read poll retval\n");
|
||||
printfc("SNES::disk_read: poll retval\n");
|
||||
#endif
|
||||
while((retval = *(byte*) MMIO_RETVAL) == STA_VOID);
|
||||
|
||||
|
||||
#ifdef MMIO_DEBUG
|
||||
printfc("SNES::disk_read copy buffer to %lx\n",SHARED_ADDR);
|
||||
printfc("SNES::disk_read: copy buffer to %lx\n",SHARED_ADDR);
|
||||
#endif
|
||||
for (i=0;i<(count*512);i++){
|
||||
buff[i] = *(byte*)(SHARED_ADDR+i);
|
||||
|
||||
Reference in New Issue
Block a user