The reason behind first party games crashing on HKT-0120 (and the fix)

Discussion in 'Sega Dreamcast Development and Research' started by mathieulh, Aug 11, 2017.

  1. mathieulh

    mathieulh Humble homebrewer

    Jan 26, 2006
    Likes Received:
    You may be the lucky owner of a Sega Dreamcast Development kit, if so you may have stumbled upon some first party titles (Sonic Adventure, Shenmue... to name a few) which crash on your development kit but run perfectly fine on its retail counterpart.

    The reason behind this is simple, unlike the retail bios, the devkit bios does not look at the dc_flash area for its region code and video output settings (in fact it completely ignores these values) but instead reads registers tied to switches located at the front of the unit, the code that parses these values is at 0x120 to 0x16C in the HKT-0120 bios.

    As such dc_flash in the HKT-0120 is filled with 0xFF, the issue is that first party titles will detect which video mode to set (50hz, 60hz, selection screen...) depending on the region and video mode set in the dc_flash, since 0xFF is an unknown value, the game will crash, because Sega tends to reuse the same code base for a lot of its routines, this check appears in many first party games, these games look on the flash for the console region strings to know what video mode they must enforce themselves to, for instance when they read from the dc_flash 211Dreamcast they are going to be set to 50hz (and usually display some choice between 50 and 60hz because the DC region video setting is on PAL50) on the other end, if it reads 010Dreamcast then it is going to go straight to 60hz because the video output is set to NTSC60

    The easy solution (which is most likely what Sega's first party developers have done) would be simply to write the region values (originally in the retail dc_flash) to the HKT-0120 dc_flash, these values are ignored by the HKT-0120 bios and therefore will not impair your devkit's functionality in any way, a way to do this would be to run an application such as Region Changer by DC-SWAT (or write your own), assuming the dc_flash is writable on HKT-0120 (which it likely is) as modifying it on retail requires a slight hardware modification, doing this will make all those pesky first party titles run on your development unit and finally allow you to ditch your retail consoles for good!

    BEWARE: the dc_flash address 0x1A000 need to be set to 0xFF (the first 0 of the 00XYZDreamcast ASCII string, XYZ being the region value digits) otherwise the bios wont run (it will brick if you set it to 0x30 which is the value in the retail dc_flash), this is incidently the only value checked by the HKT-0120 bios, if you are writing your own tool, you need to make sure this value remains set as 0xFF and that you don't just write a retail dc_flash backup in there.

    I wrote about this in the past but it was sitting in the middle of some obscure thread and I thought this deserved its own thread.

Share This Page