git-svn-id: file:///home/notaz/opt/svn/PicoDrive@35 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-02-09 23:39:03 +00:00
parent e11c55481f
commit cea6590346
10 changed files with 69 additions and 99 deletions

View file

@ -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,
@ -303,3 +303,27 @@ void SRAMUpdPending(unsigned int a, unsigned int d)
Pico.m.sram_reg = (unsigned char) sreg;
}
#ifndef _ASM_MISC_C
void memcpy16(unsigned short *dest, unsigned short *src, int count)
{
while (count--)
*dest++ = *src++;
}
void memcpy32(int *dest, int *src, int count)
{
while (count--)
*dest++ = *src++;
}
void memset32(int *dest, int c, int count)
{
while (count--)
*dest++ = c;
}
#endif

View file

@ -289,6 +289,9 @@ unsigned int PicoVideoRead(unsigned int a);
void SRAMWriteEEPROM(unsigned int d);
unsigned int SRAMReadEEPROM();
void SRAMUpdPending(unsigned int a, unsigned int d);
void memcpy16(unsigned short *dest, unsigned short *src, int count);
void memcpy32(int *dest, int *src, int count);
void memset32(int *dest, int c, int count);
#ifdef __cplusplus

View file

@ -139,15 +139,24 @@ static void DmaSlow(int len)
{
case 1: // vram
r = Pico.vram;
for(; len; len--)
if (inc == 2 && !(a&1) && a+len*2 < 0x10000)
{
d=*pd++;
if(a&1) d=(d<<8)|(d>>8);
r[a>>1] = (u16)d; // will drop the upper bits
// AutoIncrement
a=(u16)(a+inc);
// didn't src overlap?
//if(pd >= pdend) pd-=0x8000; // should be good for RAM, bad for ROM
// most used DMA mode
memcpy16(r + (a>>1), pd, len);
a += len*2;
}
else
{
for(; len; len--)
{
d=*pd++;
if(a&1) d=(d<<8)|(d>>8);
r[a>>1] = (u16)d; // will drop the upper bits
// AutoIncrement
a=(u16)(a+inc);
// didn't src overlap?
//if(pd >= pdend) pd-=0x8000; // should be good for RAM, bad for ROM
}
}
rendstatus|=0x10;
break;

View file

@ -8,22 +8,6 @@
}
void memcpy32(int *dest, int *src, int count)
{
while (count--)
*dest++ = *src++;
}
void memset32(int *dest, int c, int count)
{
while (count--)
*dest++ = c;
}
void mix_32_to_16l_stereo(short *dest, int *src, int count)
{
int l, r;
@ -55,3 +39,16 @@ void mix_32_to_16_mono(short *dest, int *src, int count)
}
/* unimplemented... */
void mix_16h_to_32(int *dest_buf, short *mp3_buf, int count)
{
}
void mix_16h_to_32_s1(int *dest_buf, short *mp3_buf, int count)
{
}
void mix_16h_to_32_s2(int *dest_buf, short *mp3_buf, int count)
{
}

View file

@ -1,6 +1,4 @@
void memcpy32(int *dest, int *src, int count);
void memset32(int *dest, int c, int count);
//void mix_32_to_32(int *dest, int *src, int count);
void mix_16h_to_32(int *dest, short *src, int count);
void mix_16h_to_32_s1(int *dest, short *src, int count);

View file

@ -1,63 +1,5 @@
@ vim:filetype=armasm
.global memcpy32 @ int *dest, int *src, int count
memcpy32:
stmfd sp!, {r4,lr}
subs r2, r2, #4
bmi mcp32_fin
mcp32_loop:
ldmia r1!, {r3,r4,r12,lr}
subs r2, r2, #4
stmia r0!, {r3,r4,r12,lr}
bpl mcp32_loop
mcp32_fin:
tst r2, #3
ldmeqfd sp!, {r4,pc}
tst r2, #1
ldrne r3, [r1], #4
strne r3, [r0], #4
mcp32_no_unal1:
tst r2, #2
ldmneia r1!, {r3,r12}
ldmfd sp!, {r4,lr}
stmneia r0!, {r3,r12}
bx lr
.global memset32 @ int *dest, int c, int count
memset32:
stmfd sp!, {lr}
mov r3, r1
subs r2, r2, #4
bmi mst32_fin
mov r12,r1
mov lr, r1
mst32_loop:
subs r2, r2, #4
stmia r0!, {r1,r3,r12,lr}
bpl mst32_loop
mst32_fin:
tst r2, #1
strne r1, [r0], #4
tst r2, #2
stmneia r0!, {r1,r3}
ldmfd sp!, {lr}
bx lr
@ this assumes src is word aligned
.global mix_16h_to_32 @ int *dest, short *src, int count

View file

@ -112,7 +112,6 @@
#include <math.h>
#include "ym2612.h"
#include "mix.h"
#ifndef EXTERNAL_YM2612
#include <stdlib.h>
@ -125,6 +124,8 @@ extern YM2612 *ym2612_940;
#endif
void memset32(int *dest, int c, int count);
#ifndef __GNUC__
#pragma warning (disable:4100) // unreferenced formal parameter