Saturday, September 21, 2013

22.0.2 available, damn it (plus: burning Dreamcast discs on the Mac? yes, OS 9 can)

I am stuck on the last seven failing test cases for PPCBC, so I'm biting the bullet and issuing one more interim release of 22 with a couple bug fixes and security patched up to parity with 24 (a couple unlikely situations are excepted, because they would be almost impossible to exploit the way we are constructed); downloads and release notes in the usual places.

The failing PPCBC test cases seem to revolve around issues with the JavaScript debugger and telescoping JITted code within JITted code through the standard OS X ABI (jumping code fragment to code fragment within Ion's internal ABI works fine). Unfortunately, these must be solved; the debugger will crash if they aren't, which is obviously unacceptable. And, of course, there's still that failing asm.js test with the endian issue, but it doesn't cause a crash and methodjit never passed it either, so I'm not counting it right now. I don't know how long it will take to solve.

In the and-now-for-something-completely-different-dept., I am a big fan of the Sega Dreamcast, their last console and in fact the last console I ever bought new. (Subsequent to this, I was given a slimline PlayStation 2 by a friend, and the only usage of that console is in fact whenever said friend is over to visit. Perhaps said friend would like it back.) The Dreamcast uses a perverse format for booting discs that requires a multi-session XA CD-ROM with an audio track and then a specially written data track using an embedded bootloader at an offset. To make this easy, most ready-to-go Dreamcast images (we don't condone piracy here; I'm talking demos and utilities) are in DiscJuggler CDI format, but this particular program has never existed for Macs (Liquid CD will attempt to burn them, but they don't work) and the existing Mac CDI extractors are of questionable functionality. Making Dreamcast CD-ROMs on a Mac has been an exercise in frustration since the beginning for virtually everyone who's tried it and now most Mac Dreamcast enthusiasts just Boot Camp into Windows and do it there. That's not an option for Power Macs, of course. I've personally tried for years and never been successful.

To this day, no disc I have ever burned from scratch on my G5 has booted my Dreamcast. That is technically still the case, but I am at last able to make bootable discs with the help of, incredibly, good old Mac OS 9. I discovered the trick when I stumbled upon a Mac-native (for OS 9) set of sessions for the infamous Utopia boot disc, which besides its more nefarious purposes serves to allow you to play legal games from Japan in, say, a US Dreamcast. It was very specific that Toast 4.2 had to be used -- my MDD normally uses Toast 5 in OS 9, but I still had 4.2 on CD from when I used it with the SCSI burner on my Power Mac 7300. I dug out 4.2 and installed it. Unsurprisingly, given its age, it refused to use the DVD burner in the MDD, but it would use the combo drive I'd added to the second optical bay. I put on the provided audio track for the first disc session, put on the provided ISO for the second session, and put it in the Dreamcast. It worked!

So I tried to replicate this with Toast 5 on Mac OS 9. Toast 5 couldn't make a bootable disc with the same files.

I then tried to replicate this with Toast 6 Titanium on the G5 and the same files. Toast 6 Titanium couldn't do it either. One page suggested burning the track as an Enhanced Audio CD instead of a regular Audio CD. This made some sense since these are technically MIL-CD format discs, but that didn't make a difference (and that's not what Toast 4.2 appears to be doing anyway).

I even tried to replicate this with cdrecord burning a blank audio track for the first session and using the same ISO. cdrecord couldn't do it either.

In fact, to get any Dreamcast disk bootable requires me to go into Toast 4.2 on the OS 9 MDD and use it specifically to burn the first audio track (at 1x) as a session. Once that's done, I can put it in the G5, regenerate the ISO for the data track at that offset (if you're using mkisofs from MacPorts, it's -C 0,11702 for the standard four-second audio silence track), add the IP.BIN loader to replace the first 32768 bytes of the ISO and then cdrecord that modified ISO to disc. And then it all works.

The key appears to be something weird or possibly "wrong" that Toast 4.2 does when making that critical first session. It's not something about OS 9, because Toast 5 doesn't act the same, even with exactly the same settings. It's not something about using a DVD burner or cdrecord or even mkisofs, because the G5 burns the second session just fine. Whatever it's doing, I can now boot Dreamcast Linux. I'm going to look at some of those CDIs again next, though a lot of them cram extra capacity onto the disc and I don't know of a PowerPC tool that supports overburning. I might see if I can get these to work with the DreamShell SD card reader I just got. But, after literally half a spool of CD-ROM coasters in my trash can, I am finally able to make Dreamcast discs in some form at least and start hacking into one of my favourite game consoles with this surprising new use for Mac OS 9. Whatever it's doing behind the scenes, it's making me very happy. :)

8 comments:

  1. Actually, I have had limited success writing Dreamcast cdi files on Mac OS X 10.4.11, so long as they only have a single audio and a single data session.

    My guides were:




    The key points I found were:
    Use cdirip-0.6.2, not any later versions
    Unmount the disk before each session
    Realize the disk device name was IODVDServices/X, where X was a number

    So a working session for me went something like:
    ../../cdirip/cdirip-0.6.2/cdirip foo.cdi -info
    ../../cdirip/cdirip-0.6.2/cdirip foo.cdi
    disktool -u disk1 0
    cdrecord dev=IODVDServices/0 -dao -v -multi -audio taudio01.wav
    disktool -u disk1 0
    cdrecord dev=IODVDServices/0 -tao -v -xa tdata02.iso
    disktool -u disk1 0
    cdrecord dev=IODVDServices/0 -toc

    This was on a Titanium G4 laptop with a retrofitted Matshita UJ-815.

    ReplyDelete
  2. My guides were erased due to angle brackets, apparently:
    http://mc.pp.se/dc/cdr.html
    https://sites.google.com/site/hackerb9/cdi
    http://dcemulation.org/phpBB/viewtopic.php?f=48&t=95386

    ReplyDelete
    Replies
    1. I know those URLs, and they didn't help me a great deal, but you've certainly got different steps than I was using. I'll try this out when I have a couple spare cycles.

      Also good to know that CDIRip actually does work.

      Delete
    2. Hmm. I still can't get it to work even with your steps, even with driveropts=burnfree, even with speed=1. Maybe it's the burner in the G5.

      Delete
  3. As a diehard devotee of my iBook G4, let me take this opportunity to express how much I appreciate all of your hard work on TenFourFox. I think this key piece of software is the most important thing for keeping my iBook alive and relevant. Thanks, Classic!

    -Chris

    ReplyDelete
  4. I wondered if you had made more progress on this. I've got an old Ppc MacBook and an Intel iMac. I was looking into getting a dreamcast and playing around with some homebrew stuff.

    ReplyDelete
    Replies
    1. I still have to use Mac OS 9 and Toast 4.2 to burn the opening audio session; unfortunately, I was not able to get Ronald's suggestions to work. Might be something about the G5's burner.

      Delete

Due to an increased frequency of spam, comments are now subject to moderation.