Restore fast copies using the fxlibc memcpy()

This commit is contained in:
Lephenixnoir 2021-07-27 15:04:03 +02:00
parent ce44de385c
commit 75c8730451
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
3 changed files with 4 additions and 8 deletions

4
README
View File

@ -2,13 +2,12 @@ This repository is a fork of CGDOOM which was ported originally by MPoupe.
Credit goes to:
* MPoupe for the original fx-CG 10/20 port of DOOM.
* ProgrammerNerd for attempts at an fx-CG 50 port, which this repository is
* ComputerNerd for attempts at an fx-CG 50 port, which this repository is
based on.
* Lephenixnoir for the final fixes and fx-CG 50 version.
TODO:
-> Reenable LTO if possible
-> Include a proper fast, version of memcpy
-> Try and use more memory regions in z_zone.c
-> Overclocking etc.
-> Improve file mapping speed (DMA)
@ -26,5 +25,6 @@ The differences are (I might push it later):
* Linker script outputs in elf32-sh format
* Linker script sets 500k of RAM instead of 64k
* LTO disabled (hopefully it could be reenabled later)
* Syscall memcpy() (apparently broken) replaced by fxlibc memcpy()
[1] https://github.com/Jonimoose/libfxcg/

View File

@ -459,10 +459,7 @@ int Flash_ReadFile(void *buf, int size, int readpos)
I_ErrorI ("Flash_ReadFile", size, readpos, 0, i);
return i;
}
for(int n = 0; n < i; n++) {
((char *)buf)[n] = ((char *)pSrc)[n];
}
// memcpy(buf,pSrc,i);
memcpy(buf,pSrc,i);
buf = ((char*)buf)+i;
readpos +=i;
size -=i;

View File

@ -171,8 +171,7 @@ void V_CopyRect(int srcx,int srcy,int srcscrn,int width,int height,int destx,int
dest = screens[destscrn]+SCREENWIDTH*desty+destx;
for ( ; height>0 ; height--)
{
for(int n = 0; n < width; n++) dest[n] = src[n];
// memcpy (dest, src, width);
memcpy (dest, src, width);
src += SCREENWIDTH;
dest += SCREENWIDTH;
}