X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fmisc.c;h=47842e3fa0c63cd3c78902f5e6bec597fdd61246;hb=fdcfd323747dceacb1ec2e86919d437896635bb7;hp=4e344fc5a37d91e20a9c775630e75c6121a43927;hpb=45f2f245f51ef0c0d37df3c998595c132bfcaffa;p=picodrive.git diff --git a/pico/misc.c b/pico/misc.c index 4e344fc..47842e3 100644 --- a/pico/misc.c +++ b/pico/misc.c @@ -1,10 +1,10 @@ -// This is part of Pico Library - -// (c) Copyright 2006 notaz, All rights reserved. -// Free for non-commercial use. - -// For commercial use, separate licencing terms must be obtained. - +/* + * rarely used EEPROM code + * (C) notaz, 2006-2008 + * + * This work is licensed under the terms of MAME license. + * See COPYING file in the top-level directory. + */ #include "pico_int.h" @@ -87,35 +87,6 @@ const unsigned char hcounts_32[] = { #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++; -} - - PICO_INTERNAL_ASM void memcpy16bswap(unsigned short *dest, void *src, int count) { unsigned char *src_ = src; @@ -125,21 +96,10 @@ PICO_INTERNAL_ASM void memcpy16bswap(unsigned short *dest, void *src, int count) } #ifndef _ASM_MISC_C_AMIPS -PICO_INTERNAL_ASM void memcpy32(int *dest, int *src, int count) +PICO_INTERNAL_ASM void memset32(void *dest_in, int c, 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++; -} + int *dest = dest_in; - -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;