Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libretro-common/include/libretro.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ enum retro_language
/* Video ram lets a frontend peek into a game systems video RAM (VRAM). */
#define RETRO_MEMORY_VIDEO_RAM 3

/* ROM lets a frontend peek into a game systems ROM. */
#define RETRO_MEMORY_ROM 4

/* Keysyms used for ID in input state callback when polling RETRO_KEYBOARD. */
enum retro_key
{
Expand Down
14 changes: 14 additions & 0 deletions libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,16 @@ static void check_variables(bool first_run)
do_cdsettings = true;
setting_pce_fast_cdpsgvolume = atoi(var.value);
}

var.key = "pce_fast_cdignoreerrors";
setting_pce_fast_cdignoreerrors = false;

if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
if (strcmp(var.value, "enabled") == 0)
{
setting_pce_fast_cdignoreerrors = true;
}


var.key = "pce_fast_cdspeed";

Expand Down Expand Up @@ -2615,6 +2625,8 @@ void *retro_get_memory_data(unsigned type)
return BaseRAM;
case RETRO_MEMORY_VIDEO_RAM:
return vdc->VRAM;
case RETRO_MEMORY_ROM:
return ROMSpace;
default:
break;
}
Expand All @@ -2634,6 +2646,8 @@ size_t retro_get_memory_size(unsigned type)
return 8192;
case RETRO_MEMORY_VIDEO_RAM:
return 65536;
case RETRO_MEMORY_ROM:
return (0x88 * 8192 + 8192); // TODO: dynamic based on loaded content?
default:
break;
}
Expand Down
15 changes: 15 additions & 0 deletions libretro_core_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,21 @@ struct retro_core_option_v2_definition option_defs_us[] = {
},
"100"
},
{
"pce_fast_cdignoreerrors",
"CD Ignore EDC/L-EC Errors",
NULL,
"Ignore EDC/L-EC errors. Needed for compatibility with some hacks.",
NULL,
"cd",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},

{
"pce_fast_nospritelimit",
"No Sprite Limit",
Expand Down
9 changes: 8 additions & 1 deletion mednafen/pce_fast/pcecd_drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ static int32 CDReadTimer;
static uint32 SectorAddr;
static uint32 SectorCount;

bool setting_pce_fast_cdignoreerrors;


enum
{
Expand Down Expand Up @@ -412,7 +414,12 @@ static void CommandCCError(int key, int asc = 0, int ascq = 0)

static bool ValidateRawDataSector(uint8 *data, const uint32 lba)
{
if(!edc_lec_check_and_correct(data, false))
bool c = edc_lec_check_and_correct(data, false);

//if(!c)
// printf("failed ValidateRawDataSector: %x\n", lba);

if(!c && !setting_pce_fast_cdignoreerrors)
{
din.Flush();
cd.data_transfer_done = false;
Expand Down
1 change: 1 addition & 0 deletions mednafen/pce_fast/pcecd_drive.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct pcecd_drive_bus_t
};

extern pcecd_drive_bus_t cd_bus; // Don't access this structure directly by name outside of pcecd_drive.c, but use the macros below.
extern bool setting_pce_fast_cdignoreerrors;

// Signals under our(the "target") control.
#define PCECD_Drive_IO_mask 0x001
Expand Down
16 changes: 8 additions & 8 deletions mednafen/pce_fast/psg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ void PCEFast_PSG::UpdateOutput_Norm(const int32 timestamp, psg_channel *ch)

if(ch->user_volume < 100)
{
delta0 = (samp[0] - ch->blip_prev_samp[0]) * ch->user_volume / 100;
delta1 = (samp[1] - ch->blip_prev_samp[1]) * ch->user_volume / 100;
delta0 = ((samp[0] - ch->blip_prev_samp[0]) * ch->user_volume * 164) >> 14;
delta1 = ((samp[1] - ch->blip_prev_samp[1]) * ch->user_volume * 164) >> 14;
} else {
delta0 = samp[0] - ch->blip_prev_samp[0];
delta1 = samp[1] - ch->blip_prev_samp[1];
Expand All @@ -76,8 +76,8 @@ void PCEFast_PSG::UpdateOutput_Noise(const int32 timestamp, psg_channel *ch)

if(ch->user_volume < 100)
{
delta0 = (samp[0] - ch->blip_prev_samp[0]) * ch->user_volume / 100;
delta1 = (samp[1] - ch->blip_prev_samp[1]) * ch->user_volume / 100;
delta0 = ((samp[0] - ch->blip_prev_samp[0]) * ch->user_volume * 164) >> 14;
delta1 = ((samp[1] - ch->blip_prev_samp[1]) * ch->user_volume * 164) >> 14;
} else {
delta0 = samp[0] - ch->blip_prev_samp[0];
delta1 = samp[1] - ch->blip_prev_samp[1];
Expand All @@ -100,8 +100,8 @@ void PCEFast_PSG::UpdateOutput_Off(const int32 timestamp, psg_channel *ch)

if(ch->user_volume < 100)
{
delta0 = (samp[0] - ch->blip_prev_samp[0]) * ch->user_volume / 100;
delta1 = (samp[1] - ch->blip_prev_samp[1]) * ch->user_volume / 100;
delta0 = ((samp[0] - ch->blip_prev_samp[0]) * ch->user_volume * 164) >> 14;
delta1 = ((samp[1] - ch->blip_prev_samp[1]) * ch->user_volume * 164) >> 14;
} else {
delta0 = samp[0] - ch->blip_prev_samp[0];
delta1 = samp[1] - ch->blip_prev_samp[1];
Expand All @@ -126,8 +126,8 @@ void PCEFast_PSG::UpdateOutput_Accum(const int32 timestamp, psg_channel *ch)

if(ch->user_volume < 100)
{
delta0 = (samp[0] - ch->blip_prev_samp[0]) * ch->user_volume / 100;
delta1 = (samp[1] - ch->blip_prev_samp[1]) * ch->user_volume / 100;
delta0 = ((samp[0] - ch->blip_prev_samp[0]) * ch->user_volume * 164) >> 14;
delta1 = ((samp[1] - ch->blip_prev_samp[1]) * ch->user_volume * 164) >> 14;
} else {
delta0 = samp[0] - ch->blip_prev_samp[0];
delta1 = samp[1] - ch->blip_prev_samp[1];
Expand Down