Skip to content
Open
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
7 changes: 2 additions & 5 deletions src/dvdplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ static int readMCFile(int fd, void *buffer, int len)
static int ReadFileFromMC(int port, int slot, const char *file, void *buffer, int len)
{
int fd, bytesRead;
int result;

if ((result = getStatMC(port, slot, NULL, NULL, NULL)) >= -2) {
if (getStatMC(port, slot, NULL, NULL, NULL) >= -2) {
if ((fd = openMCFile(port, slot, file, 1)) >= 0) {
if ((bytesRead = readMCFile(fd, buffer, len)) < 0)
return -1;
Expand Down Expand Up @@ -208,9 +207,7 @@ static int DVDPlayerUpdateCheck(int *pPort, int *pSlot, char *pVersion)

static int DVDPlayerGetUpdateVersion(const char *file, int *pPort, int *pSlot)
{
int result;

if ((result = DVDPlayerUpdateCheck(pPort, pSlot, NULL)) == 0) { // DVD Player update of the right region exists and is newer.
if (DVDPlayerUpdateCheck(pPort, pSlot, NULL) == 0) { // DVD Player update of the right region exists and is newer.
return (CheckFileFromMC(*pPort, *pSlot, file) == 0 ? 0 : -1);
}

Expand Down
7 changes: 2 additions & 5 deletions src/libcdvd_add.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,21 @@ static unsigned char MECHACON_CMD_S36_supported = 0, MECHACON_CMD_S27_supported
// Initialize add-on functions. Currently only retrieves the MECHACON's version to determine what sceCdAltGetRegionParams() should do.
int cdInitAdd(void)
{
int result, i;
int i;
u32 status;
u8 MECHA_version_data[3];
unsigned int MECHA_version;

// Like how CDVDMAN checks sceCdMV(), do not continuously attempt to get the MECHACON version because some consoles (e.g. DTL-H301xx) can't return one.
for (i = 0; i <= 100; i++) {
if ((result = sceCdMV(MECHA_version_data, &status)) != 0 && ((status & 0x80) == 0)) {
if ((sceCdMV(MECHA_version_data, &status) != 0) && ((status & 0x80) == 0)) {
MECHA_version = MECHA_version_data[2] | ((unsigned int)MECHA_version_data[1] << 8) | ((unsigned int)MECHA_version_data[0] << 16);
MECHACON_CMD_S36_supported = (0x5FFFF < MECHA_version); // v6.0 and later
MECHACON_CMD_S27_supported = (0x501FF < MECHA_version); // v5.2 and later
MECHACON_CMD_S24_supported = (0x4FFFF < MECHA_version); // v5.0 and later
return 0;
}
}

// printf("Failed to get MECHACON version: %d 0x%x\n", result, status);

return -1;
}

Expand Down
3 changes: 1 addition & 2 deletions src/modelname.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern char ConsoleROMVER[];

static int ReadModelName(char *name)
{
int result;
u32 stat;

/* This function is a hybrid between the late ROM browser program and the HDD Browser.
Expand Down Expand Up @@ -51,7 +50,7 @@ static int ReadModelName(char *name)

return 0; // Original returned -1
} else {
if ((result = sceCdRM(name, &stat)) == 1) { // Command issued successfully.
if (sceCdRM(name, &stat) == 1) { // Command issued successfully.
if (stat & 0x80)
return -2;
if ((stat & 0x40) || name[0] == '\0')
Expand Down