0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0c,0x0d,\r
};\r
\r
-// vcounter values for PicoFrameSimple \r
+// vcounter values for PicoFrameSimple\r
const unsigned short vcounts[] = {\r
0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,\r
8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16,\r
\r
Pico.m.sram_reg = (unsigned char) sreg;\r
}\r
+\r
+\r
+#ifndef _ASM_MISC_C\r
+void memcpy16(unsigned short *dest, unsigned short *src, int count)\r
+{\r
+ while (count--)\r
+ *dest++ = *src++;\r
+}\r
+\r
+\r
+void memcpy32(int *dest, int *src, int count)\r
+{\r
+ while (count--)\r
+ *dest++ = *src++;\r
+}\r
+\r
+\r
+void memset32(int *dest, int c, int count)\r
+{\r
+ while (count--)\r
+ *dest++ = c;\r
+}\r
+#endif\r
+\r
void SRAMWriteEEPROM(unsigned int d);\r
unsigned int SRAMReadEEPROM();\r
void SRAMUpdPending(unsigned int a, unsigned int d);\r
+void memcpy16(unsigned short *dest, unsigned short *src, int count);\r
+void memcpy32(int *dest, int *src, int count);\r
+void memset32(int *dest, int c, int count);\r
\r
\r
#ifdef __cplusplus\r
{\r
case 1: // vram\r
r = Pico.vram;\r
- for(; len; len--)\r
+ if (inc == 2 && !(a&1) && a+len*2 < 0x10000)\r
{\r
- d=*pd++;\r
- if(a&1) d=(d<<8)|(d>>8);\r
- r[a>>1] = (u16)d; // will drop the upper bits\r
- // AutoIncrement\r
- a=(u16)(a+inc);\r
- // didn't src overlap?\r
- //if(pd >= pdend) pd-=0x8000; // should be good for RAM, bad for ROM\r
+ // most used DMA mode\r
+ memcpy16(r + (a>>1), pd, len);\r
+ a += len*2;\r
+ }\r
+ else\r
+ {\r
+ for(; len; len--)\r
+ {\r
+ d=*pd++;\r
+ if(a&1) d=(d<<8)|(d>>8);\r
+ r[a>>1] = (u16)d; // will drop the upper bits\r
+ // AutoIncrement\r
+ a=(u16)(a+inc);\r
+ // didn't src overlap?\r
+ //if(pd >= pdend) pd-=0x8000; // should be good for RAM, bad for ROM\r
+ }\r
}\r
rendstatus|=0x10;\r
break;\r
}
-
-
-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;
}
+/* 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)
+{
+}
+
-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);
@ 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
#include <math.h>\r
\r
#include "ym2612.h"\r
-#include "mix.h"\r
\r
#ifndef EXTERNAL_YM2612\r
#include <stdlib.h>\r
\r
#endif\r
\r
+void memset32(int *dest, int c, int count);\r
+\r
\r
#ifndef __GNUC__\r
#pragma warning (disable:4100) // unreferenced formal parameter\r
asm_memory = 0 # TODO\r
asm_render = 1\r
asm_ym2612 = 1\r
+asm_misc = 1\r
#profile = 1\r
#use_musashi = 1\r
#up = 1\r
DEFINC += -D_ASM_YM2612_C\r
OBJS += ../../Pico/sound/ym2612_asm.o\r
endif\r
+ifeq "$(asm_misc)" "1"\r
+DEFINC += -D_ASM_MISC_C\r
+OBJS += ../../Pico/misc_asm.o\r
+endif\r
# Pico - sound\r
OBJS += ../../Pico/sound/mix_asm.o\r
OBJS += ../../Pico/sound/sound.o ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o\r
../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s\r
@echo $<\r
@$(AS) $(ASOPT) $< -o $@\r
+../../Pico/misc_asm.o : ../../Pico/misc.s\r
+ @echo $<\r
+ @$(AS) $(ASOPT) $< -o $@\r
\r
# build Cyclone\r
../../cpu/Cyclone/proj/Cyclone.s :\r
// if in 16bit mode, generate 8it image for menu background\r
if (!(PicoOpt&0x10) && (currentConfig.EmuOpt&0x80)) {\r
PicoOpt |= 0x10;\r
+ Pico.m.dirtyPal = 1;\r
PicoFrameFull();\r
blit("", NULL); blit("", NULL); blit("", NULL); blit("", NULL); // be sure buffer3 gets updated\r
PicoOpt &= ~0x10;\r
}
-/* 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)
-{
-}
-