Written by cafealpha no comments
Synthesis ... this is the kind of blog article posted at the end of December in normal blogs, but since this is not a normal blog, and that I can't respect any schedule for it, let's prepare this article at the beginning of January
Last year started well with an order of Gamer's Cartridge from IGK, who is administrator of Dezaemon DB homepage. More than administrating Dezaemon DB, he is also a dezaemoner who (among other titles) developed Biometal Nemesis, which deserves its youtube link in this blog :)
Biometal Nemesis - Click above if you like shmups
I really like the style of this Dezaemon game ! Thank you very much IGK for creating such gem
Thanks to IGK, it was possible to finish support of Saturn Floppy Disk Drive on Save Data Manager : initialization of this device is slightly different than with internal backup memory and backup memory cartridge, and consequently was causing troubles on various configurations such as no backup memory cartridge inserted, but floppy disk connected, etc. Fixing all possible patterns wouldn't had been possible without kind help and beta testing from IGK. Thank you
Save Data Manager (version around 2017/01/30)
Configuration when this screen was taken was no "backup memory cartridge inserted, and floppy disk connected", which was causing troubles because among other things, unavailable device in the middle of devices table wasn't supported.
Additionally, this was the occasion to add virtual floppy disk support on Gamer's Cartridge, making Saturn considering a floppy disk drive is available, even if not physically connected. Main purpose of this feature is to add 5 more save and load slots in Dezaemon 2, which, in addition of the 5 slots on backup memory cartridge, makes possible to manage up to 10 saves into a Dezaemon 2 session directly from a single SD card I don't remember exactly what was the trigger which started the addition of this feature, but I think that a suggestion from IGK like "it would be cool if floppy disk would be supported by Gamer's Cartridge too" and me "Ah yeah, that's a nice idea ... how many save slots do you want ?"
After that, IGK continued to surprise me by asking his friend beebaraka to draw a Dezaemon 2 themed label for Gamer's Cartridge ... As a result, I received images for two labels, which I personally consider as the masterpieces among Gamer's Cartridge label collection My preference goes to the white-themed label, but I suppose it's just a matter of personal taste.
Dezaemon 2 themed Gamer's Cartridges
Like shooting games ? Like DIY ? Theses cartridges are designed for you
In parallel of theses Dezaemon 2 adventures, generous contributors helped in dumping firmware of some exotic Saturn cartridges, and were successfully added to Pseudo Saturn Kai Save Data Manager. Most relevant dumps were for X-Terminator cartridge, and Urawaza Dataro cartridge : first one is a cartridge with extended support for cheat codes, especially with extra controller allowing in-game search of cheat codes. Later one provides special save data for several (around 34 IIRC) Japanese games. Special thanks to Madrom for providing dump of this cartridge !
All the points below contributed to prepare the "20170423" release of Pseudo Saturn Kai. Warm thanks to all contributors who could make it possible !
Second half of the year mostly concerned cheat codes addition to Pseudo Saturn Kai. It started in June (or May ... I don't remember correctly) from a Gamer's Cartridge user asking when cheat codes will be available in Pseudo Saturn Kai ... this reminded me I still had to finish that until next release
First working version of cheat codes
hander, with USB transfer support
It's not visible on this picture, but many polygons weren't
drawn because of performance issues.
Unlimited time cheat code working : it took me around
one month to fix missing polygons, because of unoptimized
implementation of cheat codes handler), but I did it
Cheat codes kept me busy for six solid months, basically in understanding to manage cheat codes in a similar way as is it done on Action Replay firmware, optimizing critical code, importing codes list, finishing cheat codes related interface, testing several games, etc. That's honestly a hard work, but this was also an occasion to add in-game USB transfer via USB dev cart. Thanks to this, the basis in order to fix or improve cheat codes is ready Proper PC software for cheat codes detection is still missing, but hopefully this will be done someday.
Akumajo Dracula-X illustration with Maria's inifinite jump cheat code.
This game was a nasty one regarding cheat code support, with very
tight CPU and RAM left for cheat codes handler. This was an occasion
to develop many cheat codes debug features
Summer was also the occasion for me to officially end manufacturing and support of USB dev cart : after 5 years involved in this adventure, I considered it was enough, because : 1. USB dev cart interests basically nobody 2. In the rare cases USB dev cart interests somebody, it is usually used for closed-source projects (But there are notable exceptions where USB dev cart contributed to Saturn open source projects. Big thanks to theses concerned peoples for making Saturn homebrew scene brighter )
I'm hesitating about the timing for next Pseudo Saturn Kai release : should I take some extra months in order to get proper cheat codes support for most popular games ? Or should I release it under few weeks with minimal cheat codes support (around an handful of games are currently tested and working), and hope to receive some feedback from users, so that I will eventually know which games need their cheat codes to be fixed ?
That's a very difficult choice : cheat codes is a niche feature (as everything else regarding Saturn !), so I shouldn't hope a lot of feedback. On the other hand, adding a cheat codes edition screen, and allowing cheat codes input on user side is (IMHO) a mistake too : maybe a motivated user would fix and/or add codes for some games, but rarely theses codes will be publicly available for everybody else, and in the other cases, user will simply consider Pseudo Saturn Kai cheat codes as a broken feature. Let's see ... I honestly don't have any precise idea when next release should be done. Any suggestion regarding this is welcome in the comments
Generally speaking, I'm tired about Pseudo Saturn Kai maintenance : I started it around two years ago (yes, largely over than nine thousands hours !!!), edit: that was around three years ago (I though we were at the beginning of year 2017 ), am finally seeing the end of my TODO list to realize that ... majority of users shifted to hardware ODE, or simply left the scene without any last final word ...
Well, whatever it may be, I continue development of Pseudo Saturn Kai because I went too far to stop so near of the end (that's quite a pragmatic argument, sorry), but also (and that's the most important), because that's a nice hobby, which is important in order to keep a balance between private and work
Also, my first steps in Pseudo Saturn Kai maintenance were made during my hospitalization for cancer, and keeping such hobby during theses hard times was worth gold. I don't know (and don't want to know) how things would had turned without my Saturn hobbies.
BTW, things concerning my health are getting well : I'm still undergoing periodical screening, which all were OK last year Last year was the celebration of 3 years all right after surgery, which is not bad for a cancer with 50-60% 5 years survival rate
Pokemon Go still not allowed in hospital. Fortunately, usage Saturn dev laptop isn't forbidden
To finish this article on a rant note (sorry if you went here for some final positive note ), I would like to say "thank you for nothing" to Rhea/Phoebe development team rmenu author. (← updated on 2018/06/20)
Why ? Reason is that I would like to add a rmenu equivalent to Pseudo Saturn Kai, but don't have any technical information to implement it, and it's not like I didn't asked about theses informations, but simply didn't received any relevant reply from concerned developer(s).
For a semi-commercial product, I can understand to keep schematics, source codes and other development resources private. But I don't request disclosure of theses resources, and just want some minimal information for interoperability, which isn't publicly available, and that's a pity.
Why is that a pity ? Because some cheat codes will certainly not work by having rmenu running between Pseudo Saturn Kai and Saturn game. I know there's the solution to use rmenu's full boot, which does a system reset of nearly everything (except Rhea/Phoebe, obviously) after selecting a game, so that cheat codes can be enabled after that ... but I really don't know anybody motivated to do this messy setup : everybody is using the rmenu's quick boot solution, right ?
Pseudo Saturn Kai's rmenu, dated 20151214. Latest version have some major improvements, such as scrolling title of select game, etc Because of lack of Rhea/Phoebe API, this feature is disabled.
I'm personally (and honestly) not concerned about this problem : my modded Saturn + USB dev cart are enough for my development needs, and I don't want to pay for a device costing an arm and a leg (plus a kidney when buying from ebay ...) and then having to do the reverse-engineering job for it after that ! So unless I got external help, clean support for Rhea/Phoebe will be done ... without me
From what I could found from static analysis of rmenu itself, version is checked by seeking to the last available data sector of the CD track, and game is selected by seeking to sectors just before that last available one.
After that's it's difficult to guess what data should be expected from Rhea/Phoebe without testing on real hardware. And reverse-engineering is usually a sluggish and hard work (I estimate the remaining as around a two weeks course ... and hope this to be a pessimistic estimation), and really would like to spend this time to other projects funnier.
2018/06/20 update : there will be proper support of Rhea/Phoebe image selection in Pseudo Saturn Kai, and consequently an user-friendly way of enabling cheat codes when using theses ODE
Very big thanks to Deunan Knute for the great job, providing the technical informations and everything else
And also I would like to thank privateye for contacting Deunan, his patience and great help in beta testing
Written by cafealpha 4 comments
Among the boring tasks remaining in Pseudo Saturn Kai development, there was "IP header CRCs merge to cheat codes list" task remaining ... ... There was, because I finally finished to merge the CRCs I could gather here ! Well, I think there are still 20-30% of the games in cheat codes list still not associated with any CRC, but anyway that's a fair amount of work done so far
Last CRC merged, at the end of cheat codes list Left text file : list of IP headers and their CRCs for each games I have here Right text file : Pseudo Saturn Kai cheat codes list
What is that CRC thing ? That's a value I use in order to identify each Saturn games. Thanks to such CRC value, it's possible to easily associate each cheat codes to a given game, and consequently automatically select game in cheat codes list according to CD-ROM inserted in Saturn CD lid. You don't like to manually select a game from cheat codes "select game" menu ? Me too So that I added this "automagically select game" thing in Pseudo Saturn Kai cheat code feature
By the way, it's probably a bit late for a surprise effect, but I'm glad to to announce that cheat codes feature will be available in Pseudo Saturn Kai next release
Basically, cheat codes handler now works ... for a majority of games tested so far. And user interface regarding cheat codes stuff is more or less okay ... but still needs to be perfected here and there.
So as you guessed, there are still details to complete until considering Pseudo Saturn Kai cheat codes feature ready for public release, and unfortunately polishing details usually (always) require time in software development, so let's hope next release will be available in a near future, which is "this year" in my own time scale regarding Saturn projects
Nights into dream cheat codes working ! That's the first game I used in order to test assembly version
of cheat codes handler
Having fun with cheat codes and USB connectivity on Radiant Silvergun
In-game memory contents are mine ! Ph34r my l33t h4Cklng sKI1lZ
So, the next development jobs are to support multiple CRCs per game : cheat codes list have several CRCs defined for some games (this is typically used for games using several CD-ROMs), but Pseudo Saturn Kai currently supports one CRC per game. Modifying the cheats list → data conversion utility in order to support multiple CRCs will be also an occasion to add some extra verification stuff regarding CRC, such as verifying that two different games don't collide on the same CRC, which is something like around 2500 different CDs versus 4 billions possible CRCs ... hence should be OK, but who know what may happen when developing software
After that, it will be probably be the time to do some testing on as many games as possible, in order to verify that cheat code and game are correctly associated, and to verify that cheat codes are correctly working, etc. Such task will require a significant manpower, hence to find a lot of beta testers. So if you're ready to give a hand, please stay tuned
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
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.
Last June, I initially wanted to release Saturn Gamer's Cartridge with custom label, but some unexpected problems regarding label quality (not resistant to water) delayed its release, consequently, Gamer's Cartridges manufactured until now had only shell, but no label.
"Stronger" label retained for use by Gamer's Cartridge is designed for car tuning purpose, so waterproof, and even alcohol proof ! I suppose this will satisfy the requirements of typical Gamer's Cartridge user (※) Just a (common sense) note : while labels are waterproof, cartridges themselves aren't So no, you still can't play Saturn while taking a bath
Cartridges with their labels. Bottom-right one (without LEDs) is USB dev cart.
Custom labels were the last main milestone regarding Gamer's Cartridge design : I won't design custom boxes for my cartridges. Why ? Because I want Gamer's Cartridge users to ... use their cartridges, not collect (shelf) them
You are Saturn Gamer ? Want to share your Saturn saves with your emulator or friends ? Want to enjoy Dezaemon 2 game but don't want to purchase a modchip + memory cartridge ? Then Saturn Gamer's Cartridge is for you
Special thanks to my friend Darius who selected paper, printed labels sheet, and cut each labels Darius provided pictures he took when cutting labels, so please enjoy the labels making-of
Label sheet scanned just after print-out. Red/blue lines are used as help when cutting labels.
Tools used : ruler and cutter. And also Darius' God Hand and eyes (not pictured)
In order to optimize time , labels are first cut row per row.
Written by cafealpha 4 comments
Good and bad news for people interested in my cartridge . The good news is that cartridge (Saturn Gamer's cartridge) and its firmware (Pseudo Saturn Kai) are more or less ready for release After release, project sources (PCB design files, and Pseudo Saturn Kai source code) will be publicly available, and few carts (not a lot) will be available for sale.
Among theses things I would like to improve, there is a custom label for cartridge case : I'm currently using second hand Action Replay cases for my project, and really don't like Action Replay label. In fact, I removed theses ugly labels ... it was hard to do (I don't know why they're using glue so strong !), but I really couldn't stand theses out-fashioned labels
Rather than designing label by myself, it's probably better to ask everybody about their favorite design for Gamer's cartridge label ! In fact, as labels will be printed by batch of 12 per page, it's OK to print different labels at once, then, let future user choosing his favorite label when ordering cartridge :)
Rules : 1. Width : 946 pixels, Height : 592 pixels. Adding some margin around your label is encouraged. Of course, larger images are accepted, but please respect image ratio, and please keep in mind that it will be resized to 946x592 when adding text or small details. 2. Image format supported on my PC : PNG or JPG. (Please ask if you prefer other format.) 3. Display following cartridge description text in English : Saturn Gamer's cartridge http://ppcenter.free.fr/satcart/#gamers ✔ Plays CD-R game backups. (※) ✔ Memory Cartridge. (※) × Cartridge RAM. × Play games from SD card. (※) Some games may be incompatible. 4. Copyrighted images usage forbidden. 5. Deadline : a couple of weeks (= middle of May 2016). 6. You allow me to re-use your label in this and future projects.
Tips : - If possible, please use plain color (black, white, or anything else) for label outline : as labels will be hand-cutted, I plan to add some margin around label itself, in order to avoid defect due to bad cut. (2017/03/12: my friend Darius does good job regarding label cutting, so the outline is not required ) - It's OK to add some non-English text, but in this case, you need to display cartridge description text in English, as described in rule 3. - (Added 2017/03/12) Please use relatively large font for text on the label so that it can be readable after printing. At 946x592 dimensions, recommended text height is over 25 pixels. This obviously depends on font used, contrast with neighboring background, etc. - (Added 2017/03/12) It's OK to remove the "× Cartridge RAM." and "× Play games from SD card." messages if theses doesn't fits in the label.
Reward : - Your name in Pseudo Saturn Kai firmware credits
Notes : - I may reject dull/offendant/whatever label(s). - Cartridge case will be available in both black or white colors, and black will be the most available color. - Custom label for USB dev cart is welcome too.
Want to make your own label ? Great :) And want some stuff to start from ? No problem, you can find some cartridge pictures below :
Cow logo, used in cartridge PCB : - vache.gif : initial image from which everything started. - vache0.bmp : first version of vache logo (silkscreen only, bottom of the PCB). - logo_vache.png : latest version of vache logo (silkscreen, solder mask, top right of the PCB). - vache_06_2_2+cornes2_-_finale.png : pixel art image used to make logo_vache.png.