Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dex Drive Support #282

Closed
sairuk opened this issue Dec 12, 2022 · 6 comments
Closed

Dex Drive Support #282

sairuk opened this issue Dec 12, 2022 · 6 comments

Comments

@sairuk
Copy link
Collaborator

sairuk commented Dec 12, 2022

Looking at support for physical Dex Drives using the linux-dexdrive project to attach memory cards as block devices

We can attach and dump the block device to a raw image with dd. Not currently sure where it will be usable thereafter

There is a tool called psxmemcardmgr that looks good but would need some updates to be used by us.

Projects

Issues

root@raspberrypi:/opt/retronas/scripts# dexattach --check --verbose /dev/ttyUSB0
Opening /dev/ttyUSB0 and setting line discipline
Device number is 254:0
root@raspberrypi:/opt# cat /dev/dexdrive0 | hd | head -n10
00000000  4d 43 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |MC..............|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 0e  |................|
00000080  51 00 00 00 00 60 00 00  01 00 42 45 53 4c 45 53  |Q....`....BESLES|
00000090  2d 30 32 39 30 38 43 5a  48 50 56 42 30 00 00 00  |-02908CZHPVB0...|
000000a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000000f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 05  |................|
00000100  52 00 00 00 00 00 00 00  02 00 00 00 00 00 00 00  |R...............|
root@raspberrypi:/opt# 
root@raspberrypi:/opt# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0     179:0    0 14.8G  0 disk 
├─mmcblk0p1 179:1    0  256M  0 part /boot
└─mmcblk0p2 179:2    0 14.6G  0 part /
dexdrive0   254:0    1  128K  0 disk 
root@raspberrypi:/opt# 
dd if=/dev/dexdrive0 of=dex_card0.img
root@raspberrypi:/opt# cat dex_card0.img | hd | head -n10
00000000  4d 43 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |MC..............|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 0e  |................|
00000080  51 00 00 00 00 60 00 00  01 00 42 45 53 4c 45 53  |Q....`....BESLES|
00000090  2d 30 32 39 30 38 43 5a  48 50 56 42 30 00 00 00  |-02908CZHPVB0...|
000000a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000000f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 05  |................|
00000100  52 00 00 00 00 00 00 00  02 00 00 00 00 00 00 00  |R...............|
root@raspberrypi:/opt# 

see the dexdrive branch for progress

@sairuk sairuk changed the title Dex Drives Dex Drive Support Dec 12, 2022
@sairuk
Copy link
Collaborator Author

sairuk commented Dec 12, 2022

the dumped cards are good, can be read with PSX Memory Card Manager

image

@sairuk
Copy link
Collaborator Author

sairuk commented Dec 12, 2022

The tool dumps consistently with dd

732f0120d7ecbada73932373b1c94298  /data/retronas/dex_card0.mc
f4ce31a11d2e10bcafee53a93365b694  /data/retronas/dex_card1.mc
732f0120d7ecbada73932373b1c94298  /data/retronas/dex_card2.mc
f0804e982990c48b233110f6b7f7278e  /data/retronas/dex_card3.mc
45178e15cc7730654a5490fe29b943d8  /data/retronas/dex_card4.mc
dbde6da31e2be8dd09158425ed66551a  /data/retronas/dex_card5.mc
270c671917a53709a236e6ab0da40ffb  /data/retronas/dex_card6a.mc
270c671917a53709a236e6ab0da40ffb  /data/retronas/dex_card6b.mc
270c671917a53709a236e6ab0da40ffb  /data/retronas/dex_card6c.mc
270c671917a53709a236e6ab0da40ffb  /data/retronas/dex_card6d.mc
270c671917a53709a236e6ab0da40ffb  /data/retronas/dex_card6.mc
c76acb99bb708ce24b99d1e1dff7bc54  /data/retronas/dex_card7a.mc
c76acb99bb708ce24b99d1e1dff7bc54  /data/retronas/dex_card7.mc
cbf548e95d507e9b84880ce69cbbb2a2  /data/retronas/dex_card8.mc
b2d7bfb54e03cb2374010c4b267b815c  /data/retronas/dex_card9.mc

@sairuk
Copy link
Collaborator Author

sairuk commented Dec 12, 2022

you can take the images and write them back to a card with dd and they will work on hw and redump consistently

original

c76acb99bb708ce24b99d1e1dff7bc54  /data/retronas/dex_card_tmp.mc

replacement card image

732f0120d7ecbada73932373b1c94298  /data/retronas/dex_card0.mc

apply the image

dd if=/data/retronas/dex_card0.mc of=/dev/dexdrive0

redump

732f0120d7ecbada73932373b1c94298  /data/retronas/dex_card_tmp_redump.mc

@sairuk
Copy link
Collaborator Author

sairuk commented Dec 12, 2022

i've got one 3rd party card that isn't read atm see fbriere/linux-dexdrive#1

@sairuk
Copy link
Collaborator Author

sairuk commented Dec 12, 2022

another potential cli app for use with dumped images https://github.com/G4Vi/psx_mc_cli

/data/retronas/dex_card_tmp.mc:
SRTLINK  BESLES-02908CZHPVB0  0x0001  3 blocks            xor 0x5
MIDLINK                       0x0002  0 blocks            xor 0x50
ENDLINK                       0xFFFF  0 blocks            xor 0x53
INUSE    BASLUS-01066CARAG01  0xFFFF  1 blocks            xor 0x20
INUSE    BESLES-02908TKNKPAM  0xFFFF  1 blocks            xor 0x27
INUSE    BESLES-02908STMLPAO  0xFFFF  1 blocks            xor 0x39
MIDLINK                       0x0008  0 blocks            xor 0x5A
ENDLINK                       0xFFFF  0 blocks            xor 0x53
INUSE    BESLES-02908CUIKGBD  0xFFFF  1 blocks            xor 0x34
INUSE    BESLES-02908IGIAPBC  0xFFFF  1 blocks            xor 0x36
INUSE    BESLES-02908CJWMPAU  0xFFFF  1 blocks            xor 0x36
INUSE    BESLES-02908JN^TPBE  0xFFFF  1 blocks            xor 0x38
INUSE    BESCES-00867FF7-S01  0xFFFF  1 blocks            xor 0x2C
INUSE    BESCES-00867FF7-S02  0xFFFF  1 blocks            xor 0x2F

this tool can also interogate the block device directly

$ lsmc /dev/dexdrive0 
/dev/dexdrive0:
SRTLINK  BESLES-02908CZHPVB0  0x0001  3 blocks            xor 0x5
MIDLINK                       0x0002  0 blocks            xor 0x50
ENDLINK                       0xFFFF  0 blocks            xor 0x53
INUSE    BASLUS-01066CARAG01  0xFFFF  1 blocks            xor 0x20
INUSE    BESLES-02908TKNKPAM  0xFFFF  1 blocks            xor 0x27
INUSE    BESLES-02908STMLPAO  0xFFFF  1 blocks            xor 0x39
SRTLINK  BESLES-02908SPXZVAR  0x0007  3 blocks            xor 0x62
MIDLINK                       0x0008  0 blocks            xor 0x5A
ENDLINK                       0xFFFF  0 blocks            xor 0x53
INUSE    BESLES-02908CUIKGBD  0xFFFF  1 blocks            xor 0x34
INUSE    BESLES-02908IGIAPBC  0xFFFF  1 blocks            xor 0x36
INUSE    BESLES-02908CJWMPAU  0xFFFF  1 blocks            xor 0x36
INUSE    BESLES-02908JN^TPBE  0xFFFF  1 blocks            xor 0x38
INUSE    BESCES-00867FF7-S01  0xFFFF  1 blocks            xor 0x2C
INUSE    BESCES-00867FF7-S02  0xFFFF  1 blocks            xor 0x2F

filename             title                                      blockcount
BESLES-02908CZHPVB0  THPS2 REPLAYー CTP                        3

@sairuk
Copy link
Collaborator Author

sairuk commented Dec 18, 2022

dumping functionality merged into testing

@sairuk sairuk closed this as completed Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant