sioloader

Downloadable items posted by PSXDEV members are within this forum.
danhans42
BANNED
BANNED
Posts: 329
Joined: Nov 28, 2012

sioloader

Post by danhans42 » July 19th, 2019, 7:04 am

SIO Loader for Sony PlayStation Consoles

Basically its the source of Serial v1.3 by Hitmen but with selectabe serial speed.

Uses a very simple serial cable (rxd/txd/gnd) that is easy to build.

The client is written in Python 3, and has been tested on Python 3.7 on both Windows and Linux. It requires pyserial, which isnt always included. Google can help if you get stuck.

You can use two speeds - 115,200bps or 345,600bps. Once you have selected the requried speed on the PSX, use the corresponding on the client..

Code: Select all

usage : sioload.py

commands -run : upload & execute PSX-EXE @115.2k (PSXSERIAL/UNIROM/HITSERIAL compatible) -trun: upload & execute PSX-EXE @345.6k (SIOLOADER only)

where is the name of your serial port and is the name of the file to upload/download

  eg  : sioload.py -run /dev/ttyUSB0 greentro.exe
        sioload.py -trun COM5 trancetro.exe
Few notes :-

Size limit should be similar to Serial v1.3 ~1700k.

345,600bps - I have only tested this with a GENUINE FTDI USB UART. If you have issues switch to 115,200bps.

Source/Compiled EXE

https://github.com/danhans42/sioload/

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » July 19th, 2019, 12:29 pm

Huh? This is interesting, I couldn't even get reliable communications to work at 230,400 baud. I suppose it could just be the fact that I was using a CH340 based UART and not an FTDI.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

User avatar
Dedok179
Serious PSXDEV User
Serious PSXDEV User
Posts: 86
Joined: Jun 11, 2015
I am a: Programmer, Beginning reverser
PlayStation Model: SCPH-5502
Discord: Dedok179#2632
Location: Tula,RU

Post by Dedok179 » July 19th, 2019, 2:39 pm

LameGuy64 wrote: July 19th, 2019, 12:29 pm Huh? This is interesting, I couldn't even get reliable communications to work at 230,400 baud. I suppose it could just be the fact that I was using a CH340 based UART and not an FTDI.
Probably. Brill told me that on FTDI, high speed works stably for him.

User avatar
Dedok179
Serious PSXDEV User
Serious PSXDEV User
Posts: 86
Joined: Jun 11, 2015
I am a: Programmer, Beginning reverser
PlayStation Model: SCPH-5502
Discord: Dedok179#2632
Location: Tula,RU

Post by Dedok179 » July 19th, 2019, 2:45 pm

danhans42 wrote: July 19th, 2019, 7:04 am SIO Loader for Sony PlayStation Consoles

Basically its the source of Serial v1.3 by Hitmen but with selectabe serial speed.

Uses a very simple serial cable (rxd/txd/gnd) that is easy to build.

The client is written in Python 3, and has been tested on Python 3.7 on both Windows and Linux. It requires pyserial, which isnt always included. Google can help if you get stuck.

You can use two speeds - 115,200bps or 345,600bps. Once you have selected the requried speed on the PSX, use the corresponding on the client..

Code: Select all

usage : sioload.py

commands -run : upload & execute PSX-EXE @115.2k (PSXSERIAL/UNIROM/HITSERIAL compatible) -trun: upload & execute PSX-EXE @345.6k (SIOLOADER only)

where is the name of your serial port and is the name of the file to upload/download

  eg  : sioload.py -run /dev/ttyUSB0 greentro.exe
        sioload.py -trun COM5 trancetro.exe
Few notes :-

Size limit should be similar to Serial v1.3 ~1700k.

345,600bps - I have only tested this with a GENUINE FTDI USB UART. If you have issues switch to 115,200bps.

Source/Compiled EXE

https://github.com/danhans42/sioload/
Which bootloader to use on the console for it? Or does it work without a disk?

danhans42
BANNED
BANNED
Posts: 329
Joined: Nov 28, 2012

Post by danhans42 » July 19th, 2019, 4:07 pm

It's a PSX-EXE... So you would need to make an ISO of it.

If I find time I will try and build one and upload it at some points.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » July 24th, 2019, 11:51 am

I just tested 230,400 and 345,600 bauds with my FTDI and well, communications was still very unreliable. Bytes often kept getting missed and I end up with incomplete data, I'm not so sure about the integrity of what was received though.

It could either be my wiring (I used old, probably rusty wires to connect the FTDI to the DB9 of my PS1) or my FTDI is a knockoff, I'll try using better wires to see if it'll solve the problem.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » July 24th, 2019, 12:41 pm

Try a higher core count of wire and try seeing if twisting them into a twisted pair would help. Usually twisted pairs are for parallel data lines, but it might help eliminate noise in this situation.

If that doesn't work, make the wires as short as possible. Really you'd want the FDTI soldered directly to the PSX CPU.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

danhans42
BANNED
BANNED
Posts: 329
Joined: Nov 28, 2012

Post by danhans42 » July 24th, 2019, 7:48 pm

I need to do more testing at my end with other UARTs. I have also only tested the fast speeds for uploading to the PSX, not downloading from it.

In both instances my test setup is using half a link cable.. so the connection between the FTDI and the PSX is around 80cm long. Also, Squaresoft74 has tested it and it is working with the SIO cable made by xrider.. which also uses a genuine FTDI.

Be very interesting to get to the bottom of it and hopefully push more speed out of the SIO port.

rama3
Verified
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: Apr 16, 2017

Post by rama3 » July 24th, 2019, 11:35 pm

It's not so much about genuine parts vs clones*, but the details of operation.
I think the PSX had an inversion step, right? It kind of feels like this is important with the speed limitations you see.

* At these low speeds. It would matter at several MHz.

danhans42
BANNED
BANNED
Posts: 329
Joined: Nov 28, 2012

Post by danhans42 » July 24th, 2019, 11:50 pm

Inversion step?
If I understand you correctly, the only part of SIO that is inverted is the handshaking lines.. which arent in use for this application.

If I am honest, I do not think the issue is with the USB UART but it is easy to exclude from the investigation. I have had issues with the counterfeit FTDI chips in the past, especially at higher speeds.

Now I am an absolute amateur when it comes to PSX programming.. but the source that is attached above works and personally am unsure as to why.

Could it be worth trying some absolute bare minimum resources SIO loader.. eg.. no graphic initialisation or anything and see if that hinders things?

danhans42
BANNED
BANNED
Posts: 329
Joined: Nov 28, 2012

Post by danhans42 » July 25th, 2019, 7:01 am

Just tested my PSone at 345600 using an ESP8266 as a uart/TCP bridge and worked fine too

So the issue lies elsewhere it seems?

rama3
Verified
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: Apr 16, 2017

Post by rama3 » July 25th, 2019, 7:32 am

True, that was with the handshaking.
Okay, so using an ESP8266 is actually a good recommendation.
These dev boards are quite small, come with USB bridges, offer WiFi, and are cheap.
I'd much rather use one of these, than pay FTDI and support their malware practices ;p

Regarding software, it's probably best to do all the nice drawing as a first step.
On the actual data transfer, the CPU should be as idle as possible.
Don't generate long display lists for the GPU, don't call library functions, stuff like that.
If there are VBlank handlers, they should be suspended as well.
I don't really know what else could be running, but that also should be off ;p

rama3
Verified
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: Apr 16, 2017

Post by rama3 » July 25th, 2019, 7:50 am

I'm trying to find the "_sio_control" implementation in the psyq sdk, but so far no luck.
It's kind of important ;p

Edit:
Uh oh, is the implementation using kernel routines?
It's well documented how problematic the kernel is..

If that's indeed the case, the SIO stuff should be rewritten.
And if the kernel code is actually the same / similar to the pad / memcard stuff, expect a huge performance increase ;)

Edit2:
Nocash notes on SIO_BAUD have this to say:
The maximum baud rate may vary depending on the length and quality of the cable, whether and how many inverters and anti-inverters are used (on the mainboard and in external adaptor, and on whether signals are externally converted to +/-12V levels)... anyways, rates up to 9600 baud should be working in all cases.
However, running in no$psx, Wipeout 2097 seems to use about 2 million bauds... although, in older no$psx versions, I believe I did see it using some kind of baudrate detection, where it did try different rates in steps of 200 bauds or so...?

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » July 25th, 2019, 4:59 pm

Is that because Wipeout used the link cable or because they were using it for some internal development reasons when making the game?
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

danhans42
BANNED
BANNED
Posts: 329
Joined: Nov 28, 2012

Post by danhans42 » July 25th, 2019, 7:35 pm

Wipeout used a link cable.

It might be worth looking at libcomb which is the PsyQ library for using the 'combat' or link cable as there will be some games that used it.

There are some examples of it in use in the PsyQ samples (look for libcomb).. never really looked at it though so unsure as to how it works with handshaking and such.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » July 25th, 2019, 8:26 pm

This enables the serial port

Code: Select all

_sio_control(1, 2, MR_SB_01|MR_CHLEN_8|0x02);
_sio_control(1, 3, 115200);
_sio_control(1, 1, CR_RXEN|CR_RXIEN|CR_TXEN); // serial interrupt
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

danhans42
BANNED
BANNED
Posts: 329
Joined: Nov 28, 2012

Post by danhans42 » July 25th, 2019, 10:13 pm

Shadow wrote: July 25th, 2019, 8:26 pm This enables the serial port

Code: Select all

_sio_control(1, 2, MR_SB_01|MR_CHLEN_8|0x02);
_sio_control(1, 3, 115200);
_sio_control(1, 1, CR_RXEN|CR_RXIEN|CR_TXEN); // serial interrupt
Thats used everywhere pretty much, from hitserial, to nxflash etc..

i was referring to comb.. if you look in the PsyQ samples folder there is an example.

in the RC9.c file, it shows...

Code: Select all

#define BR 2073600 	/* max:2073600 */
and further down the file...

Code: Select all

_comb_control(1,1,3);	
	_comb_control(1,4,8);
	_comb_control(1,3,2073600);

So obviously there is some more speed to be found. However, handshaking may also be used. The library makes it easier to make a link game, without having to worry about coming up with a protocol. The line seems to indicate there is some sort of speed negionation. Could it be that depending on the cpu load on the psx.. it can slow down to accomodate?

danhans42
BANNED
BANNED
Posts: 329
Joined: Nov 28, 2012

Post by danhans42 » July 26th, 2019, 2:12 am

So,

Have just found the following in the library reference..
Capture.JPG
So trie 518400... works perfectly,

and then tried 1036800.. also works perfectly!!
You do not have the required permissions to view the files attached to this post.

danhans42
BANNED
BANNED
Posts: 329
Joined: Nov 28, 2012

Post by danhans42 » July 26th, 2019, 2:26 am

[BBvideo=640,480]https://www.youtube.com/watch?v=MZ8b6LGZ-XA[/BBvideo]

Video here.. I used Hitmen/Skywalkers Mahjongg - 1.5Mb (1,456,128 bytes) in the video.

Very fast!

I have attached a PAL ISO.

Also made some changes.. do not see the point in the speed option. If you want to stick at 115,2k you can use always use PSXSERIAL, or the fuller featured LITELOAD. So have removed the speed select options and simplified the code slightly.

Source, compiled EXE are on github.

PAL BIN/CUE is attached.

Enjoy!!
You do not have the required permissions to view the files attached to this post.

rama3
Verified
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: Apr 16, 2017

Post by rama3 » July 26th, 2019, 3:36 am

Nice, I knew it :D

The wait time is so-so overall, but then again, very little software would be 1.5 megs, right? :)

Oh by the way, the latest blog post link is slightly wrong, linking to https://github.com/danhans42/sioloader << "er" is bad :p
Last edited by rama3 on July 26th, 2019, 3:46 am, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest