Use pointer to MK_FP(0,0x5e0) to save a bit of code.

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@858 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-04-10 09:38:38 +00:00
parent 78995ad7cc
commit 512f48e962
1 changed files with 8 additions and 6 deletions

View File

@ -73,6 +73,7 @@ struct lol FAR *LoL = &DATASTART;
VOID ASMCFUNC FreeDOSmain(void) VOID ASMCFUNC FreeDOSmain(void)
{ {
unsigned char drv; unsigned char drv;
unsigned char FAR *p;
#ifdef _MSC_VER #ifdef _MSC_VER
extern FAR prn_dev; extern FAR prn_dev;
@ -87,17 +88,18 @@ VOID ASMCFUNC FreeDOSmain(void)
at 50:e0 at 50:e0
*/ */
if (fmemcmp(MK_FP(0x50,0xe0+2),"CONFIG",6) == 0) /* UPX */ drv = LoL->BootDrive + 1;
p = MK_FP(0, 0x5e0);
if (fmemcmp(p+2,"CONFIG",6) == 0) /* UPX */
{ {
fmemcpy(&InitKernelConfig, MK_FP(0,0x5e0+2), sizeof(InitKernelConfig)); fmemcpy(&InitKernelConfig, p+2, sizeof(InitKernelConfig));
drv = *(UBYTE FAR *)MK_FP(0,0x5e0) + 1; drv = *p + 1;
*(DWORD FAR *)MK_FP(0,0x5e0+2) = 0; *(DWORD FAR *)(p+2) = 0;
} }
else else
{ {
drv = LoL->BootDrive + 1; *p = drv - 1;
*(UBYTE FAR *)MK_FP(0,0x5e0) = drv - 1;
fmemcpy(&InitKernelConfig, &LowKernelConfig, sizeof(InitKernelConfig)); fmemcpy(&InitKernelConfig, &LowKernelConfig, sizeof(InitKernelConfig));
} }