Unverified Commit 97c91b60 authored by Libretro-Admin's avatar Libretro-Admin Committed by GitHub
Browse files

Revert "Cherrypick changes done between versions 1.21.3 and 1.22.2"

parent af40de6b
......@@ -1252,7 +1252,7 @@ static bool TestMagicCD(std::vector<CDIF *> *CDInterfaces)
return(true);
}
static const char *CalcDiscSCEx_BySYSTEMCNF(CDIF* c, unsigned *rr)
static const char *CalcDiscSCEx_BySYSTEMCNF(CDIF *c, unsigned *rr)
{
uint8_t pvd[2048];
uint32_t rdel, rdel_len;
......@@ -1331,56 +1331,47 @@ static const char *CalcDiscSCEx_BySYSTEMCNF(CDIF* c, unsigned *rr)
fp->seek(file_lba * 2048, SEEK_SET);
fp->read(fb, 2048);
if((bootpos = strstr((char*)fb, "BOOT")))
bootpos = strstr((char*)fb, "BOOT") + 4;
while(*bootpos == ' ' || *bootpos == '\t') bootpos++;
if(*bootpos == '=')
{
bootpos += 4;
bootpos++;
while(*bootpos == ' ' || *bootpos == '\t') bootpos++;
if(*bootpos == '=')
if(!strncasecmp(bootpos, "cdrom:\\", 7))
{
bootpos++;
while(*bootpos == ' ' || *bootpos == '\t') bootpos++;
if(!strncasecmp(bootpos, "cdrom:", 6))
{
char* tmp;
bootpos += 6;
bootpos += 7;
char *tmp;
// strrchr() way will pick up Tekken 3, but only enable if needed due to possibility of regressions.
//if((tmp = strrchr(bootpos, '\\')))
// bootpos = tmp + 1;
while(*bootpos == '\\')
bootpos++;
if((tmp = strchr(bootpos, '_'))) *tmp = 0;
if((tmp = strchr(bootpos, '.'))) *tmp = 0;
if((tmp = strchr(bootpos, ';'))) *tmp = 0;
//puts(bootpos);
if((tmp = strchr(bootpos, '_'))) *tmp = 0;
if((tmp = strchr(bootpos, '.'))) *tmp = 0;
if((tmp = strchr(bootpos, ';'))) *tmp = 0;
//puts(bootpos);
if(strlen(bootpos) == 4 && bootpos[0] == 'S' && (bootpos[1] == 'C' || bootpos[1] == 'L' || bootpos[1] == 'I'))
if(strlen(bootpos) == 4 && bootpos[0] == 'S' && (bootpos[1] == 'C' || bootpos[1] == 'L' || bootpos[1] == 'I'))
{
switch(bootpos[2])
{
switch(bootpos[2])
{
case 'E': if(rr)
*rr = REGION_EU;
ret = "SCEE";
goto Breakout;
case 'U': if(rr)
*rr = REGION_NA;
ret = "SCEA";
goto Breakout;
case 'K': // Korea?
case 'B':
case 'P': if(rr)
*rr = REGION_JP;
ret = "SCEI";
goto Breakout;
}
case 'E': if(rr)
*rr = REGION_EU;
ret = "SCEE";
goto Breakout;
case 'U': if(rr)
*rr = REGION_NA;
ret = "SCEA";
goto Breakout;
case 'K': // Korea?
case 'B':
case 'P': if(rr)
*rr = REGION_JP;
ret = "SCEI";
goto Breakout;
}
}
}
}
//puts((char*)fb);
//puts("ASOFKOASDFKO");
}
......@@ -1393,7 +1384,7 @@ static const char *CalcDiscSCEx_BySYSTEMCNF(CDIF* c, unsigned *rr)
catch(...)
{
}
Breakout:
if(fp)
......@@ -1497,7 +1488,7 @@ static unsigned CalcDiscSCEx(void)
}
static void SetDiscWrapper(const bool CD_TrayOpen) {
CDIF* cdif = NULL;
CDIF *cdif = NULL;
const char *disc_id = NULL;
if (CD_SelectedDisc >= 0 && !CD_TrayOpen) {
// only allow one pbp file to be loaded (at index 0)
......@@ -2488,7 +2479,7 @@ static bool disk_set_image_index(unsigned index)
// Mednafen PSX really doesn't support adding disk images on the fly ...
// Hack around this.
static void mednafen_update_md5_checksum(CDIF* iface)
static void mednafen_update_md5_checksum(CDIF *iface)
{
uint8 LayoutMD5[16];
md5_context layout_md5;
......
This diff is collapsed.
/******************************************************************************/
/* Mednafen Sony PS1 Emulation Module */
/******************************************************************************/
/* cdc.h:
** Copyright (C) 2011-2018 Mednafen Team
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software Foundation, Inc.,
** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __MDFN_PSX_CDC_H
#define __MDFN_PSX_CDC_H
......@@ -41,7 +20,7 @@ class PS_CDC
PS_CDC();
~PS_CDC();
void SetDisc(bool tray_open, CDIF* cdif, const char disc_id[4]);
void SetDisc(bool tray_open, CDIF *cdif, const char disc_id[4]);
void Power(void);
int StateAction(StateMem *sm, int load, int data_only);
......@@ -63,7 +42,7 @@ class PS_CDC
CD_Audio_Buffer AudioBuffer;
private:
CDIF* Cur_CDIF;
CDIF *Cur_CDIF;
bool DiscChanged;
int32 DiscStartupDelay;
......@@ -168,11 +147,10 @@ class PS_CDC
DS_STOPPED = 0,
DS_SEEKING,
DS_SEEKING_LOGICAL,
DS_SEEKING_LOGICAL2,
DS_PLAY_SEEKING,
DS_PLAYING,
DS_READING,
//DS_RESETTING
DS_RESETTING
};
int DriveStatus;
int StatusAfterSeek;
......@@ -184,8 +162,6 @@ class PS_CDC
int32 PSRCounter;
bool HoldLogicalPos;
int32 CurSector;
uint32 SectorsRead; // Reset to 0 on Read*/Play command start; used in the rough simulation of PS1 SetLoc->Read->Pause->Read behavior.
......@@ -203,7 +179,6 @@ class PS_CDC
int32 SeekTarget;
uint32 SeekRetryCounter;
int SeekFinished;
int32_t lastts;
......@@ -217,6 +192,7 @@ class PS_CDC
uint8 MakeStatus(bool cmd_error = false);
bool DecodeSubQ(uint8 *subpw);
bool CommandCheckDiscPresent(void);
void DMForceStop();
void EnbufferizeCDDASector(const uint8 *buf);
bool XA_Test(const uint8 *sdata);
......@@ -227,7 +203,6 @@ class PS_CDC
uint8 xa_cur_chan;
uint8 ReportLastF;
int32 ReportStartupDelay;
void HandlePlayRead(void);
......@@ -254,7 +229,7 @@ class PS_CDC
int32 Command_Standby(const int arg_count, const uint8 *args);
int32 Command_Standby_Part2(void);
int32 Command_Stop(const int arg_count, const uint8 *args);
int32 Command_Stop_Part2(void);
int32 Command_Stop_Part2(void);
int32 Command_Pause(const int arg_count, const uint8 *args);
int32 Command_Pause_Part2(void);
int32 Command_Reset(const int arg_count, const uint8 *args);
......
......@@ -95,7 +95,7 @@ static OpEntry ops[] =
MK_OP_REGIMM("bgez", 0x01, 0x01),
MK_OP_REGIMM("bltz", 0x00, 0x00),
MK_OP("j", "P", 2, 0, 0),
MK_OP("jal", "P", 3, 0, 0),
......@@ -239,7 +239,7 @@ std::string DisassembleMIPS(uint32 PC, uint32 instr)
"LR1LR2", "LR3LG1", "LG2LG3", "LB1LB2", "LB3", "RFC", "GFC", "BFC", "OFX", "OFY", "H", "DQA", "DQB", "ZSF3", "ZSF4", "FLAG"
};
static const char *gte_dr_names[32] =
static const char *gte_dr_names[32] =
{
"VXY0", "VZ0", "VXY1", "VZ1", "VXY2", "VZ2", "RGB", "OTZ", "IR0", "IR1", "IR2", "IR3", "SXY0", "SXY1", "SXY2", "SXYP",
"SZ0", "SZ1", "SZ2", "SZ3", "RGB0", "RGB1", "RGB2", "RES1", "MAC0", "MAC1", "MAC2", "MAC3", "IRGB", "ORGB", "LZCS", "LZCR"
......@@ -293,7 +293,7 @@ std::string DisassembleMIPS(uint32 PC, uint32 instr)
snprintf(s_c, sizeof(s_c), "CPR%d", rd);
snprintf(s_C, sizeof(s_C), "CCR%d", rd);
ret = op->mnemonic;
ret = std::string(op->mnemonic);
ret.append(10 - ret.size(), ' ');
for(unsigned int i = 0; i < strlen(op->format); i++)
......
......@@ -26,9 +26,6 @@ static INLINE void PlotPixelBlend(uint16_t bg_pix, uint16_t *fore_pix)
/* Efficient 15bpp pixel math algorithms from blargg */
switch(BlendMode)
{
default: // to silence clang
break;
/* 0.5 x B + 0.5 x F */
case BLEND_MODE_AVERAGE:
bg_pix |= 0x8000;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment