PPCenter :: devblog

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

Various Pseudo Saturn cartridges

Written by cafealpha no comments
Long time no see ! It's a super long while I wanted to write about several kinds of Pseudo Saturn cartridges (other than the usual Action Replay/Gameshark couple) but as a lot of things in this blog, always postponed it.

But recently I discovered a cartridge that breaks all records in term of extra cheap design and appropriation of other people's work that now I really want to terminate this article

(Note : it's already 10 13 14 29 days after the creation of this article, and it is still not published yet ... but I do my best to finish it )


Disclaimer : I am not affiliated with the designers or developers or sellers of the cartridges below. The reviews below are just my personal opinion and may not reflect the exact contents or behavior of the cartridges. And in case of questions regarding theses cartridges, please contact their sellers instead of me.
Also, please try theses cartridges at your own risks : whatever it may be, I'm not responsible about any damage caused to your Saturn, your cartridges, your dog, your house or anything else !

And let it be clear : the first purpose of this article is to inform users that such kind of not so usual cartridges exist, so that potential users can consider about theses cartridges for their own usage.
But if a cartridge deserves to be flamed, then I don't refrain about that, especially when it concerns the appropriation of other's people work.



Saturn NinjaDrive


From what I could see, that's an Action Replay cartridge with custom label and Pseudo Saturn Kai pre-installed. The "deluxe" edition features a stylish box for the cartridge.
It probably would had been appreciated to indicate that Pseudo Saturn Kai is installed rather to rebrand everything under a different name ...

Pros :
 - The price without stylish box is not that bad
 - Pseudo Saturn Kai is pre-installed
Con :
 - It would had been fair to indicate that cartridge is made from Action Replay cart
 - There's no indication about which firmware is installed



Saturn Unlocker



That's in the same range of contents (and price) as NinjaDrive : Action Replay with Pseudo Saturn Kai pre-installed. At least there's no attempt to hide about what is installed.
A description video at the lower half of the cartridge's page shows that Pseudo Saturn 0.832 is installed, which doesn't works at all on some Japanese model 1 Saturn The video itself is quite old, so let's hope that latest version of Pseudo Saturn Kai is installed on the cartridges now

Pros :
 - Classy box and label, a must have on your collection shelf
 - Pseudo Saturn Kai is pre-installed
Con :
 - It would had been fair to indicate that cartridge is made from Action Replay cart
 - Maybe a bit expensive ?



All in One RAM Backup Cartridge


All in one cartridge, front side.
Picture credits : SaturnGuru.

I couldn't find an official homepage for this "all in one" cartridge, but this is paradoxically the most valuable cartridge in this article
This cartridge model features both Action Replay support (boot ROM and 1MB/4MB expansion RAM) and 512KB backup memory storage. In simple words, it is the result of Action Replay and official memory cartridges blended together.

The backup memory is implemented with its own flash ROM chip, in the fashion as official backup memory cartridges, thus shall provide a 99% compatible (I keep the last 1% just in case of any eventual picky game that would cause problem, but this would be surprising such one exist) and in-game support for cartridge backup memory.

Using dedicated flash ROM for backup memory unfortunately means that it will be corrupted and finally no longer accessible after many write cycles, but ... this is how official cartridges worked too
However, since boot ROM and backup memory are stored in physically different flash ROM chips, the cartridge will still boot Pseudo Saturn Kai even if backup memory chip is damaged, which is one point over Action Replay where damage of backup memory ROM means the loss of nearly all other features.

Regarding firmware installed, the ebay pages selling this cartridge model I could see so far clearly mention that latest Pseudo Saturn Kai version (v6.074 at current time) is installed, and even explain the basis regarding cartridge usage such as loading a game, or accessing Save Data Manager, etc, which is quite a fair and remarkable way of doing

A review with only praises may look a bit biased (and no, I didn't received any money nor even any email from seller of this cartridge), so I would like to critic about the electronics parts used in this cartridges : theses are the same as used in Action Replay or official backup memory cartridges.
As a consequence, the technology used is no longer produced, thus probably coming from shady old stock, or counterfeit chips factory, or recycled from vintage devices. In each case, this means that in the long term, quality may not be at the meet.


An interesting related question is "Why releasing such cartridge around 20 years late ? This could exist at the time Action Replay cartridge development was still active !".
My guess about this question is that Action Replay development and/or sales team wanted to put everything (boot ROM and cartridge memory) in a single flash ROM chip, giving birth to the "if a ROM feature breaks, the whole cartridge is bricked" cartridge architecture used in Action Replay carts.

I personally like to write to flash ROM only when upgrading cartridge firmware, so that I dropped backup memory support on Pseudo Saturn Kai lite.
So my second guess is that it motivated someone to finally merge Action Replay and backup memory cartridge in a single one ? If this guess is right, then I'm glad to have indirectly contributed to the development of this cartridge

And yes, I am the only one responsible of this backup memory feature no longer available after installing Pseudo Saturn Kai. That's a deliberate choice to avoid cartridge bricking and I will never add a feature for that, so don't hesitate to share your hate towards me in the comments of this article 


As an extra note, I could notice that several hardware variation for this cartridge model may exist, so anyone interested in purchasing such "all in one" cartridge should carefully verify it's item description page as well as features list indicated at the back side of the cartridge.
All in one cartridge : list of features available.
Picture credits : SaturnGuru.

And finally, please enjoy a picture of each sides of the cartridge PCB Theses pictures clearly indicate how the cartridge works, and were a great help when preparing this article.

All in one cartridge font side.
Left half : expansion RAM and glue logic for each chips.
Right half : flash ROM chips for cartridge firmware.
Picture credits : SaturnGuru.

All in one cartridge rear side.
Flash ROM for cartridge backup memory.
Picture credits : SaturnGuru.

Pros :
 - Supports basically nearly all the Saturn games library
   (Except the couple of games requiring their own ROM cartridge, and those others eventually not compatible with Pseudo Saturn Kai)
 - Pseudo Saturn Kai is pre-installed
 - There's no attempt to hide that Pseudo Saturn Kai is installed
Con :
 - Cartridge backup memory may deteriorate after heavy usage.



Saturn PASS

You're full of all theses cartridges to digest in a single article ? That's bad for you, because I kept the most greasy dish for the last time

Saturn PASS cartridge

This is a very simple cartridge with only boot ROM, and nothing else : no cartridge shell, and not even decoupling capacitors near the ROM chip ...
The decoupling capacitors protect neighboring components against voltage spikes : as theses apparently don't have any functional purpose, they are sometimes removed by cheap device cloners ...

Additionally, ROM chip used seems to be a UV EPROM, easily identifiable with the small round window at the center of the chip.

UV EPROM chip detail
Yes, I did hit the snapshot key around 10 times to get
the right moment when UV window is visible
(Screenshot from this video)

As a consequence, firmware update requires dedicated device to illuminate the chip with UV light prior writing of the ROM and basically can't be easily done on user side.

Additionally from being technically difficult to upgrade, Saturn PASS users will also have to enjoy the custom firmware pre-installed : apparently it's a stripped version of Pseudo Saturn (or it will be an huge coincidence that log message under "Loading CD" is the same in both firmwares) with only the bare minimum remaining :
 - No boot menu
 - "Pseudo Saturn" name changed to "Saturn PASS"
 - Addition of URL to Saturn PASS homepage
 - Removal of Pseudo Saturn credits

Saturn PASS boot screen
For unknown reason they left as-is the
log display in is_audio_cd function.
(Screenshot from this video)

Pseudo Saturn is open source, so anyone with enough skills is free to change things in the firmware to their preferences. But rebranding the whole thing and trashing credits to original development team is not how open source works.
So if someone wants to thank somebody for Saturn PASS to exist, they should refer to credits displayed in Pseudo Saturn :
Copyright 2011-2015 Pseudo Saturn Team
http://github.com/cyberwarriorx/pseudosaturn
At a glance, removal of boot menu and only keeping the Pseudo Saturn exploit sounds a good idea, because that's one step less to do on user side before playing a game.
But except that point, it's complete crap : extra features (to verify if cartridge is working correctly or not, or to verify version of Saturn internals, etc) are no longer available, as well as credits page too.

Personally, I derived Kai from Pseudo Saturn specifically for adding features other than Pseudo Saturn exploit : memory cartridge support in previous releases, cheat codes in next release(s), and probably something more in future release(s). So removing all the menus and extra features just to spare the push of one button to play a game is "no, I won't do that"

Pseudo Saturn Kai credits page is probably just a feature to boost my own ego, but I am not the only one listed there, and everybody credited contributed for free : done on their free time and without financial compensation. So muting them is definitely not an option. Also, I made several graphic improvements when displaying credits, so I hope you will enjoy them in next release

To finish on a positive note about Saturn PASS, it should be mentioned that its price is relatively reasonable : 350 Thai Bath = around 10 US Dollars, which makes this cartridge affordable for Thailand users

Pro :
 - Affordable for Thailand users.
Cons :
 - Poor hardware design.
 - Can't upgrade firmware.
 - No credits to original firmware developers.

PS : I heard about this cartridge from furrtek. Special thanks to him for the information

Read more Various Pseudo Saturn cartridges

End of 2018 Summer vacations

Written by cafealpha 6 comments
... One month ago, I wanted to announce that I wouldn't be available for several weeks, but I was suddenly taken in a storm of bringing/taking kids to/from schoolchildren care, washing bento boxes, going to work and the usual dish-wash/throw trash/laundry/whatever daily routines

Personally, I only had two rest days at the middle of August generously offered by employer as summer holidays ... two days !! That's one day, and ... one another day  Moreover both are consecutive And  that's ... so long I fear I would forget everything about work after such a long rest
Well, more seriously I took some day-off here and there during August too, and theses were a good occasion to refresh from everyday life

As a consequence, I completely neglected my email box during this period of time. Sorry to all concerned people !
I will try to tidy-up my mail box this week, but can't guarantee that everything will be done on planned time since day work went a bit crazy recently

So here comes some lines about my summer holidays ... hey, that's my homepage which I pay for hosting and where I installed and filled this blog, so I write whatever I want on it

So if you're not interested in me talking about my life, please skip until next horizontal separator


Summer 2018 activity #1 : going to the beach

As every summer, I celebrated the lapse of one year by going to the beach : four years ago, I spent nearly two months at hospital without any occasion to go outside, so that I like to take a revenge every year
At that time, I had around 50-60% of chances to be still here today. It's good to be alive

Well, there were a bit more medusa than usual, so I didn't swam so much, but that's better than not being able to go to beach at all anyway


This is an illustration photo : the girls are just
to boost my blog audience.
And I own TI-89 calculator rather than TI-83+


The kids wanted to make a sand castle, which
ended in some kind of free-style art
Title: Japanese style toilet, by cafe-alpha kids, 2018

I like that they didn't spent half a day to do a instagram-compliant thing that would then be destroyed by the sea but had fun anyway


Summer 2018 activity #2 : watching typhoons
I don't know if that's limited to the region I live, but there were a lot of typhoons this year ! There wasn't any kind of major damage nearby, but not everybody in Japan could be that fortunate ...

Personally, it was the occasion to do some cleanup on the balcony : I trashed several things that accumulated over past year, and Mr Typhoon helped to clean up dust after that

I wish typhoon and other similar kind of natural disasters could evolve into intelligent entities to clean up earth from climate-skeptical trolls



Rare footage from the birth of a French citizen
(That's not super related with typhoons, but this is my blog,
and I write whatever I want on it )


Summer 2018 activity #3 : going to several kinds of museums
The kids like museums, especially to watch insects, machines or similar stuff. But museums close early, unfortunately.

Close at 4PM ?!
That's not a museum, but an hideout for civil workers

Always should read the little letters : "open until 4:30 PM ... but can't enter after 4PM"
The rear door was still open, so we could sneak inside anyway ... that's funny to hack museum rules

Went to aquarium too. That's a Hammerhead Shark.
And it's also a multi-purpose drawing :
tilt your screen and E.T. will appear


Summer 2018 activity #4 : watering plants
Kid bring back okra from school. One of summer vacations homework was to take care of that thing, but from the limited range I could see, only me was doing such boring duty
Mr Okra in all its glory.
I put it near the space for hanging
laundry so that I don't forget to water it


Summer 2018 activity #5 : watching Saturn for real !
Local astronomy group prepared an "Watch Jupiter, Saturn, and also a bunch of other stars I forgot their name" event ... so I was super interested in it

土星, during small explanations about how to locate things in the sky.
Saturn was so bright it's hard to miss it in the night sky
But Mars was even brighter this summer !

This was also an occasion to assemble a small telescope by oneself. That's a cheap "30 bucks" model, but with lens good enough to see Jupiter moons oO


Summer 2018 activity #6 : adventuring in Tokyo

In order to renew a identification paper, I had to go to embassy located Tokyo : this was basically one day spent in transports, except 15 minutes at the embassy itself to sign a couple of papers, have my fingerprints taken, and pay 12198 yens

That's a long time I didn't get lost in Tokyo Everything was more or less smooth in changing from plane → train/subway → bus, but in the last steps walking to the embassy, the battery of my phone decided take a little rest for the remaining of the day
I was aware that battery wouldn't last long, so I printed nearly all directions, but last "use your own foots" steps weren't detailed a lot Fortunately the "ask random people around" solution could guide me to the embassy

The return back to home without help from phone was more or less OK, and when back to home I finally could unlock my phone
Why unlock ? Because my phone's power switch is broken At a moment, I asked for an estimation to my phone carrier to get this fixed, and price was around 80 buck-ish, so I decided it would be better to live with this broken switch rather than paying that
Now, I'm used enough to my phone power in sequence that I no longer consider it as a problem, but instead as child lock feature : if kid try to play game on it while it is running on battery, it turns off after around 5 minutes

My secret method to turn the phone on is to tweak the debounce circuit with a small wire. Electronics components there are super small (which is probably why the power switch broke ...), why requires the usage of tweezers or a small pliers hence can't be done outside since I don't always bring my electronics toolbox with me when I go on travel

My phone, and its broken power switch.
I feel like MacGyver when I turn on my phone


Summer 2018 activity #7 : going to hospital
This was "just" a routine appointment for periodic screening, and everything was OK This time was the occasion to celebrate the fourth year still alive after surgery

This is an archive picture : all the "no pokemon go in hopital"
warnings were removed. Instead there was a notice that
North side parking is not available, but I didn't took a
picture of it since I doubt the average reader of this
blog is concerned by such news



End of the personal and boring news August was also a time do PCB design to celebrate the 10th birthday of my favorite PCB house
(More pragmatically, I rushed to finish PCB design until August 31st because they were offering discount coupons until that date to celebrate this event )

Among PCBs ordered, there was minor change for Gamer's Cartridge, and a small board to flash MAX3000A CPLDs used in Gamer's Cartridge.

Gamer's Cartridge PCB rev 3.3 (c)

There's nothing changed nor deleted : I just added footprints for alternate voltage regulator : I'm using this alternate regulator in another project, so I would like to unify electronic components used in order to reduce stock management/space/etc to store theses two components.
Additionally, this alternate voltage regulator is a bit easier to solder, so at the end I would like to stick with this one

CPLD flash board

That's a really simple board to interface between CPLD and programming hardware : so far I was flashing Gamer's Cartridge CPLD one by one after soldering each cartridges, but thanks to this board it may be possible to flash a batch of CPLDs in a row hence save some bits of time on my side

Read more End of 2018 Summer vacations

X-Terminator Cartridge Revival

Written by cafealpha 3 comments
This article is not about my own development experience, but from my friend XRider. Thanks a lot to him for the good work and the permission to share his pictures

First, what is a X-Terminator cartridge ? It is a Saturn flash cartridge which provides the following features :
 - 1MB expansion RAM
 - Backup memory
 - Ability to play import games
 - Cheat codes
 - Ability to search cheat codes by using standalone "X-Assist" unit


X-Terminator cartridge and X-Assist
Image taken from SegaRetro

X-Assist is particularly convenient because unlike Action Replay cartridges, it doesn't requires connection to a PC : it is true that connection to a PC provides more features (such as memory access, program upload, etc), but as "connection to PC" basically means "software support will be dropped someday", a standalone unit is a real treasure
For example, do you remember that Action Replay cartridges initially had DB25 connector ? This was for connecting the cartridge to PC via the -sold separately- Comms Link board, whose used now obsolete ISA port, and consequently not supported on nowadays PCs and/or OS.
There are some alternate solutions for connecting Action Replay to PC, whose major one is USB Data Link, but unfortunately it doesn't provides any software support for advanced features such as cheat codes search and testing.
So if you want to search cheat codes for your favorite game, X-Terminator is a good choice ! ... Okay, the user interface is in Japanese, but that's just a detail : after 200 or 300 hours learning about it, it shouldn't cause any problems

On the other hands, the major limitations are probably the lack of 4MB expansion RAM support, and using flash ROM for storing backup save data (which on the long term may brick the cartridge), but for a cartridge developed more than 20 years ago, theses limitations are quite honorable


So, once upon a time, XRider found a X-Terminator cartridge. It was a cheap auction, but on the other hand the cartridge didn't boot anymore, and the X-Assist unit wasn't included

Normal people would add this cartridge to their collection or put it on display as a decorating vintage objet Other people with engineering and electronics education background would put it on their "to repair someday" cardboard, and don't touch it for the next 20 years because they are busy with other projects or work, or real life, or all of theses at once

But XRider is none of them. XRider owns soldering tools. And knows how to use them. And really wants to fix this marvelous cartridge

So, let's try to fix the cartridge ! The first step would be to start with the most common problem, which is broken flash ROM.
In my opinion, this is the most difficult step, because it requires to desolder two chips for a total of 64 pins !
I personally can't do this because of lack of appropriate tools, so the alternate desoldering way I would had used would be to ... use a nipper and cut each pins

Fortunately, XRider likes work well done, so theses chips were removed in a clean way


X-Terminator cartridge, with flash ROM chips removed.
Additionally, all capacitors are removed too : that's
the occasion or never to replace them

Next step is a bit optional, and is about to dump removed flash ROM chips with flash ROM dumper device. This is the best way to verify if failure is due to corrupted flash ROM chips, and if still in working condition, this at least would be an occasion to dump the cartridge's firmware


Flash ROM chip on dumper device.

Dump is full of 0xFF bytes ... unless a miracle happens, theses flash ROM chips are no longer functioning  But, this comforts us regarding initial supposition of broken flash ROM chips causing cartridge not booting
 
Just in case of, let's verify PCB traces around flash ROM chips while theses are removed : this takes only 5 minutes to check, and it would be frustrating to find that cartridge was not working because of broken trace after soldering new flash ROM chips


PCB traces : just requires a light source
strong enough to be seen


What to do next ? Maybe use PLCC sockets so that future replacement of flash ROM chips would be easier ! That's a couple of weeks to wait for the postman, but worth the wait
PCB with PLCC32 sockets soldered

And then, simply replace the flash ROM chips

Next generation is here !


PCB with new flash ROM chips.
Additionally, new capacitors are populated


One last step remaining ! Flash ROM is mounted, but ROM itself needs to be set up with X-Terminator firmware. The simplest way to do this is to use Pseudo Saturn Kai flasher utility : it obviously allows to install Pseudo Saturn Kai, but also several other legacy firmwares in the case someone would want to revert to initial firmware after trying Pseudo Saturn Kai.


Just select the ROM version you want to install,
and follow on-screen instructions

 
Flashing in progress ! Will it work after that ?!


Yeehaw !!! It boot fine, mission done
Let's try with Metal Slug ...

Metal Slug works too !
So it seems there's no need to replace RAM chips


Everything finished ? No, there is a side quest remaining Among the couple of X-Terminator cartridges XRider owns, one X-Assist (pad and LCD unit used to search cheat codes) is missing.
One X-Assist available ? And another one missing ? No problem : let's reverse engineer the first one and DIY the second one

The X-Assist features two PCBs : one for connection interfacing and pad, and another one for LCD, as pictured below.

X-Assist pad/interfacing board

X-Assist LCD board

The LCD board is incredibly complex, but since it was manufactured as a whole and can still be purchased on auctions or second-hand market nowadays, there's no real interest to build it from scratch ! And I personally wouldn't try : that seems too much complex

So remaining is pad and interfacing board : fortunately it uses standard components and not any Gate Array Logic-ish components that would need to be reverse-engineered too. Simply speaking, it's like assembling LEGOs
Multi-meter, a LCD board, electronic breadboard, a bunch of wires, few electronic components ... is there something missing ? Yes ! A LOT of motivation !!


X-Assist DIY prototype, in all its glory


It's so beautiful it deserves another picture !

Let's try for real ! Of course, after verifying any eventual short-circuit with a multi-meter 
No short-circuit ? It's then ready for the "first-lighting ceremony" (火入れ式), as it is nicknamed in my neighboring ... I don't know if that's a common expression in Japan or anywhere else, but I like its naming anyway


No sparks ? No smoke ? That looks good

At first glance, that seems working ! Let's try cheat codes search feature in order to be 100% sure ...

Search unit not found ?!

Arg, it was too early to sing victory X-Assist seems not being correctly detected by X-Terminator cartridge ...
Since text could be sent to the LCD, let's assume nearly everything is working correctly, and that a small detail is causing this trouble ... after some head-scratching, XRider found what's wrong : a Zener diode that initially looked useless was used to return some ACK to X-Terminator cartridge when looking for its connection !


The X-Assist screen after adding the Zener diode :
code search memory could be captured !


65535 candidate codes ?! I'm not sure if correct cheat code could be found this time, but at least the DIY X-Assist unit works correctly now

 

Additional informations are available in French  on Darius forums :


Credits :
 - XRider, for the good work in game cartridges preservation
 - Darius, for gathering French community around Saturn

Read more X-Terminator Cartridge Revival

Pseudo Saturn Kai 6.074 released !

Written by cafealpha 2 comments
Pseudo Saturn Kai 6.074 released ... more than three months ago  Sorry for the late news, but that's still some quite acceptable delay in comparison to frequency I post articles in this blog

The release was initially announced on SegaXtreme forums, because it is my favorite forums for Saturn things (more than 11 years I registered to it !
Big thanks to the forum moderation/maintenance/support team for their steady good work ). Also the news was announced on SegaXtreme first ... because writing an article there takes less time than writing an article on my blog
So since I'm a lazy person, let's slightly arrange this article from what I wrote on SegaXtreme forums !


What's new in this version ? Well, there's basically, not a lot of major features (sorry !), but fix of a critical bug affecting Gamer's Cartridge, and addition of some "minor, but that I wanted to add someday" features.

______________
Features for Gamer's Cartridge users

Indirect Dump
: Dump cartridge (boot cartridge, or official memory cartridge, or any other cartridge) by compressing its contents to internal backup memory, and then extracting it to SD card when Gamer's Cartridge is inserted.
Because of small size of internal backup memory, it may be required to repeat the "insert memory cartridge → Indirect Dump → Turn off Saturn → Insert Gamer's Cartridge → Indirect Dump → Turn off Saturn" cycle several times, but at the end cartridge is dumped
Requires some motivation and free time on user side (It took me 45 minutes in order to dump my good old very first official memory cartridge), but this way of dumping doesn't requires to unsolder cartridge memory chips, which is the most important for me !
Note : if you are the lucky owner of Saturn FDD, then floppy disc is used instead of internal backup memory, and consequently dump is significantly faster and simpler.


Left : Screen display after compressing dump data
to internal backup memory
Right : Screen display after writing dump data from
internal backup memory to SD card
Theses pictures were taken on Indirect Dump's first successful test

One extra application of this feature was to dump ROMs from legacy cartridges such as X-Terminator, Satellite, ST Key and "8MEG memory cartridge". Curious people wanting to test theses cartridges theses ROMs can found them available for flashing (at your own risks) in Pseudo Saturn Kai Save Data Manager.
Special thanks to A Murder Of Crows, AtariBorn and SaturnGuru who dumped their cartridges ... and reported many bugs from early versions of Indirect Dump feature 

 
Indirect Dump development : the cut scenes
Left : dump data corruption (see below for details)
Right : Dump file CRC check error. Fortunately, only dump
computation routine was buggy, and dump feature itself was working


Save Data corruption bugfix : This corruption problem concerns saves on Saturn internal memory, with save data size making save sector allocation table finishing exactly at the end of a sector. Very few games are concerned, and the only example I could find so far is Albert Odyssey.

I found this problem when testing Indirect Dump : data compressed then written to internal save memory wasn't then correctly read and decompressed to SD card.
I initially thought this problem to be caused by Indirect Dump itself, because at the time I had this problem, I just finished to mess with data alignment error when preparing indirect dump's compressed data, so thought that this was the next bug to fix regarding Indirect Dump
Quick investigation showed that contents of read data wasn't as expected, with a small portion of data being same as data at unrelated offset ... so maybe a problem when compressing and adding header etc to Indirect Dump save data ? It took me then a around one hour of testing and code review until I was sure that culprit was actually not Indirect Dump itself, because re-read of save data didn't matched with written save data !
Then, testing Indirect Dump with same input data and virtual memory cartridge disabled worked as expected, which 99% confirmed that problem was located on virtual memory cartridge side !

So yes, "virtual memory cartridge" actually manages save data handling for all backup devices (internal save memory, memory cartridge, and even Saturn FDD too) : this is possible because Gamer's Cartridge hooks Saturn backup library at relatively high software level.
In comparison with 1:1 hardware emulation of save memory cartridge, this has the advantage of being free of capacity limitation inherent to memory cartridge's chips, and also allows to store save data individually on SD card (two files per save, vs big file containing all saves for 1:1 cartridge emulation). On the other side, all the save data handling software has to be re-written, so care has to be taken when re-implementing it

So, this is quite an uncomfortable bug I have to face : save data are corrupted when being written to internal save memory, and Gamer's Cartridge was released around 6 months before, with consequently cartridges potentially corrupting save data in the wild.
Fortunately, while being hard to find, the bug wasn't hard to fix  Basically, this was a timing error when updating current save data block ID, as described below :


Internal Save Data corruption related source code
Left : before fix
Right : after fix



Since I really didn't want to fix half of the bug (and having to fix the remaining half on other release), next step is to add a test bench tool for internal save data memory access !
"Test bench" is a program that automatically tests a lot of patterns for a given function or module. Ideally, all major modules should have their test bench, but in the real world, making test bench programs takes time, so programs are usually manually tested with 2 or 3 patterns, and then developer prays for all other patterns being bug-free 
... And to tell you the truth, this test bench was the largest one I wrote so far  It's not impossible a bug to be still hidden in an untested pattern, but anyway I'm quite confident about the reliability of internal save data support now 

Here is how test bench screen looks like on my dev environment :

SatLink and Yabause couple showing test bench screen.
SatLink and Yabause : my best friends when testing Saturn programs


Screen copy above was taken after fixing internal save data support, and I forgot to take a similar screen copy when bug wasn't yet fixed ... latest Save Data Manager CDROM's + Gamer's Cartridge with firmwave 6.037 should display error in test bench screen, so it would be funny to try it ... maybe someday 
BTW, Test Bench is still available in Save Data Manager CD-ROM (it took me a bit of time to add test bench screen, so didn't wanted to remove it after fixing internal save data corruption bug !), but this test bench screen requires a trick in order to be accessed : did you found it ?

That's all about internal save data corruption : I fixed it, and checked a lot of patterns about internal save data access, so similar problem shouldn't happen in the future !
Additionally, I didn't received any feedback from users about this bug, so let's hope it didn't corrupted game saves elsewhere than on my dev laptop



Autodump : Automatically dump saves from internal backup memory to SD card, so that they can be restored in the case they are lost because of depleted CR2032 battery, or save data manipulation error, etc.
With this feature, you won't have to say anymore "I lost all my saves because of that $%QTY@!#% CR2032 battery" 
Since this feature uses SD card, it is available on Gamer's Cartridge only. And no, I won't write save data into Action Replay's cartridge flash ROM : flash ROM chips are not designed in order to be written frequently, hence using flash ROM as read/write storage area may prematurely brick your Action Replay cartridge.
If you're not convinced about flash ROM limited write cycles, I can make some "cartridge self destruction" feature that would continuously write and erase random data to flash ROM, but don't claim that your cartridge no longer boots after that


An alternate solution in order to keep internal save data change the chip holding internal save memory to a FRAM one that doesn't requires battery to retain saves data, as detailed in db-electronics.ca.
(there are maybe other alternate solutions, so please let me know in the comments if I missed one)

The advantage of this FRAM mod is that saves are not lost when CR2032 battery is depleted. There are however several disadvantages :
 - This is an hardware mod, which requires to remove a chip, then solder another one, hence quite difficult to do.
 - CR2032 battery is still required in order to keep clock and language informations.

For being the developer of Pseudo Saturn Kai and Gamer's Cartridge, my opinion is a bit biased, but autodump is a better solution, because autodump is not an invasive mod (plug cartridge vs change chip on Saturn motherboard), and the FRAM solution doesn't allows to dump save data to modern media device. Anyway, I don't force you to like my projects, so if you don't like autodump, then don't use it


Virtual Floppy Disk Drive. Simulate Saturn Floppy Disc Drive (FDD) behavior, with save data stored on SD card.
This feature Worked fine with Dezaemon 2, which can now handle 10 saves at once (5 saves from cartridge, and 5 other saves on FDD ), but I didn't tested for other games using FDD, so any feedback is welcome.
This is a feature available on Gamer's Cartridge only too. Thanks to this feature, floppy disk access is available without having to plug any floppy disk drive to Saturn 



______________
Features for Action Replay and Gamer's Cartridge users

Proper support of FDD in Save Data Manager : Save Data Manager now supports both two partitions of Saturn floppy discs for all common operations such as copy, move, delete, import, dump, etc.
Special thanks to Dezaemon DB for big assistance in beta testing


Backup devices informations from Save Data Manager :
First device is internal backup memory : the easiest to handle
Second device is backup memory cartridge,
unconnected (zero partitions detected) in this picture
Third device is FDD : two partitions, wrong unit ID returned,
and always set at third position in devices information
array, even when cartridge is not available.
Basically, FDD is a real trouble-maker when trying to handle backup devices



Save Data Manager development cut scenes : trying to format FDD
(format for both two partitions is displayed in a single picture)
Don't worry about the horrible display of error
messages : it's (finally) improved in version 6.074


Soft Reset Patch
: Change the "A+B+C+Start key combo" soft reset from "exit to multiplayer screen" to system reset. This idea is not from me, but from neuroacid (rmenu developer).


More saves to import from Save Data Manager
. The most noticeable addition is saves from Urawaza Dataro cartridge, containing quality saves for Japanese games. Special thanks to Madroms for dumping the cartridge, and providing me its dump file 


Other
: Fixed many bugs, and added other bugs ... the usual routine 


(Not a software feature, but) future users of Gamer's Cartridge may appreciate the couple of new labels, designed by beebaraka-sensei (twitter) for artwork itself and Dezaemon DB (twitter) for the final editing of the labels. Many thanks to them for the very good work !


Dezaemon-themed labels ... could you find out the odd label ?

The design on theses labels is themed on Dezaemon 2, and as you can see, the Dezaemon character on the game cover grew in the right way 
I personally do appreciate the white themed one





Before being asked "where are the cheat codes ?", please let me reply :)
Cheat codes support is still under development. Menu in order to select game and its cheat codes is 90% done, but the bit of code in order to apply codes is still TBD. I didn't touched this feature for around half a year mostly because of lack of free time, motivation, and being busy in developing other features. I plan to finish this for "next-next release" however.
Update three months after writing the explanation above : cheat codes on Pseudo Saturn Kai are working on few games !! 
There are many things remaining until reaching an "OK to release" state, but at least the cheat codes core feature seems to work, which is quite a relief for me :)

By the way, there's a trick cheat codes selection menu in Pseudo Saturn Kai 6.074 : did you found it ? It won't do anything else than showing games list and cheats for each games, so it's not worth spending more than 10 minutes in looking for the appropriates key(s) combo and timing however.


Yes, this release have (at least) two Easter eggs available Coincidence with release timing during Easter period ? I think not


Apart from cheat codes, there are many other things scheduled for future releases : I initially planned to release everything at once, but had to make this intermediary release in order to fix the save data corruption bug on Gamer's Cartridge, so stay tuned


PS : Special thanks to Stac for beta testing  All the features above wouldn't exist without his help !!!

Read more Pseudo Saturn Kai 6.074 released !

Bit shift in Saturn minimalistic C program

Written by cafealpha 4 comments
While making a Saturn program running directly from ROM, constraint is usually to have program as small as possible. Why ? Because I would like to make Pseudo Saturn Kai continue supporting Action Replay, which have limited ROM size

So, in that situation, I use homemade, minimalistic stdlib, containing usually only memcpy and memset functions, and everything goes well.
But for some reason, current program was begging for __ashlsi3 and __ashrsi3 functions.
... What's these things ? __ashlsi3 is an assembly function doing left shifts of data, and as you probably guessed, __ashrsi3 does the same, but with right shifts

No problem, let's ask my friend google, and copy & paste theses functions without minding about their contents Theses functions are standard functions provided by C library, so sources can be found here and there.


An example of what __ashrsi3 function looks like

A day after that, here comes the time to do basic testing of this ROM code
Let's first start with simple things such as screen display ...


Text display ... not as expected ?!

Hrm, it's probably a problem in my printchar routine ?

printchar source code : this is the core thing
behind text display in my programs


But that's a very long time I didn't touched this routine, which works well on Pseudo Saturn Kai, and works even better in vdp1ex from Charles MacDonald sample programs, because all my printchar routines come from there
But just in case of, let's try to tune one " <<3 " into " *8 " in the code above, and see if that changes something. Theses two operations are equivalent, so this should give the same result, but ... Saturn screen becomes all black

Okay, there's definitely something weird regarding that printchar, but I just re-used it as-is from other project, so what's going wrong with my it ?!
[...]
And then (finally) a light-bulb above my head appears Maybe there's something wrong regarding the __ashlsi3 and __ashrsi3 routines ?
And, yes there was something wrong regarding theses routines ... I wrote a paragraph about them on the first half of this article, so it would be surprising the problem came from somewhere else

In more accurate words, routines are OK, which is normal since they are written by people smarter than me But the calling convention of __ashrsi3 was not as my gcc was expecting ?
Well, that's just a guess from the display results, because it seems to display the same pixel 8 times on each row of a given character, which may happen when ignoring shift parameter in __ashrsi3 function.

Anyway, rather than finding in details what's wrong, let's fix the problem First, with assembly by hand, in desperately trying to change input parameter handling ... I don't remember exactly what I wrote, but that was something like pushing a register to stack, moving parameter to it, finally restoring register, putting nop instructions everywhere, etc ... nothing difficult, but over my extent in assembly programming

The result is ... a mixed success :

Trying to modify __ashrsi3 routine by hand ... well, it seems that
some shift values are not correctly handled


Okay, so let's re-ask google about that __ashrsi3 routine ... and a different implementation arrives in search results. Let's try it


__ashrsi3

And the execution result :

Execution result with second version of __ashrsi3 function

Yeah, it works this time !!! And don't ask me why, because I didn't took time in understanding what's different in that second version of __ashrsi3 function
And, rather than understanding why it works ... let's close that assembly pandora box before some other mystic bugs pop from it

I will probably see about this in the future, but that was absolutely out of the scope of today's programming, and in software world, too much digression leads to freeze of projects, which I would like to avoid in order to go forward to next pending project 

As a example, I started to adapt yeti3d engine to Saturn in 2010 (7 years ago !), and this ended in ... developing a SD card based memory cartridge for Saturn !
The point above is is not a joke : menus used in my yeti3d adaptation are the origin of menus used in Pseudo Saturn Kai, which shows the continuity (co-consanguinity ? ) in my projects. And after getting yeti3d working a bit, I really would like to load levels from something else than CD-ROM, which was from PC (via adequate link cable) on a first time, and which will (should ?) then evolve to SD card.
That would be cool to make a Saturn game not requiring to burn CD-ROM somedays, but before that I need to finish neighboring side quests


Evolution of my Saturn projects

To conclude this article, let's say it was terribly fun to see some bits of the internals behind C language
By the past, I remember I did something similar with my yeti3d adaptation, but remained at "C language level" : optimization done at that time was (IIRC, ) to avoid 4 bits shifts, because theses are not available in a single SH-2 CPU instruction. Avoiding 4 bits shifts was simply done by merging two fixed point operation in a single one (or something like that : I did this 7 years ago !), and this actually gave some improvements in 3D scene rendering Theses were the good times ... I sometimes think "I'm Getting Too Old For This Shit", but that's only to motivate to finish my old projects

But before that, Pseudo Saturn Kai, and then Kicad and Quartus are waiting for me


BTW, in the case you wondered about what was today's programming session, you probably guessed it was about exception handler addition to Pseudo Saturn Kai. This not a new feature, since it was available in Pseudo Saturn 0.83x ... in fact, I grabbed some sources from Pseudo Saturn 0.83x in order to implement this exception handler (thank you CyberWarriorX !) This exception handler will be available as a small add-don to cheat codes feature in Pseudo Saturn Kai next major release.

Read more Bit shift in Saturn minimalistic C program

Rss feed of the tag