mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 14:57:46 -04:00
work on 'vblank on line start' problem, var changes, mask defines
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@408 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
0fb424dbee
commit
dd5fd4778d
10 changed files with 58 additions and 725 deletions
|
@ -70,9 +70,9 @@ static void custom_write(FILE *f, const menu_entry *me, int no_def)
|
|||
switch (me->id)
|
||||
{
|
||||
case MA_OPT_RENDERER:
|
||||
if (no_def && !((defaultConfig.s_PicoOpt^PicoOpt)&0x10) &&
|
||||
if (no_def && !((defaultConfig.s_PicoOpt^PicoOpt)&POPT_ALT_RENDERER) &&
|
||||
!((defaultConfig.EmuOpt^currentConfig.EmuOpt)&0x80)) return;
|
||||
if (PicoOpt&0x10)
|
||||
if (PicoOpt&POPT_ALT_RENDERER)
|
||||
str = "8bit fast";
|
||||
else if (currentConfig.EmuOpt&0x80)
|
||||
str = "16bit accurate";
|
||||
|
@ -99,9 +99,9 @@ static void custom_write(FILE *f, const menu_entry *me, int no_def)
|
|||
fprintf(f, "Frameskip = %s", str24);
|
||||
break;
|
||||
case MA_OPT_SOUND_QUALITY:
|
||||
if (no_def && !((defaultConfig.s_PicoOpt^PicoOpt)&8) &&
|
||||
if (no_def && !((defaultConfig.s_PicoOpt^PicoOpt)&POPT_EN_STEREO) &&
|
||||
defaultConfig.s_PsndRate == PsndRate) return;
|
||||
str = (PicoOpt&0x08)?"stereo":"mono";
|
||||
str = (PicoOpt&POPT_EN_STEREO)?"stereo":"mono";
|
||||
fprintf(f, "Sound Quality = %i %s", PsndRate, str);
|
||||
break;
|
||||
case MA_OPT_REGION:
|
||||
|
@ -438,14 +438,14 @@ static int custom_read(menu_entry *me, const char *var, const char *val)
|
|||
case MA_OPT_RENDERER:
|
||||
if (strcasecmp(var, "Renderer") != 0) return 0;
|
||||
if (strcasecmp(val, "8bit fast") == 0) {
|
||||
PicoOpt |= 0x10;
|
||||
PicoOpt |= POPT_ALT_RENDERER;
|
||||
}
|
||||
else if (strcasecmp(val, "16bit accurate") == 0) {
|
||||
PicoOpt &= ~0x10;
|
||||
PicoOpt &= ~POPT_ALT_RENDERER;
|
||||
currentConfig.EmuOpt |= 0x80;
|
||||
}
|
||||
else if (strcasecmp(val, "8bit accurate") == 0) {
|
||||
PicoOpt &= ~0x10;
|
||||
PicoOpt &= ~POPT_ALT_RENDERER;
|
||||
currentConfig.EmuOpt &= ~0x80;
|
||||
}
|
||||
else
|
||||
|
@ -480,9 +480,9 @@ static int custom_read(menu_entry *me, const char *var, const char *val)
|
|||
PsndRate = 22050;
|
||||
while (*tmp == ' ') tmp++;
|
||||
if (strcasecmp(tmp, "stereo") == 0) {
|
||||
PicoOpt |= 8;
|
||||
PicoOpt |= POPT_EN_STEREO;
|
||||
} else if (strcasecmp(tmp, "mono") == 0) {
|
||||
PicoOpt &= ~8;
|
||||
PicoOpt &= ~POPT_EN_STEREO;
|
||||
} else
|
||||
return 0;
|
||||
return 1;
|
||||
|
|
36
common/emu.c
36
common/emu.c
|
@ -235,7 +235,7 @@ char *emu_makeRomId(void)
|
|||
static char id_string[3+0x11+0x11+0x30+16];
|
||||
int pos, swab = 1;
|
||||
|
||||
if (PicoMCD & 1) {
|
||||
if (PicoAHW & PAHW_MCD) {
|
||||
strcpy(id_string, "CD|");
|
||||
swab = 0;
|
||||
}
|
||||
|
@ -325,14 +325,14 @@ int emu_ReloadRom(void)
|
|||
get_ext(romFileName, ext);
|
||||
}
|
||||
|
||||
if ((PicoMCD & 1) && Pico_mcd != NULL)
|
||||
if ((PicoAHW & PAHW_MCD) && Pico_mcd != NULL)
|
||||
Stop_CD();
|
||||
|
||||
// check for MegaCD image
|
||||
cd_state = emu_cdCheck(&cd_region);
|
||||
if (cd_state > 0)
|
||||
{
|
||||
PicoMCD |= 1;
|
||||
PicoAHW |= PAHW_MCD;
|
||||
// valid CD image, check for BIOS..
|
||||
|
||||
// we need to have config loaded at this point
|
||||
|
@ -346,7 +346,7 @@ int emu_ReloadRom(void)
|
|||
}
|
||||
if (!emu_findBios(cd_region, &used_rom_name)) {
|
||||
// bios_help() ?
|
||||
PicoMCD &= ~1;
|
||||
PicoAHW &= ~PAHW_MCD;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -354,8 +354,8 @@ int emu_ReloadRom(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (PicoMCD & 1) Stop_CD();
|
||||
PicoMCD &= ~1;
|
||||
if (PicoAHW & PAHW_MCD) Stop_CD();
|
||||
PicoAHW &= ~PAHW_MCD;
|
||||
}
|
||||
|
||||
rom = pm_open(used_rom_name);
|
||||
|
@ -388,7 +388,7 @@ int emu_ReloadRom(void)
|
|||
}
|
||||
|
||||
// load config for this ROM (do this before insert to get correct region)
|
||||
if (!(PicoMCD&1))
|
||||
if (!(PicoAHW & PAHW_MCD))
|
||||
memcpy(id_header, rom_data + 0x100, sizeof(id_header));
|
||||
if (!cfg_loaded) {
|
||||
ret = emu_ReadConfig(1, 1);
|
||||
|
@ -425,9 +425,9 @@ int emu_ReloadRom(void)
|
|||
// additional movie stuff
|
||||
if (movie_data) {
|
||||
if(movie_data[0x14] == '6')
|
||||
PicoOpt |= 0x20; // 6 button pad
|
||||
else PicoOpt &= ~0x20;
|
||||
PicoOpt |= 0x10040; // accurate timing, no VDP fifo timing
|
||||
PicoOpt |= POPT_6BTN_PAD; // 6 button pad
|
||||
else PicoOpt &= ~POPT_6BTN_PAD;
|
||||
PicoOpt |= POPT_DIS_VDP_FIFO|POPT_ACC_TIMING; // accurate timing, no VDP fifo timing
|
||||
if(movie_data[0xF] >= 'A') {
|
||||
if(movie_data[0x16] & 0x80) {
|
||||
PicoRegionOverride = 8;
|
||||
|
@ -442,7 +442,7 @@ int emu_ReloadRom(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
PicoOpt &= ~0x10000;
|
||||
PicoOpt &= ~POPT_DIS_VDP_FIFO;
|
||||
if(Pico.m.pal) {
|
||||
strcpy(noticeMsg, "PAL SYSTEM / 50 FPS");
|
||||
} else {
|
||||
|
@ -773,11 +773,11 @@ char *emu_GetSaveFName(int load, int is_sram, int slot)
|
|||
|
||||
if (is_sram)
|
||||
{
|
||||
romfname_ext(saveFname, (PicoMCD&1) ? "brm/" : "srm/", (PicoMCD&1) ? ".brm" : ".srm");
|
||||
romfname_ext(saveFname, (PicoAHW&1) ? "brm/" : "srm/", (PicoAHW&1) ? ".brm" : ".srm");
|
||||
if (load) {
|
||||
if (try_ropen_file(saveFname)) return saveFname;
|
||||
// try in current dir..
|
||||
romfname_ext(saveFname, NULL, (PicoMCD&1) ? ".brm" : ".srm");
|
||||
romfname_ext(saveFname, NULL, (PicoAHW & PAHW_MCD) ? ".brm" : ".srm");
|
||||
if (try_ropen_file(saveFname)) return saveFname;
|
||||
return NULL; // give up
|
||||
}
|
||||
|
@ -855,8 +855,9 @@ int emu_SaveLoadGame(int load, int sram)
|
|||
int sram_size;
|
||||
unsigned char *sram_data;
|
||||
int truncate = 1;
|
||||
if (PicoMCD&1) {
|
||||
if (PicoOpt&0x8000) { // MCD RAM cart?
|
||||
if (PicoAHW & PAHW_MCD)
|
||||
{
|
||||
if (PicoOpt&POPT_EN_MCD_RAMCART) {
|
||||
sram_size = 0x12000;
|
||||
sram_data = SRam.data;
|
||||
if (sram_data)
|
||||
|
@ -873,12 +874,13 @@ int emu_SaveLoadGame(int load, int sram)
|
|||
}
|
||||
if (!sram_data) return 0; // SRam forcefully disabled for this game
|
||||
|
||||
if (load) {
|
||||
if (load)
|
||||
{
|
||||
sramFile = fopen(saveFname, "rb");
|
||||
if(!sramFile) return -1;
|
||||
fread(sram_data, 1, sram_size, sramFile);
|
||||
fclose(sramFile);
|
||||
if ((PicoMCD&1) && (PicoOpt&0x8000))
|
||||
if ((PicoAHW & PAHW_MCD) && (PicoOpt&POPT_EN_MCD_RAMCART))
|
||||
memcpy32((int *)Pico_mcd->bram, (int *)sram_data, 0x2000/4);
|
||||
} else {
|
||||
// sram save needs some special processing
|
||||
|
|
|
@ -180,7 +180,7 @@ void mp3_start_play(FILE *f, int pos)
|
|||
mp3_current_file = NULL;
|
||||
mp3_buffer_offs = 0;
|
||||
|
||||
if (!(PicoOpt&0x800) || f == NULL) // cdda disabled or no file?
|
||||
if (!(PicoOpt&POPT_EN_MCD_CDDA) || f == NULL) // cdda disabled or no file?
|
||||
return;
|
||||
|
||||
//lprintf("mp3_start_play %p %i\n", f, pos);
|
||||
|
@ -204,7 +204,7 @@ int mp3_get_offset(void)
|
|||
unsigned int offs1024 = 0;
|
||||
int cdda_on;
|
||||
|
||||
cdda_on = (PicoMCD & 1) && (PicoOpt&0x800) && !(Pico_mcd->s68k_regs[0x36] & 1) &&
|
||||
cdda_on = (PicoAHW & PAHW_MCD) && (PicoOpt&POPT_EN_MCD_CDDA) && !(Pico_mcd->s68k_regs[0x36] & 1) &&
|
||||
(Pico_mcd->scd.Status_CDC & 1) && mp3_current_file != NULL;
|
||||
|
||||
if (cdda_on) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue