FAME + some random stuff added

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@276 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-10-21 10:20:56 +00:00
parent 7d4906bfc9
commit 70357ce525
22 changed files with 45359 additions and 4395 deletions

View file

@ -316,8 +316,30 @@ PICO_INTERNAL void SRAMUpdPending(unsigned int a, unsigned int d)
#ifndef _ASM_MISC_C
typedef struct
{
int b0;
int b1;
int b2;
int b3;
int b4;
int b5;
int b6;
int b7;
} intblock;
PICO_INTERNAL_ASM void memcpy16(unsigned short *dest, unsigned short *src, int count)
{
if (((int)dest & (int)src & 3) == 0)
{
if (count >= 32) {
memcpy32((int *)dest, (int *)src, count/2);
count&=1;
} else {
for (; count >= 2; count -= 2, dest+=2, src+=2)
*(int *)dest = *(int *)src;
}
}
while (count--)
*dest++ = *src++;
}
@ -334,6 +356,12 @@ PICO_INTERNAL_ASM void memcpy16bswap(unsigned short *dest, void *src, int count)
PICO_INTERNAL_ASM void memcpy32(int *dest, int *src, int count)
{
intblock *bd = (intblock *) dest, *bs = (intblock *) src;
for (; count >= sizeof(*bd)/4; count -= sizeof(*bd)/4)
*bd++ = *bs++;
dest = (int *)bd; src = (int *)bs;
while (count--)
*dest++ = *src++;
}
@ -341,6 +369,10 @@ PICO_INTERNAL_ASM void memcpy32(int *dest, int *src, int count)
PICO_INTERNAL_ASM void memset32(int *dest, int c, int count)
{
for (; count >= 8; count -= 8, dest += 8)
dest[0] = dest[1] = dest[2] = dest[3] =
dest[4] = dest[5] = dest[6] = dest[7] = c;
while (count--)
*dest++ = c;
}