summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-09-07 15:10:40 +0000
committerSND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-09-07 15:10:40 +0000
commit3280e2959b20a870309c880be33ef2c9b2efefbd (patch)
tree020aaa6e9504202f691664ce7db1cbc02d83df49 /libpcsxcore
parent28bd1fcb797ea86e92eea358c124eede6bdf62c0 (diff)
downloadpcsxr-3280e2959b20a870309c880be33ef2c9b2efefbd.tar.gz
SIO: GameShark CDX - add extra keys, allows more rebooting (ex. Xenogears)
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@56920 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/sio.c64
1 files changed, 56 insertions, 8 deletions
diff --git a/libpcsxcore/sio.c b/libpcsxcore/sio.c
index 110c2934..60d918fc 100644
--- a/libpcsxcore/sio.c
+++ b/libpcsxcore/sio.c
@@ -395,20 +395,68 @@ void sioWrite8(unsigned char value) {
parp = 8;
bufcount = 12;
- // GS CDX [magic key]
- if( buf[0] == 0x01 && buf[1] == 0x01 &&
- buf[2] == 0x12 && buf[3] == 0x34 &&
- buf[4] == 0x56 && buf[5] == 0x78 &&
- buf[6] == 0xae && buf[7] == 0x0f )
+
+ // TODO: Solve CDX algorithm
+
+
+ // GS CDX 3.3 [magic key]
+ if( buf[2] == 0x12 && buf[3] == 0x34 &&
+ buf[4] == 0x56 && buf[5] == 0x78 )
{
buf[9] = reverse_8( 0x3e );
buf[10] = reverse_8( 0xa0 );
buf[11] = reverse_8( 0x40 );
buf[12] = reverse_8( 0x29 );
}
+
+ // GS CDX 3.3 [address key #2 = 6ec]
+ else if( buf[2] == 0x1f && buf[3] == 0xe3 &&
+ buf[4] == 0x45 && buf[5] == 0x60 )
+ {
+ buf[9] = reverse_8( 0xee );
+ buf[10] = reverse_8( 0xdd );
+ buf[11] = reverse_8( 0x71 );
+ buf[12] = reverse_8( 0xa8 );
+ }
+
+ // GS CDX 3.3 [address key #3 = ???]
+ else if( buf[2] == 0x1f && buf[3] == 0xe3 &&
+ buf[4] == 0x72 && buf[5] == 0xe3 )
+ {
+ // unsolved!!
+
+ // Used here: 80090348 / 80090498
+
+ // dummy value - MSB
+ buf[9] = reverse_8( 0xfa );
+ buf[10] = reverse_8( 0xde );
+ buf[11] = reverse_8( 0x21 );
+ buf[12] = reverse_8( 0x97 );
+ }
+
+ // GS CDX 3.3 [address key #4 = a00]
+ else if( buf[2] == 0x1f && buf[3] == 0xe3 &&
+ buf[4] == 0x85 && buf[5] == 0xae )
+ {
+ buf[9] = reverse_8( 0xee );
+ buf[10] = reverse_8( 0xdd );
+ buf[11] = reverse_8( 0x7d );
+ buf[12] = reverse_8( 0x44 );
+ }
+
+ // GS CDX 3.3 [address key #5 = 9ec]
+ else if( buf[2] == 0x17 && buf[3] == 0xe3 &&
+ buf[4] == 0xb5 && buf[5] == 0x60 )
+ {
+ buf[9] = reverse_8( 0xee );
+ buf[10] = reverse_8( 0xdd );
+ buf[11] = reverse_8( 0x7e );
+ buf[12] = reverse_8( 0xa8 );
+ }
+
else
{
- // dummy value
+ // dummy value - MSB
buf[9] = reverse_8( 0xfa );
buf[10] = reverse_8( 0xde );
buf[11] = reverse_8( 0x21 );
@@ -423,7 +471,7 @@ void sioWrite8(unsigned char value) {
// be - ef - 02
case 3:
- SIO_INT(1);
+ SIO_INT( SIO_CYCLES );
StatReg |= RX_RDY;
// command start
@@ -444,7 +492,7 @@ void sioWrite8(unsigned char value) {
// be - ef - 01
case 4:
- SIO_INT(1);
+ SIO_INT( SIO_CYCLES );
StatReg |= RX_RDY;