Copy manually from flash instead of syscall memcpy

It sure looks like it's broken in certain situations, altough only a
complete disassembly would prove that.
This commit is contained in:
Lephenixnoir 2021-07-26 17:33:00 +02:00
parent f869f45d0d
commit fabdac0b33
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 7 additions and 2 deletions

View File

@ -490,9 +490,14 @@ int Flash_ReadFile(void *buf, int size, int readpos)
while(size >0)
{
int i = FindInFlash(&pSrc,size, readpos);
if(i<0)
if(i<0) {
I_ErrorI ("Flash_ReadFile", size, readpos, 0, i);
return i;
memcpy(buf,pSrc,i);
}
for(int n = 0; n < i; n++) {
((char *)buf)[n] = ((char *)pSrc)[n];
}
// memcpy(buf,pSrc,i);
buf = ((char*)buf)+i;
readpos +=i;
size -=i;