mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 06:47:45 -04:00
buffering, PCM DMA, memcpy12bswap
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@66 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
af6e9c4961
commit
5f9922e6c2
5 changed files with 29 additions and 4 deletions
|
@ -43,7 +43,7 @@ OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Utils.o ../../Pico/Memory
|
||||||
# Pico - CD
|
# Pico - CD
|
||||||
OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \
|
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/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
|
||||||
# asm stuff
|
# asm stuff
|
||||||
ifeq "$(asm_render)" "1"
|
ifeq "$(asm_render)" "1"
|
||||||
DEFINC += -D_ASM_DRAW_C
|
DEFINC += -D_ASM_DRAW_C
|
||||||
|
|
|
@ -496,6 +496,7 @@ int emu_ReadConfig(int game)
|
||||||
currentConfig.KeyBinds[23] = 1<<29; // vol up
|
currentConfig.KeyBinds[23] = 1<<29; // vol up
|
||||||
currentConfig.KeyBinds[22] = 1<<30; // vol down
|
currentConfig.KeyBinds[22] = 1<<30; // vol down
|
||||||
currentConfig.gamma = 100;
|
currentConfig.gamma = 100;
|
||||||
|
currentConfig.PicoCDBuffers = 64;
|
||||||
strncpy(cfg, PicoConfigFile, 511);
|
strncpy(cfg, PicoConfigFile, 511);
|
||||||
cfg[511] = 0;
|
cfg[511] = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -517,6 +518,7 @@ int emu_ReadConfig(int game)
|
||||||
PsndRate = currentConfig.PsndRate;
|
PsndRate = currentConfig.PsndRate;
|
||||||
PicoRegionOverride = currentConfig.PicoRegion;
|
PicoRegionOverride = currentConfig.PicoRegion;
|
||||||
PicoAutoRgnOrder = currentConfig.PicoAutoRgnOrder;
|
PicoAutoRgnOrder = currentConfig.PicoAutoRgnOrder;
|
||||||
|
PicoCDBuffers = currentConfig.PicoCDBuffers;
|
||||||
if (PicoOpt & 0x20) {
|
if (PicoOpt & 0x20) {
|
||||||
actionNames[ 8] = "Z"; actionNames[ 9] = "Y";
|
actionNames[ 8] = "Z"; actionNames[ 9] = "Y";
|
||||||
actionNames[10] = "X"; actionNames[11] = "MODE";
|
actionNames[10] = "X"; actionNames[11] = "MODE";
|
||||||
|
@ -555,6 +557,7 @@ int emu_WriteConfig(int game)
|
||||||
currentConfig.PsndRate = PsndRate;
|
currentConfig.PsndRate = PsndRate;
|
||||||
currentConfig.PicoRegion = PicoRegionOverride;
|
currentConfig.PicoRegion = PicoRegionOverride;
|
||||||
currentConfig.PicoAutoRgnOrder = PicoAutoRgnOrder;
|
currentConfig.PicoAutoRgnOrder = PicoAutoRgnOrder;
|
||||||
|
currentConfig.PicoCDBuffers = PicoCDBuffers;
|
||||||
bwrite = fwrite(¤tConfig, 1, sizeof(currentConfig), f);
|
bwrite = fwrite(¤tConfig, 1, sizeof(currentConfig), f);
|
||||||
fflush(f);
|
fflush(f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
@ -1068,6 +1071,9 @@ void emu_Loop(void)
|
||||||
PsndOut = 0;
|
PsndOut = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// prepare CD buffer
|
||||||
|
if (PicoMCD & 1) PicoCDBufferInit();
|
||||||
|
|
||||||
// loop?
|
// loop?
|
||||||
while (engineState == PGS_Running)
|
while (engineState == PGS_Running)
|
||||||
{
|
{
|
||||||
|
@ -1253,6 +1259,9 @@ if (Pico.m.frame_count == 31563) {
|
||||||
frames_done++; frames_shown++;
|
frames_done++; frames_shown++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (PicoMCD & 1) PicoCDBufferFree();
|
||||||
|
|
||||||
// save SRAM
|
// save SRAM
|
||||||
if((currentConfig.EmuOpt & 1) && SRam.changed) {
|
if((currentConfig.EmuOpt & 1) && SRam.changed) {
|
||||||
osd_text(4, 232, "Writing SRAM/BRAM..");
|
osd_text(4, 232, "Writing SRAM/BRAM..");
|
||||||
|
|
|
@ -31,6 +31,7 @@ typedef struct {
|
||||||
int gamma;
|
int gamma;
|
||||||
int JoyBinds[4][32];
|
int JoyBinds[4][32];
|
||||||
int PicoAutoRgnOrder;
|
int PicoAutoRgnOrder;
|
||||||
|
int PicoCDBuffers;
|
||||||
} currentConfig_t;
|
} currentConfig_t;
|
||||||
|
|
||||||
extern char romFileName[];
|
extern char romFileName[];
|
||||||
|
|
19
gp2x/menu.c
19
gp2x/menu.c
|
@ -729,6 +729,10 @@ static void kc_sel_loop(void)
|
||||||
static void draw_cd_menu_options(int menu_sel, char *b_us, char *b_eu, char *b_jp)
|
static void draw_cd_menu_options(int menu_sel, char *b_us, char *b_eu, char *b_jp)
|
||||||
{
|
{
|
||||||
int tl_x = 25, tl_y = 60, y;
|
int tl_x = 25, tl_y = 60, y;
|
||||||
|
char ra_buff[16];
|
||||||
|
|
||||||
|
if (PicoCDBuffers > 1) sprintf(ra_buff, "%5iK", PicoCDBuffers * 2);
|
||||||
|
else strcpy(ra_buff, " OFF");
|
||||||
|
|
||||||
y = tl_y;
|
y = tl_y;
|
||||||
//memset(gp2x_screen, 0, 320*240);
|
//memset(gp2x_screen, 0, 320*240);
|
||||||
|
@ -741,6 +745,7 @@ static void draw_cd_menu_options(int menu_sel, char *b_us, char *b_eu, char *b_j
|
||||||
gp2x_text_out8(tl_x, (y+=10), "CDDA audio (using mp3s) %s", (currentConfig.PicoOpt&0x0800)?"ON":"OFF"); // 4
|
gp2x_text_out8(tl_x, (y+=10), "CDDA audio (using mp3s) %s", (currentConfig.PicoOpt&0x0800)?"ON":"OFF"); // 4
|
||||||
gp2x_text_out8(tl_x, (y+=10), "PCM audio %s", (currentConfig.PicoOpt&0x0400)?"ON":"OFF"); // 5
|
gp2x_text_out8(tl_x, (y+=10), "PCM audio %s", (currentConfig.PicoOpt&0x0400)?"ON":"OFF"); // 5
|
||||||
gp2x_text_out8(tl_x, (y+=10), "Better sync (very slow) %s", (currentConfig.PicoOpt&0x2000)?"ON":"OFF"); // 6
|
gp2x_text_out8(tl_x, (y+=10), "Better sync (very slow) %s", (currentConfig.PicoOpt&0x2000)?"ON":"OFF"); // 6
|
||||||
|
gp2x_text_out8(tl_x, (y+=10), "ReadAhead buffer %s", ra_buff); // 7
|
||||||
gp2x_text_out8(tl_x, (y+=10), "Done");
|
gp2x_text_out8(tl_x, (y+=10), "Done");
|
||||||
|
|
||||||
// draw cursor
|
// draw cursor
|
||||||
|
@ -756,7 +761,7 @@ static void draw_cd_menu_options(int menu_sel, char *b_us, char *b_eu, char *b_j
|
||||||
|
|
||||||
static void cd_menu_loop_options(void)
|
static void cd_menu_loop_options(void)
|
||||||
{
|
{
|
||||||
int menu_sel = 0, menu_sel_max = 7;
|
int menu_sel = 0, menu_sel_max = 8;
|
||||||
unsigned long inp = 0;
|
unsigned long inp = 0;
|
||||||
char bios_us[32], bios_eu[32], bios_jp[32], *bios, *p;
|
char bios_us[32], bios_eu[32], bios_jp[32], *bios, *p;
|
||||||
|
|
||||||
|
@ -787,7 +792,17 @@ static void cd_menu_loop_options(void)
|
||||||
case 4: currentConfig.PicoOpt^=0x0800; break;
|
case 4: currentConfig.PicoOpt^=0x0800; break;
|
||||||
case 5: currentConfig.PicoOpt^=0x0400; break;
|
case 5: currentConfig.PicoOpt^=0x0400; break;
|
||||||
case 6: currentConfig.PicoOpt^=0x2000; break;
|
case 6: currentConfig.PicoOpt^=0x2000; break;
|
||||||
case 7: return;
|
case 7:
|
||||||
|
if (inp & GP2X_LEFT) {
|
||||||
|
PicoCDBuffers >>= 1;
|
||||||
|
if (PicoCDBuffers < 64) PicoCDBuffers = 0;
|
||||||
|
} else {
|
||||||
|
if (PicoCDBuffers < 64) PicoCDBuffers = 64;
|
||||||
|
else PicoCDBuffers <<= 1;
|
||||||
|
if (PicoCDBuffers > 4096) PicoCDBuffers = 4096;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 8: return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(inp & (GP2X_X|GP2X_A)) return;
|
if(inp & (GP2X_X|GP2X_A)) return;
|
||||||
|
|
|
@ -32,7 +32,7 @@ OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Utils.o ../../Pico/Memory
|
||||||
# Pico - CD
|
# Pico - CD
|
||||||
OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \
|
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/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
|
# Pico - sound
|
||||||
OBJS += ../../Pico/sound/sound.o ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o ../../Pico/sound/mix.o
|
OBJS += ../../Pico/sound/sound.o ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o ../../Pico/sound/mix.o
|
||||||
# zlib
|
# zlib
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue