# Pico - CD\r
OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r
../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \\r
- ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o\r
+ ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o\r
# asm stuff\r
ifeq "$(asm_render)" "1"\r
DEFINC += -D_ASM_DRAW_C\r
currentConfig.KeyBinds[23] = 1<<29; // vol up\r
currentConfig.KeyBinds[22] = 1<<30; // vol down\r
currentConfig.gamma = 100;\r
+ currentConfig.PicoCDBuffers = 64;\r
strncpy(cfg, PicoConfigFile, 511);\r
cfg[511] = 0;\r
} else {\r
PsndRate = currentConfig.PsndRate;\r
PicoRegionOverride = currentConfig.PicoRegion;\r
PicoAutoRgnOrder = currentConfig.PicoAutoRgnOrder;\r
+ PicoCDBuffers = currentConfig.PicoCDBuffers;\r
if (PicoOpt & 0x20) {\r
actionNames[ 8] = "Z"; actionNames[ 9] = "Y";\r
actionNames[10] = "X"; actionNames[11] = "MODE";\r
currentConfig.PsndRate = PsndRate;\r
currentConfig.PicoRegion = PicoRegionOverride;\r
currentConfig.PicoAutoRgnOrder = PicoAutoRgnOrder;\r
+ currentConfig.PicoCDBuffers = PicoCDBuffers;\r
bwrite = fwrite(¤tConfig, 1, sizeof(currentConfig), f);\r
fflush(f);\r
fclose(f);\r
PsndOut = 0;\r
}\r
\r
+ // prepare CD buffer\r
+ if (PicoMCD & 1) PicoCDBufferInit();\r
+\r
// loop?\r
while (engineState == PGS_Running)\r
{\r
frames_done++; frames_shown++;\r
}\r
\r
+\r
+ if (PicoMCD & 1) PicoCDBufferFree();\r
+\r
// save SRAM\r
if((currentConfig.EmuOpt & 1) && SRam.changed) {\r
osd_text(4, 232, "Writing SRAM/BRAM..");\r
int gamma;\r
int JoyBinds[4][32];\r
int PicoAutoRgnOrder;\r
+ int PicoCDBuffers;\r
} currentConfig_t;\r
\r
extern char romFileName[];\r
static void draw_cd_menu_options(int menu_sel, char *b_us, char *b_eu, char *b_jp)\r
{\r
int tl_x = 25, tl_y = 60, y;\r
+ char ra_buff[16];\r
+\r
+ if (PicoCDBuffers > 1) sprintf(ra_buff, "%5iK", PicoCDBuffers * 2);\r
+ else strcpy(ra_buff, " OFF");\r
\r
y = tl_y;\r
//memset(gp2x_screen, 0, 320*240);\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 (very 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
// draw cursor\r
\r
static void cd_menu_loop_options(void)\r
{\r
- int menu_sel = 0, menu_sel_max = 7;\r
+ int menu_sel = 0, menu_sel_max = 8;\r
unsigned long inp = 0;\r
char bios_us[32], bios_eu[32], bios_jp[32], *bios, *p;\r
\r
case 4: currentConfig.PicoOpt^=0x0800; break;\r
case 5: currentConfig.PicoOpt^=0x0400; break;\r
case 6: currentConfig.PicoOpt^=0x2000; break;\r
- case 7: return;\r
+ case 7:\r
+ if (inp & GP2X_LEFT) {\r
+ PicoCDBuffers >>= 1;\r
+ if (PicoCDBuffers < 64) PicoCDBuffers = 0;\r
+ } else {\r
+ if (PicoCDBuffers < 64) PicoCDBuffers = 64;\r
+ else PicoCDBuffers <<= 1;\r
+ if (PicoCDBuffers > 4096) PicoCDBuffers = 4096;\r
+ }\r
+ break;\r
+ case 8: return;\r
}\r
}\r
if(inp & (GP2X_X|GP2X_A)) return;\r
# Pico - CD
OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \
../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \
- ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o
+ ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o
# Pico - sound
OBJS += ../../Pico/sound/sound.o ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o ../../Pico/sound/mix.o
# zlib