Without this can't cherry-pick stuff from there.
// plays cdda audio
// sector: byte 0 - minute; byte 1 - second; byte 2 - frame
// does NOT uses bcd format
// plays cdda audio
// sector: byte 0 - minute; byte 1 - second; byte 2 - frame
// does NOT uses bcd format
-static long CALLBACK ISOplay(void) {
+static long CALLBACK ISOplay(unsigned char *time) {
playing = TRUE;
return 0;
}
playing = TRUE;
return 0;
}
static s16 read_buf[CD_FRAMESIZE_RAW/2];
/* CD-ROM magic numbers */
static s16 read_buf[CD_FRAMESIZE_RAW/2];
/* CD-ROM magic numbers */
-#define CdlSync 0 /* nocash documentation : "Uh, actually, returns error code 40h = Invalid Command...?" */
+#define CdlSync 0 /* nocash documentation : "Uh, actually, returns error code 40h = Invalid Command...?" */
#define CdlNop 1
#define CdlSetloc 2
#define CdlPlay 3
#define CdlNop 1
#define CdlSetloc 2
#define CdlPlay 3
char *CmdName[0x100]= {
"CdlSync", "CdlNop", "CdlSetloc", "CdlPlay",
"CdlForward", "CdlBackward", "CdlReadN", "CdlStandby",
char *CmdName[0x100]= {
"CdlSync", "CdlNop", "CdlSetloc", "CdlPlay",
"CdlForward", "CdlBackward", "CdlReadN", "CdlStandby",
- "CdlStop", "CdlPause", "CdlReset", "CdlMute",
+ "CdlStop", "CdlPause", "CdlReset", "CdlMute",
"CdlDemute", "CdlSetfilter", "CdlSetmode", "CdlGetparam",
"CdlGetlocL", "CdlGetlocP", "CdlReadT", "CdlGetTN",
"CdlGetTD", "CdlSeekL", "CdlSeekP", "CdlSetclock",
"CdlGetclock", "CdlTest", "CdlID", "CdlReadS",
"CdlDemute", "CdlSetfilter", "CdlSetmode", "CdlGetparam",
"CdlGetlocL", "CdlGetlocP", "CdlReadT", "CdlGetTN",
"CdlGetTD", "CdlSeekL", "CdlSeekP", "CdlSetclock",
"CdlGetclock", "CdlTest", "CdlID", "CdlReadS",
- "CdlInit", NULL, "CDlReadToc", NULL
+ "CdlInit", NULL, "CDlReadToc", NULL
};
unsigned char Test04[] = { 0 };
};
unsigned char Test04[] = { 0 };
// XXX: wrong, should seek instead..
cdr.Seeked = SEEK_DONE;
}
// XXX: wrong, should seek instead..
cdr.Seeked = SEEK_DONE;
}
cdr.FastBackward = 0;
cdr.FastForward = 0;
cdr.FastBackward = 0;
cdr.FastForward = 0;
StopReading();
if (!Config.Cdda)
StopReading();
if (!Config.Cdda)
+ CDR_play(cdr.SetSectorPlay);
// Vib Ribbon: gameplay checks flag
cdr.StatP &= ~STATUS_SEEK;
// Vib Ribbon: gameplay checks flag
cdr.StatP &= ~STATUS_SEEK;
case CdlForward:
// TODO: error 80 if stopped
cdr.Stat = Complete;
case CdlForward:
// TODO: error 80 if stopped
cdr.Stat = Complete;
// GameShark CD Player: Calls 2x + Play 2x
cdr.FastForward = 1;
cdr.FastBackward = 0;
// GameShark CD Player: Calls 2x + Play 2x
cdr.FastForward = 1;
cdr.FastBackward = 0;
cdr.Stat = Complete;
// GameShark CD Player: Calls 2x + Play 2x
cdr.Stat = Complete;
// GameShark CD Player: Calls 2x + Play 2x
cdr.FastForward = 0;
break;
cdr.FastForward = 0;
break;
/*
Gundam Battle Assault 2: much slower (*)
- Fixes boot, gameplay
/*
Gundam Battle Assault 2: much slower (*)
- Fixes boot, gameplay
Hokuto no Ken 2: slower
- Fixes intro + subtitles
Hokuto no Ken 2: slower
- Fixes intro + subtitles
InuYasha - Feudal Fairy Tale: slower
- Fixes battles
*/
InuYasha - Feudal Fairy Tale: slower
- Fixes battles
*/
* The timings from Duckstation are based upon hardware tests.
* Mednafen's timing don't work for Gundam Battle Assault 2 in PAL/50hz mode,
* seems to be timing sensitive as it can depend on the CPU's clock speed.
* The timings from Duckstation are based upon hardware tests.
* Mednafen's timing don't work for Gundam Battle Assault 2 in PAL/50hz mode,
* seems to be timing sensitive as it can depend on the CPU's clock speed.
- *
- * We will need to get around this for Bedlam/Rise 2 later...
* */
if (cdr.DriveState == DRIVESTATE_STANDBY)
{
* */
if (cdr.DriveState == DRIVESTATE_STANDBY)
{
case CdlReset:
cdr.Muted = FALSE;
case CdlReset:
cdr.Muted = FALSE;
- cdr.Mode = 0x20; /* Needed for This is Football 2, Pooh's Party and possibly others. */
+ cdr.Mode = 0x20; /* This fixes This is Football 2, Pooh's Party lockups */
AddIrqQueue(CdlReset + 0x100, 4100000);
no_busy_error = 1;
start_rotating = 1;
AddIrqQueue(CdlReset + 0x100, 4100000);
no_busy_error = 1;
start_rotating = 1;
+ /* Gameblabla : According to mednafen, Result size should be 5 and done this way. */
SetResultSize(5);
cdr.Result[1] = cdr.Mode;
cdr.Result[2] = 0;
SetResultSize(5);
cdr.Result[1] = cdr.Mode;
cdr.Result[2] = 0;
- fixes cutscenes
C-12 - Final Resistance - doesn't like seek
*/
- fixes cutscenes
C-12 - Final Resistance - doesn't like seek
*/
/*
By nicolasnoble from PCSX Redux :
"It LOOKS like this logic is wrong, therefore disabling it with `&& false` for now.
/*
By nicolasnoble from PCSX Redux :
"It LOOKS like this logic is wrong, therefore disabling it with `&& false` for now.
tries to protect itself against errors by preventing from issuing a GetLocP while it knows the
last status was "seek". But this makes the logic just softlock as it'll never get a notification
about the fact the drive is done seeking and the read actually started.
tries to protect itself against errors by preventing from issuing a GetLocP while it knows the
last status was "seek". But this makes the logic just softlock as it'll never get a notification
about the fact the drive is done seeking and the read actually started.
In other words, this state machine here is probably wrong in assuming the response to ReadS/ReadN is
done right away. It's rather when it's done seeking, and the read has actually started. This probably
requires a bit more work to make sure seek delays are processed properly.
In other words, this state machine here is probably wrong in assuming the response to ReadS/ReadN is
done right away. It's rather when it's done seeking, and the read has actually started. This probably
requires a bit more work to make sure seek delays are processed properly.
*/
cdr.StatP |= STATUS_READ;
cdr.StatP &= ~STATUS_SEEK;
*/
cdr.StatP |= STATUS_READ;
cdr.StatP &= ~STATUS_SEEK;
CDREAD_INT(((cdr.Mode & 0x80) ? (cdReadTime) : cdReadTime * 2) + seekTime);
cdr.Result[0] = cdr.StatP;
start_rotating = 1;
break;
CDREAD_INT(((cdr.Mode & 0x80) ? (cdReadTime) : cdReadTime * 2) + seekTime);
cdr.Result[0] = cdr.StatP;
start_rotating = 1;
break;
case CdlSync:
default:
CDR_LOG_I("Invalid command: %02x\n", Irq);
case CdlSync:
default:
CDR_LOG_I("Invalid command: %02x\n", Irq);
if (buf == NULL)
cdr.NoErr = 0;
if (buf == NULL)
cdr.NoErr = 0;
CDR_LOG_I("cdrReadInterrupt() Log: err\n");
memset(cdr.Transfer, 0, DATA_SIZE);
cdr.Stat = DiskError;
CDR_LOG_I("cdrReadInterrupt() Log: err\n");
memset(cdr.Transfer, 0, DATA_SIZE);
cdr.Stat = DiskError;
AddIrqQueue(cdr.Cmd, 0x800);
switch (cdr.Cmd) {
AddIrqQueue(cdr.Cmd, 0x800);
switch (cdr.Cmd) {
case CdlReadN:
case CdlReadS:
case CdlPause:
case CdlReadN:
case CdlReadS:
case CdlPause:
cdr.DriveState = DRIVESTATE_STANDBY;
cdr.StatP = STATUS_ROTATING;
pTransfer = cdr.Transfer;
cdr.DriveState = DRIVESTATE_STANDBY;
cdr.StatP = STATUS_ROTATING;
pTransfer = cdr.Transfer;
- cdr.SetlocPending = 0;
- cdr.m_locationChanged = FALSE;
-
// BIOS player - default values
cdr.AttenuatorLeftToLeft = 0x80;
cdr.AttenuatorLeftToRight = 0x00;
// BIOS player - default values
cdr.AttenuatorLeftToLeft = 0x80;
cdr.AttenuatorLeftToRight = 0x00;
Find_CurTrack(cdr.SetSectorPlay);
if (!Config.Cdda)
Find_CurTrack(cdr.SetSectorPlay);
if (!Config.Cdda)
+ CDR_play(cdr.SetSectorPlay);
}
if ((cdr.freeze_ver & 0xffffff00) != 0x63647200) {
}
if ((cdr.freeze_ver & 0xffffff00) != 0x63647200) {
#define btoi(b) ((b) / 16 * 10 + (b) % 16) /* BCD to u_char */
#define itob(i) ((i) / 10 * 16 + (i) % 10) /* u_char to BCD */
#define btoi(b) ((b) / 16 * 10 + (b) % 16) /* BCD to u_char */
#define itob(i) ((i) / 10 * 16 + (i) % 10) /* u_char to BCD */
+#define ABS_CD(x) ((x >= 0) ? x : -x)
+#define MIN_VALUE(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
+#define MAX_VALUE(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a > _b ? _a : _b; })
+
#define MSF2SECT(m, s, f) (((m) * 60 + (s) - 2) * 75 + (f))
#define CD_FRAMESIZE_RAW 2352
#define MSF2SECT(m, s, f) (((m) * 60 + (s) - 2) * 75 + (f))
#define CD_FRAMESIZE_RAW 2352
-#define MIN_VALUE(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
-#define MAX_VALUE(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a > _b ? _a : _b; })
-
typedef struct {
unsigned char OCUP;
unsigned char Reg1Mode;
typedef struct {
unsigned char OCUP;
unsigned char Reg1Mode;
typedef long (CALLBACK* CDRconfigure)(void);\r
typedef long (CALLBACK* CDRtest)(void);\r
typedef void (CALLBACK* CDRabout)(void);\r
typedef long (CALLBACK* CDRconfigure)(void);\r
typedef long (CALLBACK* CDRtest)(void);\r
typedef void (CALLBACK* CDRabout)(void);\r
-typedef long (CALLBACK* CDRplay)(void);\r
+typedef long (CALLBACK* CDRplay)(unsigned char *);\r
typedef long (CALLBACK* CDRstop)(void);\r
typedef long (CALLBACK* CDRsetfilename)(char *);\r
struct CdrStat {\r
typedef long (CALLBACK* CDRstop)(void);\r
typedef long (CALLBACK* CDRsetfilename)(char *);\r
struct CdrStat {\r