Saturn CD Block ROM dumped

Discussion in 'Sega Saturn Programming and Development' started by jhl, Jun 30, 2014.

  1. lovewiibrew

    lovewiibrew Site Supporter 2012

    Joined:
    May 23, 2011
    Messages:
    148
    Likes Received:
    16
    My vote would definitely be for USB host so that we can use hard drives. People can buy an externally powered HDD if need be.
     
  2. SGGG2

    SGGG2 Active Member

    Joined:
    Dec 30, 2010
    Messages:
    40
    Likes Received:
    0
    I'm a fan of stealth mods so if push came to shove my preference is for SD over hard drives, ideally it would support both. 32GB is a ton of games.
     
  3. Cyber Warrior X

    Cyber Warrior X Active Member

    Joined:
    Feb 21, 2013
    Messages:
    32
    Likes Received:
    15
    Congrats jhl on the dump! If you need any info or help trying to make sense of any of the code let me know. There's also some basic info on the Yabause wiki too.
     
  4. ASSEMbler

    ASSEMbler Administrator Staff Member

    Joined:
    Mar 13, 2004
    Messages:
    19,394
    Likes Received:
    995
    You should consider making this commercially instead of letting the chinese make all the money with this.
     
  5. APE

    APE Site Supporter 2015

    Joined:
    Dec 5, 2005
    Messages:
    6,416
    Likes Received:
    138
    This.
     
  6. TriMesh

    TriMesh Site Supporter 2013-2017

    Joined:
    Jul 3, 2008
    Messages:
    2,324
    Likes Received:
    750
    Especially since this is a better solution than the one the Chinese guys seem to be using. Since they were booting from the cart slot, they would have to use software hooks to intercept the CD drive commands - and might not have been able to implement CD-Audio at all.

    In theory, this method should be able to simulate everything perfectly, since it's sitting behind the (presumed immutable) interface that the Saturn uses to talk to the CD. Of course, it will take up the slot for the MPEG card, but you could always simulate that too, if you had the patience...
     
  7. ASSEMbler

    ASSEMbler Administrator Staff Member

    Joined:
    Mar 13, 2004
    Messages:
    19,394
    Likes Received:
    995
    A pcb with a microusb 5V 2.0 amp and SD slot. Adding sata would raise costs.

    It would be advisable to keep it affordable to Brazil, a sega stronghold.
     
  8. jhl

    jhl Spirited Member

    Joined:
    Jul 29, 2013
    Messages:
    103
    Likes Received:
    116
    Without an external power adapter there's not really anywhere to get those extra 2A from - you'd be overloading the Saturn PSU by 100% if you went internal.

    The other major downfall of USB host mode is software maintainability. In my experience, USB Mass Storage stacks have to take account of a huge variety of dodgy implementations on devices. Just look at the Linux UMS subsystem. I'd really rather my limited time be spent on accurate emulation and useful features than in just getting a finicky drive to talk to the board.

    If the design includes a PC-driven mode (which I currently intend to do), then you can tuck a Linux SBC and externally powered drive under your Saturn -- or even rip out the CD drive and put in HD + SBC + PSU internally (which would be my preferred method). I'm aiming to place the USB connector so that the cable can be routed internally.
     
    Last edited: Jul 1, 2014
  9. TriMesh

    TriMesh Site Supporter 2013-2017

    Joined:
    Jul 3, 2008
    Messages:
    2,324
    Likes Received:
    750
    Just out of curiosity, did you find anything in the SH-1 code that sheds any light on how the system disc works?
     
  10. Druidic teacher

    Druidic teacher Officer at Arms

    Joined:
    Jun 6, 2006
    Messages:
    3,643
    Likes Received:
    129
    x
     
    Last edited: Jun 22, 2017
  11. jhl

    jhl Spirited Member

    Joined:
    Jul 29, 2013
    Messages:
    103
    Likes Received:
    116
    Absolutely. Disc authentication lives in Task 7 in the multitasking system, which is shared with the ISO filesystem access code. It's a spaghetti monster.


    System discs are defined simply by finding SEGASYSTEM at the appropriate place in the disc header. The disc author is stored for later comparison, so a system disc that has SEGA TP will only work with SEGA TP discs, for example. The disc must be authenticated for the mechanism to enable the bypass. Everything else on the system disc is only there to show the message on the screen!
    Interestingly, there is also provision for a 'super system disc', which also bypasses the author check. A super system disc has to have exactly 30 tracks, and some weird subcode stuff in the TOC region. This was presumably to make sure nobody could burn them on a dev CDR (since you'd need to burn them in raw96 DAO mode, which was not well supported at the time). They need to be authenticated just like a regular disc.

    The code also confirms that both scrambled ring data (the logo) and the track wobble data from the CD mechanism are used for authentication. It's interesting that the crappy modchip data passes the check, the code looks relatively complex. Evidently it's not as secure as the designers thought it was.

    As an amusing aside, there's also a provision to load (encrypted) SH-1 code from an authenticated Saturn disc. Presumably this was for bugfixes via CDR during development. If my notes are correct, then at 0xF8 and 0xFC in the header are two dwords holding the FAD and the length in bytes of such a region, active if nonzero. I'd be interested to see if any such discs have been spotted in the wild, and what they were used for.
     
  12. jhl

    jhl Spirited Member

    Joined:
    Jul 29, 2013
    Messages:
    103
    Likes Received:
    116
    Also, there's no way (at least no designed way) to inject SH-1 code from the SH-2.

    CDB MPEG commands (90-AF) are forwarded to code loaded from the card, except for 93 (init MPEG), AE (get LSI), AF (set LSI).

    The only commands present in CDB105 but not documented on the Yabause wiki are:

    FF - get some debug statistics (on the DRAM sector pool, as I recall)
    55, 56 - calls into Task 4 (the selector handling task)
     
  13. TriMesh

    TriMesh Site Supporter 2013-2017

    Joined:
    Jul 3, 2008
    Messages:
    2,324
    Likes Received:
    750
    That was exactly the conclusion I came to when I disassembled it - the code on the disc didn't actually do anything and it had to be internal to the CD controller. Nice to know the real deal now :)
     
  14. Cyber Warrior X

    Cyber Warrior X Active Member

    Joined:
    Feb 21, 2013
    Messages:
    32
    Likes Received:
    15

    Very interesting! By the way, I noticed some time back you could also bypass the ring detection by removing the "SEGA SEGASATURN" string at the beginning of the disc and using a custom bootloader to load said custom disc. My theory always was that the ring check was only done based on that string. Which is why vcd's and audio cd's would work fine without the need of a ring check. Any thoughts?

    By the way, do you have any additional info on the provision to load SH-1 code? Like encryption format, etc.? I'm kind of tempted to mess around with it :) From what I've seen I never saw any games or discs meant for public consumption using those two offsets. It may have been used internally though. Kind of like the ability to run code from the cartridge, which I also think was never intended to be used outside of dev, system check carts, etc.

    Sounds about right. It was designed to be a closed system after all. Though I always wondered if there was possibly a hidden way by manipulating the selectors and buffer connections. But it was pretty much a crap shoot with so little info and the SH-1 code not being accessible. I remember noticing 55, 56, and FF sometime back but I wasn't sure if they were mirrored commands or what. IIRC 0xFF by itself normally returns 0xFF in the CR registers.

    By the way, what exactly do the the set/get LSI commands do? I could never find much info on them.
     
  15. jhl

    jhl Spirited Member

    Joined:
    Jul 29, 2013
    Messages:
    103
    Likes Received:
    116
    Correct. The disc must begin with a Mode1 sector starting with SEGA SEGASATURN. It also looks in the last session on a multisession disc (so '90s!)
    They're for talking directly to one or both of the MPEG ASICs selected on MVCS/MACS; they each have a little register space mapped in there.
     
  16. phazmatis

    phazmatis Member

    Joined:
    Dec 6, 2009
    Messages:
    20
    Likes Received:
    0
    Wow. That's a beautiful hack.
     
  17. Cyber Warrior X

    Cyber Warrior X Active Member

    Joined:
    Feb 21, 2013
    Messages:
    32
    Likes Received:
    15
    hehe. Yeah, I'm somewhat surprised they left multisession support in the CD block at all. The bios won't even allow multi-session games to boot.

    Ah ok. I figured get/set lsi had some function like that, but I wasn't sure what kind of registers or data was being accessed.
     
  18. Nemesis

    Nemesis Robust Member

    Joined:
    Mar 22, 2007
    Messages:
    248
    Likes Received:
    79

    I've got a rev 0.5 Japanese model, so I'm pretty sure I'd have a CDB104. As for the CDB106, no idea, but I've got a mix of model 1 and 2 systems from the US, Europe, and Japan, maybe one of them has it.
     
    Last edited: Jul 1, 2014
  19. Druidic teacher

    Druidic teacher Officer at Arms

    Joined:
    Jun 6, 2006
    Messages:
    3,643
    Likes Received:
    129
    x
     
    Last edited: Jun 22, 2017
  20. karsten

    karsten Member of The Cult Of Kefka

    Joined:
    Mar 14, 2004
    Messages:
    4,015
    Likes Received:
    149
    Aren't these the last info we needed before Being able to selfboot a disc?

    I'm not a tech guy bit it sounded like that.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page