\r
switch( a ) {\r
case 0: /* address port 0 */\r
+ if (!addr_A1 && ST_address == v)\r
+ return 0; /* address already selected, don't send this command to 940 */\r
ST_address = v;\r
+ /* don't send DAC or timer related address changes to 940 */\r
+ if (!addr_A1 && (v & 0xf0) == 0x20 &&\r
+ (v == 0x24 || v == 0x25 || v == 0x26 || v == 0x2a))\r
+ return 0;\r
addr_A1 = 0;\r
//ret=0;\r
break;\r
break;\r
\r
case 2: /* address port 1 */\r
+ if (addr_A1 && ST_address == v)\r
+ return 0;\r
ST_address = v;\r
addr_A1 = 1;\r
//ret=0;\r
shared_ctl->writebuff1[writebuff_ptr++] = (a<<8)|v;\r
}\r
} else {\r
- printf("warning: writebuff_ptr > 2047\n");\r
+ printf("warning: writebuff_ptr > 2047 ([%i] %02x)\n", a, v);\r
}\r
}\r
\r
asm_ym2612 = 1\r
asm_misc = 1\r
asm_cdpico = 1\r
+asm_cdmemory = 1\r
#profile = 1\r
#use_musashi = 1\r
#up = 1\r
DEFINC += -D_ASM_CD_PICO_C\r
OBJS += ../../Pico/cd/pico_asm.o\r
endif\r
+ifeq "$(asm_cdmemory)" "1"\r
+DEFINC += -D_ASM_CD_MEMORY_C\r
+OBJS += ../../Pico/cd/memory_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/cd/pico_asm.o : ../../Pico/cd/Pico.s\r
@echo $<\r
@$(AS) $(ASOPT) $< -o $@\r
+../../Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s\r
+ @echo $<\r
+ @$(AS) $(ASOPT) $< -o $@\r
\r
# build Cyclone\r
../../cpu/Cyclone/proj/Cyclone.s :\r
}\r
\r
\r
-static void SkipFrame(int do_sound)\r
+static void SkipFrame(void)\r
{\r
- void *sndbuff_tmp = 0;\r
- if (PsndOut && !do_sound) {\r
- sndbuff_tmp = PsndOut;\r
- PsndOut = 0;\r
- }\r
-\r
PicoSkipFrame=1;\r
PicoFrame();\r
PicoSkipFrame=0;\r
-\r
- if (sndbuff_tmp && !do_sound) {\r
- PsndOut = sndbuff_tmp;\r
- }\r
}\r
\r
\r
// when second changes, but we don't want buffer to starve.\r
if(PsndOut && frames_done < target_fps && frames_done > target_fps-5) {\r
updateKeys();\r
- SkipFrame(1); frames_done++;\r
+ SkipFrame(); frames_done++;\r
}\r
\r
frames_done -= target_fps; if (frames_done < 0) frames_done = 0;\r
if(currentConfig.Frameskip >= 0) { // frameskip enabled\r
for(i = 0; i < currentConfig.Frameskip; i++) {\r
updateKeys();\r
- SkipFrame(1); frames_done++;\r
+ SkipFrame(); frames_done++;\r
if (PsndOut) { // do framelimitting if sound is enabled\r
gettimeofday(&tval, 0);\r
if(thissec != tval.tv_sec) tval.tv_usec+=1000000;\r
}\r
} else if(tval.tv_usec > lim_time) { // auto frameskip\r
// no time left for this frame - skip\r
+ if (tval.tv_usec - lim_time >= 0x300000) {\r
+ /* something caused a slowdown for us (disk access? cache flush?)\r
+ * try to recover by resetting timing... */\r
+ reset_timing = 1;\r
+ continue;\r
+ }\r
updateKeys();\r
- SkipFrame(tval.tv_usec < lim_time+target_frametime); frames_done++;\r
+ SkipFrame(/*tval.tv_usec < lim_time+target_frametime*/); frames_done++;\r
continue;\r
}\r
\r
\r
// check time\r
gettimeofday(&tval, 0);\r
- if(thissec != tval.tv_sec) tval.tv_usec+=1000000;\r
+ if (thissec != tval.tv_sec) tval.tv_usec+=1000000;\r
\r
- // sleep if we are still too fast\r
- if(PsndOut != 0 || currentConfig.Frameskip < 0)\r
+ if (currentConfig.Frameskip < 0 && tval.tv_usec - lim_time >= 0x300000) // slowdown detection\r
+ reset_timing = 1;\r
+ else if (PsndOut != NULL || currentConfig.Frameskip < 0)\r
{\r
+ // sleep if we are still too fast\r
// usleep sleeps for ~20ms minimum, so it is not a solution here\r
- gettimeofday(&tval, 0);\r
- if(thissec != tval.tv_sec) tval.tv_usec+=1000000;\r
if(tval.tv_usec < lim_time)\r
{\r
// we are too fast\r
gp2x_text_out8(tl_x, (y+=10), "CD LEDs %s", (currentConfig.EmuOpt &0x0400)?"ON":"OFF"); // 3\r
gp2x_text_out8(tl_x, (y+=10), "CDDA audio (using mp3s) %s", (currentConfig.PicoOpt&0x0800)?"ON":"OFF"); // 4\r
gp2x_text_out8(tl_x, (y+=10), "PCM audio %s", (currentConfig.PicoOpt&0x0400)?"ON":"OFF"); // 5\r
- gp2x_text_out8(tl_x, (y+=10), "Better sync (slower) %s", (currentConfig.PicoOpt&0x2000)?"ON":"OFF"); // 6\r
+ gp2x_text_out8(tl_x, (y+=10), "Better sync (slow) %s", (currentConfig.PicoOpt&0x2000)?"ON":"OFF"); // 6\r
gp2x_text_out8(tl_x, (y+=10), "ReadAhead buffer %s", ra_buff); // 7\r
gp2x_text_out8(tl_x, (y+=10), "Done");\r
\r