|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
Author | Message |
---|---|
|
Mark III/SMS Phantasy Star from GBA and Saturn Phantasy Star Collection
Posted: Sat Feb 22, 2020 9:13 pm
|
Both the Japanese Saturn release of Phantasy Star Collection and the North American GBA release of Phantasy Star Collection include the original Mark III/SMS Phantasy Star game, and appear to run it in SMS emulators of some sort.
I recently ripped the Saturn disk and dumped the GBA ROM, and noticed that the versions of Phantasy Star they contain don't seem to match the US SMS or Japanese Mark III cartridges I have. Does anyone know more about these versions, and where they fit in the version history of SMS/Mark III Phantasy Star? I've read elsewhere that the Saturn version may match the version packaged in a Mega Drive Fukkokuban re-release of Phantasy Star, which is actually an SMS game packaged in a Mega Drive cartridge with some sort of boot ROM, but so far I've been unable to dump that cartridge myself to compare, although it works just fine in a Mega Drive. I couldn't get the Saturn version to actually play in an emulator, though it's somewhat similar contents-wise to the working Mark III cartridge I have. The GBA version seems to work just fine, though! Although they both have "TMR SEGA" BIOS-appeasement text, they don't have valid SMS CRCs, so they likely wouldn't run in export SMS unmodified. Looking at the ROM, it seems the English translation for the GBA version was updated compared to the SMS cartridge I have. In any case, here's some fingerprinting information from the version in the Saturn Phantasy Star Collection, which I'm arbitrarily labelling "Phantasy Star (J) [Collection].sms" for lack of a better name: CD Volume label: PHANTASY_STAR_COLLECTION Filename on the CD: PS1/PS.COM Size: 524288 bytes (header falsely claims 256K) SMS header info: 9500 (Rev.01) (256 KB) sha256:85765eb6d6de1c7b48285bc2ca3b4ea2de9325f854de5fbfde26035ba5ea92fe Phantasy Star (J) [Collection].sms sha1:2f827f653c272c7a1f98dc18ac0065c6c10a3780 Phantasy Star (J) [Collection].sms md5:306b0d5f9c793dc848e05c0f30956bb1 Phantasy Star (J) [Collection].sms mekacrc:157EA8B191E86C2F Phantasy Star (J) [Collection].sms crc32:913ef4a2 Phantasy Star (J) [Collection].sms Here's the equivalent information for the English version from the GBA version, which I'm arbitrarily labelling "Phantasy Star (UE) [Collection].sms": Offset in GBA ROM: 7807700 bytes Size: 524288 bytes (header falsely claims 256K) SMS header info: 9500 (Rev.03) (256 KB) sha256:8f82747aa9939ff2426841f693d571a4d675b0d45f6a8b30b08cd72e7e4ee502 Phantasy Star (UE) [Collection].sms sha1:551c01093b5e3b5e22797bd9b36479812c0abac2 Phantasy Star (UE) [Collection].sms md5:dbbb33f411ea87991e051327335d4a38 Phantasy Star (UE) [Collection].sms mekacrc:0B932A08DC5737C6 Phantasy Star (UE) [Collection].sms crc32:0fc1c8c3 Phantasy Star (UE) [Collection].sms The GBA cartridge dump I'm extracting it from is this one: sha256:6747a17af7ccb082bab1f2a8ed7d88952ab93879d93173b12331b1e5e8ec1c4e Phantasy Star Collection (USA).gba sha1:9f2dc591c9b1526f9f965b1c375fb4ea7101fd16 Phantasy Star Collection (USA).gba md5:af7e218eb4a7f28f1887b3504647854e Phantasy Star Collection (USA).gba crc32:e5a7fe17 Phantasy Star Collection (USA).gba |
|
|
Posted: Sat Feb 22, 2020 11:18 pm |
We’ve analysed similar modern emulated efforts. Two things tend to be patched: flashing and use of the Red Cross symbol. | |
|
Posted: Sun Feb 23, 2020 6:59 am |
That makes sense. Since I don't have an easy way to compare the Japanese Saturn release I'm not sure how it differs, but the English GBA release appears to have minor differences in the text, in both content and formatting. I've quoted a few examples below. Do these perhaps correspond to a different known version of the English translation of Phantasy Star, rather than the V1.2 in my SMS cartridge? Phantasy Star (UE) [Collection].sms
Phantasy Star (UE) (V1.2) [!].sms
|
|
|
Posted: Sun Feb 23, 2020 9:14 am |
Well yes, West <-> North and him <-> her... it seems worth tracking these differences. | |
|
Posted: Sun Feb 23, 2020 8:47 pm |
The version dumped from the Megadrive ROM is CRC 07301f83, it was dumped I think by Casiopea who sent it to me around 1999 probably.
In the meka database it is listed as "Megadrive and Saturn", I honestly don't remember how I ended up labelling it as such, it might have been a mistake from this era. But it would also be surprising if you were the first person to stumble on that. Could you post or send me your 913ef4a2 version for inspection? I have the Saturn disc but CD drive is stashed somewhere. |
|
|
Posted: Mon Feb 24, 2020 9:38 am |
The version in Saturn RAM is modified compared to the version on the CD. In fact there are two variations, "Katakana" and "Hiragana". I used a Saturn emulator and dumped the RAM using a save state for each variation and they each at least load in an SMS emulator and are at least somewhat playable, though the Hiragana version has no visible text in some parts. The Katakana version appears to be fine. I haven't gotten either version to produce music.
I also loaded the English version from the GBA collection in an SMS emulator and its text appears corrupted. I haven't yet tried to dump RAM for this one. |
|
|
Posted: Mon Feb 24, 2020 12:46 pm |
I guess for these sorts of thing there will be:
1. Hooks into the emulated game to make the emulation more than just a pure emulator drawing a bitmap to the screen (similar for the sound emulation) - kind of like HLE but with extensions 2. Runtime patching of the ROM to achieve certain things 3. Static patching of the ROM to achieve other things It’s far easier to add in an “emulator escape” feature than to add features entirely in the emulated system. For example, to change katakana to hiragana you may not have the video memory for the font, but you can just hook the drawing of text, inspect the string, look up the transliteration, draw that to the screen using some “extended” functionality outside the emulated system, then return to the emulated code. To replace the sound you might “hook” the entire sound engine to trigger some samples instead based on the track IDs being triggered. Another way of looking at it might be that they are emulating a kind of custom enhanced Master System with weird game specific extensions. The only way to emulate that is to emulate those extensions - which may be explicit (calls to undefined functions, writes to custom ports) or implicit (when execution gets to certain addresses, so something custom and then skip over the actual instructions). |
|
|
Posted: Tue Feb 25, 2020 4:34 am |
Yeah, that makes a lot of sense and likely explains the strangely modified text in the GBA release — I'm guessing it's using a native ARM code text engine that supports a compression scheme of some sort.
For the record, here are the various fingerprints/checksums for the Katakana and Hiragana modes of the Saturn release: Phantasy Star (J) Katakana [Collection].sms Size: 512K sha256:3bf68f8f265bacbeb44b57586bd5db1334501d478380fabc9898d5265ea2d300 Phantasy Star (J) Katakana [Collection].sms sha1:79e5a35a27173202900ddddbc240826213ae3ed9 Phantasy Star (J) Katakana [Collection].sms md5:796d78c318798cde5c788894ab290f4c Phantasy Star (J) Katakana [Collection].sms crc32:538480a3 Phantasy Star (J) Katakana [Collection].sms Phantasy Star (J) Hiragana [Collection].sms Size: 512K sha256:dd17a5eb523f2f6ba165b6872f6ba37751833f0253cbe338fb15cd64af8128d6 Phantasy Star (J) Hiragana [Collection].sms sha1:efe2b1b88d0970ecdbd557a66982e2473fd7f5b2 Phantasy Star (J) Hiragana [Collection].sms md5:18370556376cd3f9af6783c5df7ad511 Phantasy Star (J) Hiragana [Collection].sms crc32:58eeadd4 Phantasy Star (J) Hiragana [Collection].sms |
|
|
Posted: Tue Feb 25, 2020 5:14 am |
Here's a side-by-side-by-side comparison of the first place where the text rendering differences were apparent.
Left part of the image is dumped from an SMS cartridge with Phantasy Star (UE) (V1.2) [!] Middle part is the version extracted from the GBA cartridge running in an SMS emulator. Right part is the same version running as part of the collection in a GBA emulator. |
|
|
Posted: Tue Feb 25, 2020 5:37 pm |
are those VDP constraints violations? | |
|
Posted: Tue Feb 25, 2020 6:13 pm |
I've invited a friend who was part of the production team on the GBA version to offer insight into what they did. | |
|
Posted: Wed Feb 26, 2020 4:15 am |
it appears to me that it is using non-text character numbers to encode common two-character sequences | |
|
Posted: Thu Feb 27, 2020 3:27 pm |
That's me! On the text changes, I know there were certain typos or translation issues that were made by hacking the Master System ROM before the game was emulated. The emulation was "offline emulation," a name for the developers' technique of doing an offline opcode to opcode translation of the original code. This let us "emulate" the game on a system that was not powerful enough to emulate a SMS. I'm not sure why the text seems to render differently, from what I understand/remember there would have been no custom text handling written at all. I do know that to squeeze the game onto the gba screen we had to lose some lines of vertical resolution every frame. I can try to reach out to the original engineers if people want but they're mostly focused on TRS-80 stuff today. |
|
|
Posted: Thu Feb 27, 2020 5:56 pm |
If it was static recompilation then why is the ROM in there? I guess maybe because when you hit some ROM address read you need to go find that data, whereas the code parts are all over the place in ARM or whatever. Thus the ROM doesn’t actually need to be functional, and the translated code (assembly or even C) can be modified to match data changes, leaving the code in ROM kind of broken.
Thus you’d avoid needing to run a CPU emulator, but still need to run a VDP emulator - but that can translate to hardware on GBA quite well. Overall, though, an amazing achievement to get it running so well on that CPU while still mostly emulated. The exact content changes are interesting to understand. The diff above covers two: - The Governor’s letter to Noah uses “her”, elsewhere she’s a he. (Originally the character is supposed to be ambiguously gendered.) - The underground passage to the Gothic Forest is somewhere to the west/north of Parolit - I guess it is more “up” than “left”? This is an original mistranslation, the original text is more like “I hear you can get to the Gothic Forest -- which is West of Parolit -- through an underground passageway.“ |
|
|
Posted: Sun Jan 08, 2023 10:41 pm |
A bit of non-surprising follow-up:
After many years I finally realized I could easily dump the ROM from my Phantasy Star Fukkokuban using a bit of wire (to short two pins together) and tape (to mask a shorted pin from the dumper's cartridge bus) and a Genesis/Mega Drive cartridge dumper (specifically, I used the Tengu Lythium MD dumper with older dumper software that still allowed custom Squirrel scripting.) Since this dumper hardware doesn't support MD-SMS mode, I had to (a) temporarily move around the A15 address line, (b) double all addresses and throw out every other byte [8bit vs 16bit bus width], and (c) write to the corresponding locations for the cartridge's SMS-style mapper. I also wrote some "unlock" bytes first, but tbh I don't know whether they actually do anything. Note that these steps worked for this specific cartridge, but in general connecting SMS-MD cartridges to a dumper can short pins and destroy it. Please be careful! Unsurprisingly I got exactly the same ROM image as others have extracted previously. For posterity, here is the fingerprint info: 512K 'Phantasy Star Fukkokuban (Japan).sms' Checking for export header with matching CRC... YES sha256:55ba15a1ea5c7db883a7a4c850bea2b1024185605964916ddd04a645d7ddd2b6 Phantasy Star Fukkokuban (Japan).sms sha1:b3ae447dc739256616b44cbd77cb903c9f19e980 Phantasy Star Fukkokuban (Japan).sms md5:14c59604768b33175362cc592cb75ead Phantasy Star Fukkokuban (Japan).sms mekacrc:A8CCBAD5B519DA55 Phantasy Star Fukkokuban (Japan).sms crc32:07301f83 Phantasy Star Fukkokuban (Japan).sms I was also curious how this version compares to the Sega Saturn release in the Phantasy Star Collection, and to the Japanese Mark III release. Unsurprisingly the differences are not many. It is closest by far is the on-disc file from the Sega Saturn release in the Phantasy Star Collection — in fact the only differing ROM region is the 256 / 0x100 bytes starting at ROM offset 0x30000. In Phantasy Star (J) [Collection].sms (Saturn on-disc version) those are all 0xc9, whereas in Phantasy Star Fukkokuban (Japan).sms (MD-SMS version) those are the same as in the Phantasy Star (J) [!].sms (Mark III version.) Given that the TMR SEGA header's CRC matches in Phantasy Star Fukkokuban (Japan).sms but not in Phantasy Star (J) [Collection].sms, this implies the Saturn Collection version was made by modifying the Fukkokuban version, which was in turn a later evolution of the original Mark III release. Versions I was comparing it with: 512K 'Phantasy Star (J) [!].sms' Checking for export header with matching CRC... YES sha256:1d8554202f313d97c4f48c6acf9b312853a1aca3c04fab9077743d7943a45ebb Phantasy Star (J) [!].sms sha1:c9a40ddd217c58dddcd6b5c0fe66c3a50d3e68e4 Phantasy Star (J) [!].sms md5:dfebc48dfe8165202b7f002d8bac477b Phantasy Star (J) [!].sms mekacrc:2E083BD3646B9C51 Phantasy Star (J) [!].sms crc32:6605d36a Phantasy Star (J) [!].sms 512K 'Phantasy Star (J) [Collection].sms' Checking for export header with matching CRC... NO sha256:85765eb6d6de1c7b48285bc2ca3b4ea2de9325f854de5fbfde26035ba5ea92fe Phantasy Star (J) [Collection].sms sha1:2f827f653c272c7a1f98dc18ac0065c6c10a3780 Phantasy Star (J) [Collection].sms md5:306b0d5f9c793dc848e05c0f30956bb1 Phantasy Star (J) [Collection].sms mekacrc:157EA8B191E86C2F Phantasy Star (J) [Collection].sms crc32:913ef4a2 Phantasy Star (J) [Collection].sms |
|
|
Posted: Sat Apr 15, 2023 4:21 pm |
Here's an article from 2003 discussing Digital Eclipse's static recompilation technique: https://queue.acm.org/detail.cfm?id=945155 | |
|
Posted: Tue Apr 18, 2023 1:59 pm |
An interesting read, thank you! :) |
|