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".
"Maybe"
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.

data/images/20160324_usb_test3.tb.jpg
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 ...

data/images/20160324_usb_test4.tb.jpg
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

Read more Pseudo Saturn Kai development : USB dev cart support

Pseudo Saturn Kai lite firmware fixes and improvements

Written by cafealpha no comments
One month from last update, but not significant updates
The reason is that children fought with nearly all typical winter diseases during the last three weeks : mumps, influenza (x2), gastro enteritis, and finally otitis ... x2 too

data/images/20160314_gg_winter.tb.jpg
Internet husband ...
I hesitated to put other pictures like "x2 combo !"
and "body temperature over 40 ? High score !"

Children were relatively safe from winter diseases until last month, but last spurt until summer was relatively heavy for them


So, no significant updates, but various minor updates :]

Among theses updates, main menu display has been improved when lite version of the firmware is used :
 - "Extra" features moved to main menu
 - System status now displays Saturn related informations (BIOS version and PAL/NTSC frequency information) rather than nothing when USB and SD card aren't detected.
Theses changes concerns USB dev cart and Action Relay users, hence the majority of Pseudo Saturn Kai future users, so theses changes couldn't be avoided before initial release

Here are pictures taken before and after the changes.
Many thanks to Zone66x for testing and taking theses pictures

data/images/20160303_pskai_5820.tb.jpg
Pseudo Saturn Kai v5.820 : status display was a little "empty"
And USB port was incorrectly detected when running from Action Replay ...



data/images/20160310_pskai_5875.tb.png
Pseudo Saturn Kai v5.875 : some saturn informations are now displayed.
There's no simple way to detect if cartridge is Action Replay or not,
so generic "Boot Cart" string is displayed when cartridge type is unknown.

And main menu is a little simpler :
no longer need to go to sub menu in order to access extra features.


Also, Zone66x verified that Action Replay communication port (parallel-like port) was usable with Pseudo Saturn Kai. Thank you for testing



Another new feature I'm proud enough to introduce it on my blog is the soft reset "à la carte"
Soft reset is used in Pseudo Saturn Kai when loading game from CD-ROM, and also when executing program received from USB port.
Basically, it wipes all memory, and puts VDPs memory and registers in initial state, which is good when loading game from CD-ROM, but causes problem when Saturn developer wants to do something else than "just" executing program on main RAM.
The "à la carte" advantage comes here : it is possible to select which module to soft-reset, and which one to let as-is before executing program.

Here is an example :

data/images/20160318_pskai_main_screen.tb.jpg
Pseudo Saturn Kai (lite version installed on USB dev cart) main screen.
Test program will be executed from this screen.

Let's try to let VDP registers and VDP1 RAM as-is when uploading test program :
data/images/20160318_test1_satlink.tb.jpg data/images/20160318_test1_result.tb.jpg
Soft reset "à la carte" settings and execution result :
Starfield (VDP1) remains in memory and is displayed on test program.


One more try, but with VDP1 RAM clear before execution :

data/images/20160318_test2_satlink.tb.jpg data/images/20160318_test2_result.tb.jpg
Soft reset "à la carte" settings and execution result :
As VDP1 RAM is cleared, starfield is no longer displayed.

Possibilities for this features are relatively wide : it's for example possible to upload graphics on VRAM, then level data on sub RAM, then execute test program on RAM.
I hope this will help to improve Saturn homebrew development scene :)

Read more Pseudo Saturn Kai lite firmware fixes and improvements

Pseudo Saturn Kai : still WIP ...

Written by cafealpha no comments
Still WIP, and last week was a busy one !

First, I fixed USB dev cart legacy firmware-like screen that wasn't working at all. Well that's a developer-oriented feature that I seldom use, but that needs to be fixed anyway
The fact I seldom use this feature was the starting point of the problem : modifying a module apparently not related with that feature caused major bug ... software development in a nutshell
Thank you Shazz for beta testing my firmware There are still other bugs remaining, and I plan to fix theses soon

And, (what's more important), game loader was sometimes loading game, sometimes not. Loading game backups is Pseudo Saturn Kai main feature, so I really don't want it to fail
Origin of this bug was unclear, but I fixed/improved many things at once, and game loaded every time after that, so let's hope I won't have to face with it in the future

One additional "bug" was game loader being kicked to multiplayer screen, and it was caused by ... game corrupted dump
First half of the game IP header was filled with zeros, so Saturn couldn't even recognize it as a Saturn game ...
I "fixed" what I could on firmware side by displaying something like "bad game dump/burn ?" message before kicking to multiplayer screen.
Let's hope it will reduce the amount of "can't load xyz game ! Hurry up to fix your bloody firmware !!" kind messages after release


And of course, there were many, many minor fixes, for example :
 - Added scrolling help messages under menus
 - Credits screen ... stub (names missing), and only in Save Data Manager for the moment
 - Added alternate menu exit keys : it is now possible to do something like "A/C:select, X:delete, Y:info, Z:whatever" in a single menu. This is preliminary work for Action Replay codes addition


So firmware development is continuing ! Everything is in good way :
data/images/20160225_please_disperse.jpg
Pseudo Saturn Kai development is going well. Please disperse.
(Screenshot from The Naked Gun)

data/images/20160225_nothing_to_see_here.jpg
Nothing to see here 
(Mr Nielsen, you're missing us )


On a positive note, I tested Bubble Bobble (listed as incompatible in Pseudo Saturn compatibility list), and it worked fine
I absolutely don't know why it works fine. I suppose that registers cleanup and running RAM cleanup code from ROM just before loading game helped a bit ... well at least it works



Completely unrelated note : I uploaded 10+ years old videos of me playing Tetris Attack puzzle mode ! You can enjoy the videos in my Tetris Attack page , or directly in the appropriate youtube playlist for theses videos.

data/images/20050105_ta_puzzle_ending.jpg
Tetris Attack puzzle mode ending screen

Read more Pseudo Saturn Kai : still WIP ...

WIP : Saturn Save Data Manager, Pseudo Saturn Kai & USB dev cart, etc

Written by cafealpha 6 comments
Pseudo Saturn Kai  firmware development is currently paused in order to focus development into Save Data Manager application

Saturn Save Data Manager is an application in order to manage (copy, delete, etc) save data on your Saturn.
Basically, it is similar to the save data manager provided by Saturn BIOS, but also offers extra things, such as multiple selection of items to copy/delete, GPL license, and also save data import from various formats.

data/images/20160125_bupmngr_main_screen.tb.png
Saturn Save Data Manager main screen running on emulator.
It also works on real hardware, but I was too lazy
 to take a picture of my TV screen


At first, this Save Data Manager was made only in order to test Virtual Memory Cart behavior, so maybe user interface looks a little cheap, but I plan to improve this in the future according to first users eventual feedback


I really want to thank two people whose work helped to make this application :
 - Rockin-B : for his good old SaveGameManager application (yes, I copied the name of the application).
 - hitomi2500 : for his ss-save-parser application that really helped to understand Saturn Save Data structure. Also, I merged its Save Import related sources to my project, so that copying save data from dump file is possible directly on Saturn too


And, there's one screen that I need to show from ss-save-parser application : the "extract options screen". This is image is worth a thousand words when trying to explain how save data is arranged in Saturn backup RAM

data/images/20160125_save_data_structure.png
THE screen everyone need to see before
hacking Saturn saves data
Save data is arranged as header
(containing save name, comment, etc),
then blocks allocation table,
then data itself, with header data at
the beginning of each blocks.




Extra #1 : last month, I took a video of USB dev cart in action !
Nothing really spectacular however, but please watch it if you want to see what developing application with USB dev cart looks like
data/images/20151217_usb_dev_cart_demo.jpg
My dev laptop, a plain, not modded Saturn and USB dev cart,
ready for testing Saturn application on real hardware


Summary of the video (more details available in youtube page of the video) :
 - USB dev cart firmware update
 - CD-ROM unlock by using Pseudo Saturn hack
 - Upload and execution of program from PC to Saturn via USB, allowing testing of application performing CD-ROM access.


Extra #2 : with this USB dev cart, I could dump Shining Force Scenario 1 saves from Gosub .
You can find theses saves here.
data/images/20160112_gosub_sf3sc1_t.jpg
Backup cartridge with gosub's saves on it.
Thanks to Darius for providing me the cartridge

Gosub pushed each Shining Force character to their maximum competence on real hardware without using any cheat.
Really impressing work oO


Extra #3 : last month, my car reached its life achievement : 777777 kilometers :]
data/images/20160120_lucky_seven.tb.jpg
Wow. Many lucky seven. So beauty
Next challenge : 777 777 kilometers !


Read more WIP : Saturn Save Data Manager, Pseudo Saturn Kai & USB dev cart, etc

New USB dev carts for sale !

Written by cafealpha 6 comments
Last week, I soldered new USB dev carts, so please let me know if you want to purchase one

What's new with theses carts ?
I use new PCB (Rev 2e) and flash chips that allow to store firmware larger that Action Replay firmware :
 - Action Replay Flash ROM : 256KB
 - USB dev cart Flash ROM : 512KB
It will be useful when making custom firmware for this cartridge

And, I'm now familiar with using flux when soldering ! Before, I was soldering small pitched parts (typically, the FTDI USB chip) with stain in excess, then using solder wick. This gave good results, but I wasn't satisfied with the visual aspect nearby soldering points :

data/images/20150518_no_flux.tb.jpg
Before : only stain & solder wick used to solder FTDI chip

data/images/20150518_flux.tb.jpg
After : flux used to solder FTDI chip


And, there are now "ROM cartridge" available for sale !
This is just an "USB-less USB dev cart", but it allows to run Pseudo Saturn firmware, and also future revisions of the firmware with ROM size larger than 256KB available on Action Replay carts. And of course, it is a little cheaper than USB dev cart

data/images/20150518_romcart.tb.jpg
ROM cartridge ... well, this is just USB dev cart without USB modules, so nothing really new ^^;
This cartridge is interesting in the case you want an USB dev cart for dev things, and another cart for gaming purpose.

Read more New USB dev carts for sale !

Rss feed of the tag