1
0
mirror of synced 2026-02-28 09:28:35 +00:00

Update XTSD to use MOVSW.

This commit is contained in:
Matthieu Bucchianeri
2025-02-16 14:43:42 -08:00
parent 923bbd548e
commit e16aa4c1c5
5 changed files with 19 additions and 57 deletions

View File

@@ -365,14 +365,8 @@ PUBLIC void Initialize (rh_init_t far *rh)
WORD brkadr, reboot[2]; int status, i;
/* The version number is sneakily stored in the device header! */
cdprintf("SD Card driver V%c.%c for XTMax (%s)\n based on SD pport device driver (C) 2014 by Dan Marks\n based on TU58 by Robert Armstrong\n",
header.name[6], header.name[7],
#ifdef USE186
"80186+"
#else
"8086"
#endif
);
cdprintf("SD Card driver V%c.%c for XTMax\n based on SD pport device driver (C) 2014 by Dan Marks\n based on TU58 by Robert Armstrong\n",
header.name[6], header.name[7]);
/* Parse the options from the CONFIG.SYS file, if any... */
if (!parse_options((char far *) rh->bpbtbl)) {

View File

@@ -5,7 +5,7 @@ ASM=tasm -mx
DEPS=cprint.c driver.c sd.c sdmm.c cprint.h diskio.h driver.h integer.h sd.h standard.h
all: xtsd.sys xtsd186.sys
all: xtsd.sys
.asm.obj:
$(ASM) $*
@@ -17,13 +17,6 @@ xtsd.sys: header.obj $(DEPS)
$(CC) driver.c
tlink -t -m -s -n header cprint sd sdmm driver, $@
xtsd186.sys: header.obj $(DEPS)
$(CC) -1 -DUSE186 cprint.c
$(CC) -1 -DUSE186 sd.c
$(CC) -1 -DUSE186 sdmm.c
$(CC) -1 -DUSE186 driver.c
tlink -t -m -s -n header cprint sd sdmm driver, $@
clean:
del *.obj
del *.map

View File

@@ -27,8 +27,9 @@
/* Platform dependent macros and functions needed to be modified */
/*-------------------------------------------------------------------------*/
DWORD VIRT_BUFFER=0xCE000000+2048;
WORD DATAPORT=0x280;
WORD CONTROLPORT=0x282;
WORD CONTROLPORT=0x280+1;
#if 1
#define TOUTCHR(x)
@@ -177,30 +178,17 @@ void xmit_mmc (
// NOTE: Callers always use buffer sizes multiple of two.
bc >>= 1;
#ifndef USE186
_asm {
mov cx,bc
mov dx,DATAPORT
push ds
push es
les di,VIRT_BUFFER
lds si,dword ptr buff
}
repeat:
_asm {
lodsw
out dx, ax
loop repeat
cld
rep movsw
pop es
pop ds
}
#else
_asm {
mov cx,bc
mov dx,DATAPORT
push ds
lds si,dword ptr buff
rep outsw
pop ds
}
#endif
}
@@ -218,30 +206,17 @@ void rcvr_mmc (
// NOTE: Callers always use buffer sizes multiple of two.
bc >>= 1;
#ifndef USE186
_asm {
mov cx,bc
mov dx,DATAPORT
push ds
push es
les di,dword ptr buff
}
repeat:
_asm {
in ax, dx
stosw
loop repeat
lds si,VIRT_BUFFER
cld
rep movsw
pop es
pop ds
}
#else
_asm {
mov cx,bc
mov dx,DATAPORT
push es
les di,dword ptr buff
rep insw
pop es
}
#endif
}
/*-----------------------------------------------------------------------*/
@@ -254,11 +229,11 @@ int wait_ready (void) /* 1:OK, 0:Timeout */
BYTE d;
UINT tmr;
outp(DATAPORT+15, 50);
outp(DATAPORT+7, 50);
do { /* Wait for ready in timeout of 500ms */
d = inp(DATAPORT);
if (d == 0xFF) break;
} while(!inp(DATAPORT+15));
} while(!inp(DATAPORT+7));
return d == 0xFF;
}
@@ -309,11 +284,11 @@ int rcvr_datablock ( /* 1:OK, 0:Failed */
UINT tmr;
outp(DATAPORT+15, 10);
outp(DATAPORT+7, 10);
do { /* Wait for data packet in timeout of 100ms */
d = inp(DATAPORT);
if (d != 0xFF) break;
} while(!inp(DATAPORT+15));
} while(!inp(DATAPORT+7));
if (d != 0xFE) {
return 0; /* If not valid data token, return with error */
}

Binary file not shown.

Binary file not shown.