PPCenter :: devblog

PPcenter. Arts and craft for my Sega Saturn. Since 1847 :D

Pseudo Saturn Kai development : USB dev cart support

Written by cafealpha 7 comments
It's a long time USB dev cart is supported on Pseudo Saturn Kai, but it wasn't tested seriously elsewhere than my development environment.
... Until now

(Well, in fact, it was "until a couple of months ago", because I didn't had time to write this article earlier.)

So, a USB dev cart new user (Shazz) wanted to do some Saturn development : great

USB dev cart demo
USB dev cart demonstration video (youtube).
I used Shazz's USB dev cart to make this video,
in order to be sure it worked well before sending it to him.

His dev PC runs under Linux ... I personally use Windows only, so I can't guarantee USB dev cart + Pseudo Saturn Kai will work correctly.
"Maybe it will run fine with antime's ftx tool".
Of course, it didn't worked

My first suggestion was "please use an old PC with Windows installed lol", but Shazz don't like such half-concession, and really wanted his USB dev cart to work directly on his Linux dev PC.
As an USB dev cart manufacturer, I agree with him.
As a programmer already busy with other projects and real life, I disagree ^^

But, Okay, Shazz is actually a cool and chatty guy, and sharing same mother tongue with me, so I will do it for him

The cause of the problem happening when using Linux + USB dev cart with Pseudo Saturn Kai is actually still unclear.
With original USB dev cart firmware (nicknamed as "blinking screen", or sometimes "epileptic screen"), executing a Saturn program with "ftx" utility works fine.
However, with Pseudo Saturn Kai installed, the same operation didn't worked and Pseudo Saturn Kai main screen was freezing (? or continuing doing menu things ? I already forgot about details about this bug  It's really time to write it on this blog before I forget it completely ...) instead of switching to uploaded program.

I suspected Pseudo Saturn Kai ignoring two successive commands from USB dev cart ("executing" a program is actually sending an "upload" command, then "execute from specified address" command), especially because Pseudo Saturn Kai can't check for USB I/O continuously : it "just" does it once every frame.

Since I really couldn't understand why this could cause that "upload, then execute" problem, I decided to countermeasure it by adding a new "upload and execute" USB dev cart command.
And on the same occasion, I also added the "à la carte" reset flags in this command : "one stone, two birds", as people in Japan would say ... I suppose that other people would rather say "one USB dev cart command to rule them all" :D

One more problem about this "Linux + USB dev cart + Pseudo Saturn Kai" problem was that I couldn't verify if everything is working fine or not.
Shazz was OK to do some beta testing, but he can only upgrade his USB dev cart via USB link, so "breaking" USB transfer would brick his development cartridge.
Around software development, I experienced enough Murphy's law and its corollaries to be sure it won't work on first try :
 - "If it can break, it will break"
 - "The less you test, the more likely it will fail on basic pattern"
 - "The more you test, the more likely it will fail on unexpected pattern"

So I added Pseudo Saturn Kai "demo" version
As its name suggests, it actually doesn't do anything special else than showing menus, but that's enough in order to test communication with PC.
Additionally, I also displayed some debug messages to screen when doing USB related stuff.

Pseudo Saturn Kai demo version
showing USB activity logs on screen
First two lines logs USB dev cart firmware version
verification : even if used with old (not Pseudo Saturn Kai)
version of firmware, transfer utility works

After testing many buggy versions of the firmware, Shazz tried the "20160323_test4" test pattern with his "parallax" test program, and ...

Could upload and execute libyaul example program
from Linux via USB dev cart and Pseudo Saturn Kai !

Thank you Shazz for testing Pseudo Saturn Kai + USB dev cart Linux support !

USB debug port related support is always a hell for me and cartridge users (may not work on a given OS, etc), hence there are no plan to add it in release version of my cartridges.
But even if it requires drivers and custom transfer software on PC side, debug USB connectivity is a must have when developing things on Saturn, so rather than dropping USB debug port, I plan to make a "USB + SD card interface" cartridge for Saturn developers only.
And of course, I still continue to manufacture USB dev cart


#1  - seal1 said :

still following your news and shame on me: still got no time to get my saturn stuff from storage.

will your "USB + SD card interface" also features a memory/ram extension ?

this would be the ultimate cart - hardware-wise - for me:
- usb-dev
- freezer feature (some kind of NMI-button like in 8/16 bit days on c64, xl/xe-atari or amiga) to enter hexview, tracer, disasm, debugger, etc.
- memory extension
- save memory
- sd-card interface (for now this is the least importend feature for me, but useful in future with failing optical drives)

#2  - cafealpha said :

@seal1 : it is currently "just" an USB dev cart with SD card interface. It doesn't replaces CD-block unit, and doesn't allow RAM extension too.I plan to make future cartridge protos, and related software more convenient for dev people, but can't guarantee when theses will be available.Can't wait you to take back your Saturn stuff for storage :)

#3  - seal1 said :

replacing the CD-block is needed for native SD-access (full transparent CD-Drive-replacement) ?

so for 100% compatibility of all CD-backup-games (with pseudo) a CD-Block-replacement is needed ?

and your soon to be released "Saturn Gamer's cartridge" doesn't do that now, but its your goal for a future cart ?

and it's the foundation to play backups from SD-card-interface ? (but the current speed of 40 kb/s will be the next bottleneck ? maybe "host"-mode from the usb-chip and usb-flash-drive or usb-hdd would be a better solution because current transferspeeds there are already 300 kb/s equals the old double-speed-cd-rom-specs.)

homebrew-code which is aware of the SD-card-interface is already able to use it.

I hope my saturns and carts still workin with up to 20 years of age. I lot of amiga owners have leakin caps, but those amigas are mostly 5+ years older.

#4  - cafealpha said :

@seal1 : "so for 100% compatibility of all CD-backup-games (with pseudo) a CD-Block-replacement is needed ?" > If needed, I will do some "case-by-case" workaround (UBC stuff, code patching, etc) for popular games that still don't want to boot. For the other ones (buggy, but probably nobody still playing them), a CD-block replacement solution is required.

#5  - cafealpha said :

@seal1 : "and your soon to be released "Saturn Gamer's cartridge" doesn't do that now, but its your goal for a future cart ?" > of course :) Gamer's cartridge is just a first step : allow memory cartridge on SD card.

#6  - cafealpha said :

@seal1 : "and it's the foundation to play backups from SD-card-interface ?" > Absolutely not. This is the simplest and cheapest solution for memory cartridges needs. I will re-think of cartridge whole architecture in order to get a good balance between specs and price when adding CD-block emulation.

#7  - cafealpha said :

@seal1 : PS : If you need, we can discuss more about Pseudo Saturn Kai and Gamer's Cartridge on segaxtreme forums. There is a thread there for that ;)


Write a comment

Please enter this homepage's webmaster favorite video game console name.
It fits in 6 letters and is case insensitive.

Rss feed of the article's comments