X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FMisc.c;h=2a0e56997811c0e5b8d2b74dbfb329b2ebd54a37;hb=eff55556cff77fd64cff4be32e449e0a58aed6fe;hp=887e90cc3ee49f7b7a59afadac9cd272fa2623e4;hpb=cc68a136aa179a5f32fe40208371eb9c2b0aadae;p=picodrive.git diff --git a/Pico/Misc.c b/Pico/Misc.c index 887e90cc..2a0e5699 100644 --- a/Pico/Misc.c +++ b/Pico/Misc.c @@ -85,7 +85,7 @@ const unsigned char hcounts_32[] = { 0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0c,0x0d, }; -// vcounter values for PicoFrameSimple +// vcounter values for PicoFrameSimple const unsigned short vcounts[] = { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, @@ -141,7 +141,7 @@ unsigned int lastSSRamWrite = 0xffff0000; // sram_reg: LAtd sela (L=pending SCL, A=pending SDA, t=type(1==uses 0x200000 for SCL and 2K bytes), // d=SRAM was detected (header or by access), s=started, e=save is EEPROM, l=old SCL, a=old SDA) -void SRAMWriteEEPROM(unsigned int d) // ???? ??la (l=SCL, a=SDA) +PICO_INTERNAL void SRAMWriteEEPROM(unsigned int d) // ???? ??la (l=SCL, a=SDA) { unsigned int sreg = Pico.m.sram_reg, saddr = Pico.m.sram_addr, scyc = Pico.m.sram_cycle, ssa = Pico.m.sram_slave; @@ -247,7 +247,7 @@ void SRAMWriteEEPROM(unsigned int d) // ???? ??la (l=SCL, a=SDA) Pico.m.sram_slave= (unsigned char) ssa; } -unsigned int SRAMReadEEPROM() +PICO_INTERNAL_ASM unsigned int SRAMReadEEPROM(void) { unsigned int shift, d=0; unsigned int sreg, saddr, scyc, ssa; @@ -282,7 +282,7 @@ unsigned int SRAMReadEEPROM() return d; } -void SRAMUpdPending(unsigned int a, unsigned int d) +PICO_INTERNAL void SRAMUpdPending(unsigned int a, unsigned int d) { unsigned int sreg = Pico.m.sram_reg; @@ -303,3 +303,36 @@ void SRAMUpdPending(unsigned int a, unsigned int d) Pico.m.sram_reg = (unsigned char) sreg; } + + +#ifndef _ASM_MISC_C +PICO_INTERNAL_ASM void memcpy16(unsigned short *dest, unsigned short *src, int count) +{ + while (count--) + *dest++ = *src++; +} + + +PICO_INTERNAL_ASM void memcpy16bswap(unsigned short *dest, void *src, int count) +{ + unsigned char *src_ = src; + + for (; count; count--, src_ += 2) + *dest++ = (src_[0] << 8) | src_[1]; +} + + +PICO_INTERNAL_ASM void memcpy32(int *dest, int *src, int count) +{ + while (count--) + *dest++ = *src++; +} + + +PICO_INTERNAL_ASM void memset32(int *dest, int c, int count) +{ + while (count--) + *dest++ = c; +} +#endif +