summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-09-07 15:13:29 +0000
committerSND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-09-07 15:13:29 +0000
commit9299e1526d2af3187118779e0cf409e2980b046e (patch)
tree3d4f818a9e9daaf19de916d838bc2f591b0a641d /libpcsxcore
parent3280e2959b20a870309c880be33ef2c9b2efefbd (diff)
downloadpcsxr-9299e1526d2af3187118779e0cf409e2980b046e.tar.gz
CDROM: GameShark CDX 3.3 - low-level status reading (CD swap trick)
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@56921 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/cdrom.c69
-rw-r--r--libpcsxcore/cdrom.h2
2 files changed, 70 insertions, 1 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c
index 9771a60c..dd40bbf1 100644
--- a/libpcsxcore/cdrom.c
+++ b/libpcsxcore/cdrom.c
@@ -1081,6 +1081,75 @@ void cdrWrite3(unsigned char rt) {
break;
}
}
+
+ /*
+ GameShark CDX 3.3
+
+ TODO: Can we relax the rules?
+ */
+ if (rt == 0 && cdr.Ctrl == 0xd8 && cdr.Readed == 1) {
+ u32 i;
+
+
+ // low-level status access
+ SetResultSize(15);
+
+
+ i = stat.Status;
+ if (CDR_getStatus(&stat) != -1) {
+ // Hack: Fake CDROM seek / spin time
+ static int seek_time = 0;
+
+ if (stat.Type == 0xff) {
+ }
+ else if (stat.Status & 0x10) {
+ // unknown #1 - status?
+ // unknown #2 - case open?
+
+ cdr.Result[0] = 0x11;
+ cdr.Result[1] = 0x80;
+ }
+ else if ( i & 0x10 ) {
+ cdr.Result[0] = 0x13;
+ cdr.Result[1] = 0x80;
+
+ // minimum 50 tries for GS CDX 3.3
+ seek_time = 50;
+ }
+ else if ( seek_time ) {
+ cdr.Result[0] = 0x13;
+ cdr.Result[1] = 0x80;
+
+ seek_time--;
+ }
+ else
+ {
+ cdr.Result[0] = 0x01;
+ cdr.Result[1] = 0x00;
+ }
+
+ // unknown #3
+ cdr.Result[2] = 0;
+
+ // unknown #4 - error?
+ cdr.Result[3] = 0;
+
+ // unknown #5-14
+ cdr.Result[4] = 0;
+ cdr.Result[5] = 0;
+ cdr.Result[6] = 0;
+ cdr.Result[7] = 0;
+ cdr.Result[8] = 0;
+ cdr.Result[9] = 0;
+ cdr.Result[10] = 0;
+ cdr.Result[11] = 0;
+ cdr.Result[12] = 0;
+ cdr.Result[13] = 0;
+
+ // unknown #15 - error?
+ cdr.Result[14] = 0;
+ }
+ }
}
void psxDma3(u32 madr, u32 bcr, u32 chcr) {
diff --git a/libpcsxcore/cdrom.h b/libpcsxcore/cdrom.h
index c5d448cd..07b62924 100644
--- a/libpcsxcore/cdrom.h
+++ b/libpcsxcore/cdrom.h
@@ -56,7 +56,7 @@ typedef struct {
unsigned char Prev[4];
unsigned char Param[8];
- unsigned char Result[8];
+ unsigned char Result[15];
unsigned char ParamC;
unsigned char ParamP;