(CDROM) Update

This commit is contained in:
twinaphex 2016-08-15 04:14:55 +02:00
parent c7a9524746
commit 3df4066045
2 changed files with 8 additions and 9 deletions

View File

@ -18,7 +18,6 @@
#include <mednafen/mednafen.h>
#include <math.h>
#include <algorithm>
#include <trio/trio.h>
#include "scsicd.h"
#include "cdromif.h"
#include "SimpleFIFO.h"
@ -28,8 +27,6 @@
#include <emmintrin.h>
#endif
using namespace CDUtility;
static uint32_t CD_DATA_TRANSFER_RATE;
static uint32_t System_Clock;
static void (*CDIRQCallback)(int);
@ -173,7 +170,7 @@ static cdda_t cdda;
static SimpleFIFO<uint8_t> *din = NULL;
static CDUtility::TOC toc;
static TOC toc;
static uint32_t read_sec_start;
static uint32_t read_sec;
@ -2876,11 +2873,11 @@ uint32_t SCSICD_Run(scsicd_timestamp_t system_timestamp)
log_buffer[0] = 0;
lb_pos = trio_snprintf(log_buffer, 1024, "Command: %02x, %s%s ", cd.command_buffer[0], cmd_info_ptr->pretty_name ? cmd_info_ptr->pretty_name : "!!BAD COMMAND!!",
lb_pos = snprintf(log_buffer, 1024, "Command: %02x, %s%s ", cd.command_buffer[0], cmd_info_ptr->pretty_name ? cmd_info_ptr->pretty_name : "!!BAD COMMAND!!",
(cmd_info_ptr->flags & SCF_UNTESTED) ? "(UNTESTED)" : "");
for(int i = 0; i < RequiredCDBLen[cd.command_buffer[0] >> 4]; i++)
lb_pos += trio_snprintf(log_buffer + lb_pos, 1024 - lb_pos, "%02x ", cd.command_buffer[i]);
lb_pos += snprintf(log_buffer + lb_pos, 1024 - lb_pos, "%02x ", cd.command_buffer[i]);
SCSILog("SCSI", "%s", log_buffer);
//puts(log_buffer);
@ -3144,7 +3141,7 @@ void SCSICD_SetCDDAVolume(double left, double right)
FixOPV();
}
void SCSICD_StateAction(StateMem* sm, const unsigned load, const bool data_only, const char *sname)
int SCSICD_StateAction(StateMem* sm, const unsigned load, const bool data_only, const char *sname)
{
SFORMAT StateRegs[] =
{
@ -3220,7 +3217,7 @@ void SCSICD_StateAction(StateMem* sm, const unsigned load, const bool data_only,
SFEND
};
MDFNSS_StateAction(sm, load, data_only, StateRegs, sname);
int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, sname);
if(load)
{
@ -3240,4 +3237,6 @@ void SCSICD_StateAction(StateMem* sm, const unsigned load, const bool data_only,
for(int i = 0; i < NumModePages; i++)
UpdateMPCacheP(&ModePages[i]);
}
return ret;
}

View File

@ -92,7 +92,7 @@ void SCSICD_Close(void);
void SCSICD_SetTransferRate(uint32_t TransferRate);
void SCSICD_SetCDDAVolume(double left, double right);
void SCSICD_StateAction(StateMem *sm, const unsigned load, const bool data_only, const char *sname);
int SCSICD_StateAction(StateMem *sm, const unsigned load, const bool data_only, const char *sname);
void SCSICD_SetDisc(bool tray_open, CDIF *cdif, bool no_emu_side_effects = false);