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

USB dev cart & SD card interface on a single cartridge

Written by cafealpha 1 comment
Classified in : Saturn, Programming, Mylife Tags : usb dev cart, kai, WIP
Last week, I populated the second "USB & SD card" dev cart ever

data/images/20160112_usb_sdcart.tb.jpg
USB & SD dev cart Rev 3.2

Why "second" ? Because the first "USB & SD card" dev cart I made is the one I'm currently using for dev :
data/images/20150716_memcart_rev2f.tb.jpg
USB & SD dev cart Rev 2f

PCB revision is different ... can you spot the differences ?

It can't be seen on the picture, but Rev 2f have a 128KB SRAM chip soldered on its rear side.
I actually don't use it, this is just a remain of the times I though extra RAM was required in order to get "SD Memory Cart" features to work.
After many tests, I could verify that it was not needed : SH-2 code for "SD Memory Cart" feature runs directly from Flash ROM, and 16KB+8KB of work RAM provided by games for Backup library is enough for my needs.
So I removed the routing for this SRAM chip on Rev 3.2 PCB

Another story, but about Rev 3.2 cartridge pictured in this article : I was about to trash it because I couldn't flash its CPLD firmware, and hence thought it was broken.
I first though that CPLD itself was broken (this may rarely happen when overheating it during soldering), so I removed it and soldered another CPLD, and ... same behavior
CPLD itself is detected by Quartus, but flash always fails at 98% of the flashing process. I (finally ) start to think it may be a power supply related problem, and ... bingo : CPLD wasn't 3.3V as expected.
In fact, this board features two 5V -> 3.3V power converter units (on PCB rear side, can't be seen on the picture above), a "spare" one not connected anywhere (just here in case of), and the "real" one, and I populated the "spare" one
In order to fix this, I didn't populated the "real" one, but instead connected the spare one to SD card and CPLD power supply line, and that's why there is a grey wire nearly USB connector



Final note : as I consider USB port for debug only, I don't plan to improve the architecture and routing of such "USB & SD dev cart", so I suppose its design will remain "messy and fat" for a while ...
But in the hypothetical case many talented developers will suddenly arrive in Saturn Homebrew scene and will want to develop games using both CD ROM for music and SD card for huge game data (yeah, I really want a Saturn game with gameplay/level/whatever data so large that it can't fit a CD-ROM !), I will re-design it in order everything fit in a standard cartridge shell

Read more USB dev cart & SD card interface on a single cartridge

New USB dev carts for sale !

Written by cafealpha 6 comments
Classified in : PPCenter, Saturn, Mylife Tags : usb dev cart, flux, rom, pseudosaturn
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 !

USB dev cart for sale soon

Written by cafealpha no comments
Classified in : Saturn, Programming, Mylife Tags : usb dev cart, preorder, debug
I'm about to gather parts in order to make new USB dev cart !
I hope to have some free time at the end of the month to assemble few ones, so please let me know in the comments or by email if you want to preorder one unit

Only very few SST39SF040 flash chips were available for sale from IC supplier, so I bought SST39SF020 instead. On Saturn side, this change makes flash memory dropping from 1MB to 512KB, but USB dev cart itself uses only few tens of KB to work, so everything is fine

First, I will assemble my personal USB dev cart, because I sold it few months ago ... I can't wait to finally be able to debug software on my Saturn

Edit (2015/03/10) : My personal cartridge (until I sell it ) is ready and tested !
data/images/20150310_rev1b.tb.jpg
The PCB is a old version, hence some ICs are unused and unsoldered. Latest PCB version has a cleaner design
Two more cartridges are waiting for flashing and testing before selling. I plan to do this on next week.

Read more USB dev cart for sale soon

New USB dev cart - currently debugging

Written by cafealpha 4 comments
Classified in : Saturn, Mylife Tags : saturn, usb dev cart, IC, firmware, debug
Few weeks ago, I had some free time (only one day however) to populate new USB dev carts
data/images/20140829_usb_dev_cart.tb.jpg
USB dev carts during different populating states
"This isn't even my final form"

I could populate 3 boards ... third one is not on the picture, while a couple of capacitors is missing on second one, but this is a matter of 5 minutes to solder.
After that, time was missing, and what's more problematic, ICs were missing too >_<

I soldered my last flash chips (on the right side of the cart), as well as my last USB chips and connectors (top left side of the cart) ... and my last 100nF decoupling capacitor (everywhere near all ICs) too ... it's a shame about the capacitors because they cost absolutely nothing and they are required everywhere in the cart.

So what's the plan from now ? I'm currently improving USB dev cart firmware, and plan to sell the completed cartridge on the bottom right corner of the picture when firmware will be ready for release.
From that money, I will buy a new stock of ICs to populate other PCBs
Why not buying ICs now ? Simply because I don't have enough budget for that, and also because buying ICs in few quantities is too much expensive : IC price decrease with quantity, and shipping fees are free when more than of USD100 of ICs are purchased.


So let's come the interesting part : firmware, which means software !
Last month I had enough about PCB design with Kicad, so that was good to get back with my Saturn and USB connect it to my laptop

data/images/20140829_dev_env.tb.jpg
My Saturn development environment : no expensive vintage development kit,
only a modchipped Saturn, USB dev cart and 7 years old laptop are enough.

So of course I lost a lot of time with stupid software troubles.
Here is a list of the troubles. I hope that writing them here will prevent me from repeating the same mistakes in the future.

 1) Data alignment problem : one structure is 1 byte packed, and some long word was put a non 4 multiple offset in this structure. It is usually easy to spot, but ...
 - It doesn't cause problem under yabause (? not verified, please tell me if I'm wrong), so this problem was unnoticed until I test it under real hardware.
 - It happened during program initialization, before USB transfer would allow me to easily find why my Saturn freezes.
 - I was sleepy at this time

 2) Adding byte size to unsigned long* pointer ... it resulted in pointer set 4 times farther than expected ... really stupid bug
Oh, and in the same fashion, a similar bug in Action Replay flasher utility prevented from writing more than half of flash memory size ... it's good that I could fix this bug before anybody notice it

 3) Saturn freezes when reading flash vendor/device IDs.
As usual, when Saturn freezes, it is during program startup, when USB can't be used for debug ^^;
This problem was the most interesting one : some parts of the firmware runs directly from Flash ROM, and it seems that reading flash vendor/device IDs makes whole flash returning theses IDs, resulting in invalid instruction from CPU ... this is just a guess, correct me if I'm wrong.
This problem was corrected in a very Q&D way : return 0xBFBF/0xB7B7 in FlashGetVendorID/FlashGetDeviceID functions
I have a better idea to fix this, but it requires to modify cartridge flasher utility ... I made enough flasher utility stuff recently (I'm enough in fixing compatibility issues with Action Replay old flash chips !), so I will fix this later.

Read more New USB dev cart - currently debugging

Rss feed of the tag