Fixed error in blockread/write
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@378
This commit is contained in:
parent
fb3b0711bb
commit
f25dbb22dd
1 changed files with 4 additions and 6 deletions
|
@ -40,14 +40,13 @@ void MEM_BlockRead(PhysPt off,void * data,Bitu size) {
|
|||
Bitu start=off & (PAGE_SIZE-1);
|
||||
Bitu tocopy=PAGE_SIZE-start;
|
||||
if (tocopy>size) tocopy=size;
|
||||
size-=tocopy;
|
||||
if (ReadHostTable[page]) {
|
||||
memcpy(idata,ReadHostTable[page]+off,tocopy);
|
||||
idata+=tocopy;
|
||||
off+=tocopy;
|
||||
idata+=tocopy;off+=tocopy;
|
||||
} else {
|
||||
for (;tocopy>0;tocopy--) *idata++=ReadHandlerTable[page](off++);
|
||||
}
|
||||
size-=tocopy;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,14 +57,13 @@ void MEM_BlockWrite(PhysPt off,void * data,Bitu size) {
|
|||
Bitu start=off & (PAGE_SIZE-1);
|
||||
Bitu tocopy=PAGE_SIZE-start;
|
||||
if (tocopy>size) tocopy=size;
|
||||
size-=tocopy;
|
||||
if (WriteHostTable[page]) {
|
||||
memcpy(WriteHostTable[page]+off,idata,tocopy);
|
||||
idata+=tocopy;
|
||||
off+=tocopy;
|
||||
idata+=tocopy;off+=tocopy;
|
||||
} else {
|
||||
for (;tocopy>0;tocopy--) WriteHandlerTable[page](off++,*idata++);
|
||||
}
|
||||
size-=tocopy;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue