Looking for volunteers with USB-GDROM or GDEMU (or willing to burn discs)

Discussion in 'Sega Dreamcast Development and Research' started by Mrneo240, Nov 3, 2017.

  1. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454
    Hello,

    If you don't want to read then SKIP to the end, if you want to know about the project read on:

    So we started a new project in order to help ease the issue of playing CDDA from WinCE games. It's a piece of Homebrew that reads a disc inserted into the Dreamcast and outputs the track information. I believe this is what is preventing CD-Rs from playing certain music correctly. Lots of technical stuff But it boils down to the Dreamcast reading a discs TOC 2 ways and I don't believe you can easily get access to the second way (the way the bios works, probably can with syscalls but I haven't dug). Original gd-rom of retail discs have their TOC info correct in every sense of the word, while most remastered images do not.

    CDDA can be played a couple of ways in WinCE, notably by track or sector and then can be paused and resumed certain ways as well. The laser can only be in one place at a time and it's either reading game data or playing music. Looking through the SDK docs and compiling information and comparing how games actually "play" music I believe it can be fixed with some minor changes to IP.bin and possibly patching the executable. This would be groundbreaking new stuff for the community and fix many issues currently present in WinCE games.

    I spent a couple hours last night around 2am working on this program to dump specific info from discs from within WinCE. I could burn it to a CD but I only own 3 actual retail discs (none of which are useful in regards to this tool, they are KATANA SDK games) and as far as I can tell it doesn't work with burned games but I got too tired to continue testing.

    Project needs:
    • volunteers
      • Have a gdrom emulator or willing to burn a disc (possibly wasting it)
      • If having a gdrom emulator then be willing to download gdis of wince games that have cdda
      • If burning disc then have retail discs of the same games
    • People who have experimented with this before at any skill level
    • People comfortable in reversing/assembly
    • Programmers comfortable with the win32/wince environment
    • Programmers of any type

    Here's a link to the tool:
    https://mega.nz/#!ZllmEIxT!X4Q_FxmHJ52XQx7wKWqJehjH0n0TE3fRxedASnyw1uw

    If you are just curious or feeling like seeing what this is about burn it but don't expect anything interesting. It's a tool and isn't interesting to the average person just playing games.

    It should just load up and give you a menu with a brief rundown and instructions.The top has 4 tabs that you can cycle through to show different information. Near the bottom is instructions, basically just hit "A" when you have inserted a disc into the dreamcast and when the status bar shows "valid/invalid gd-rom". "X" will trigger a routine to trick the dreamcast into thinking the disc has been removed (you shouldn't need to use it).

    Ignore the part about dpad I think it's actually triggers. I can barely remember from last night and I'm away from my laptop at this point.
    Just please let me know if after switching disc that something shows up for the low density and high density sections.

    Tonight I'll be back and adding more useful things in the this utility and will be updating the builds until it is generating what we/I need. The goal is to be able to "emulate" how retail games play CDDA on a per game basis to help the effort of getting remastered images to correctly play music.

    Thank you anyone who wants to help or is just curious.

    Gallery:
    WINCE_DEV_INTERNAL_1.png 2_QUAKE III ARENA.png 3_ QUAKE III ARENA.png
     
    SiZiOUS and Anthony817 like this.
  2. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    2,960
    Likes Received:
    794
    Check the release of What's Shenmue with proper CDDA working and Ecco E3 demo for an original way to fix CDDA for mil-cd using only the IP.BIN. You need three dummy tracks in 1st session so the first audio track is track04.
     
  3. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    Don't you mean two? Audio, Audio, Data (Start of Session 2), Audio.

    Anyway, the format of track data in IP.BIN is known, and GDIBuilder sets it when building GDI images. The same information is probably applicable to MIL-CD as well. I don't know if it's actually documented somewhere but I had to figure it out myself when I wrote GDIbuilder. It's literally just a list of LBA's and the corresponding track type.

    My implementation of it starts at line 490 here:
    https://github.com/Sappharad/GDIbuilder/blob/master/GDIbuilder/DiscUtils/GDROM/GDromBuilder.cs
    Very simple, less than 20 lines of code.
     
  4. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454
    So You're saying that by having the TOC section correct in the IP.bin and 3 dummy tracks that some games are working without hacking?

    Aka:
    1st session
    Tr 1 4 second dummy track
    Tr 2 4 second funny track
    Tr 3 4 second dummy track
    Tr 4 actual track 1 cdda
    Tr 5 actual track 2 cdda
    And so on....
    2nd session
    Tr 1 data

    Right? Im fairly certain CD craft/GD workshop end up generating images that "conform" to that.

    Thank you for commenting that and confirming. Im going to try tonight to hopefully fix the display of the high density TOC (it goes one entry too far and reads garbage). Then hopefully start creating the interface for playing audio and create the framework for emulating the cdda calls from games.
     
  5. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454

    As far as I could tell on emulators with various syscalls and functions in the wince environment the TOC from the IP.bin on a MIL-CD cannot be read in one specific call. It always returns garbage. There is a call to read the first 256 bytes of the IP.bin but I haven't been able to get it to work at all so it's probably me. But even then it's returned as " SHORT IP[256]" so it's not even being parsed, just dumped as a char array.
     
  6. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    2,960
    Likes Received:
    794
    I am not saying that, although it can be the case for some Katana games. Look the builds I talked about to see the real syscall patching. Tip: the bootbin is scrambled on those I think to make room in the IP.BIN for patching or for convenience.

    @S4pph4rad

    For a mil-cd I see no advantage to split the data track in two with audio tracks in between, I'm not even sure audio tracks in session 2 would work.

    If you need the audio to start at track04, because you're patching syscalls to pretend a GD-ROM of inserted instead of a CD-R (WS/EccoE3) or cdda.exe is failing, you can simply put three dummy 4s tracks before the actual audio tracks in first session, then put a data track in the second one. The cd structure @Mrneo240 posted is the typical one for a cdda mil-cd, which is a different structure than for a GDI.

    The track listing in the ip.bin is indeed simple, but I don't think it's really used by the games.
     
    Last edited: Nov 3, 2017
  7. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454
    It may not be used but a bunch of literature suggests it could/should be used in determining how to and where to play CDDA data using sectors. Especially when resuming (... Maybe like in Armada) on how to calculate where to position the laser in order to play the next frame of sound data.

    I'm almost off work and already thinking of code and possibilities in my head :)
     
  8. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454
    found out something very interesting... the WinCE will only let you play with discs that are region coded to the dreamcast they are for.

    You can't out of the box put a PAL game in an NTSC console and mess around with it in WinCE. BUT! editing the IP.BIN embedded in the gdi and just change "E" to "JUE" will let you load it just fine.... I wonder if it is WinCE blocking it or the underlying bios. thoughts?
     
  9. truemaster1

    truemaster1 Gutsy Member

    Joined:
    Nov 10, 2015
    Messages:
    489
    Likes Received:
    202
    point me to one wince game with cdda tracks and i will test i have gdemu.
     
  10. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454
    im still working on a list but heres some:
    • Virtua Cop 2
    • Worms: Either
    • Sega Rally 2
    • bust a move 4
    • KISS PSYCHO CIRCUS THE NIGHTMARE CHILD
    • Nightmare Creatures II
    • Super Runabout: Either
    probably some others but im having to reference each game individually and its getting tedious.
     
  11. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454
  12. truemaster1

    truemaster1 Gutsy Member

    Joined:
    Nov 10, 2015
    Messages:
    489
    Likes Received:
    202
    ok i put in my sd your image and nightmare creatures 2 a usa gdi that comes with more than 80 cdda tracks. your image loading fine but when i press the disc swich button to go to nightmare creatures it comes with invalid gd
     
  13. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454
    What kind of Dreamcast do you have? What happens if you attempt to just load the TOC anyway? As with most early stuff there is no error checking because it's all going under the heading: "Research".

    Thank you for taking the time and trying!​
     
  14. truemaster1

    truemaster1 Gutsy Member

    Joined:
    Nov 10, 2015
    Messages:
    489
    Likes Received:
    202
    va1 pal moddel. i boot your image then i hit the change disc button on the gdemu to load the next folder the nightmare creatures 2 gdi image it comes with invalid gdrom message i press a button to load the toc. when i push the triggers we have 3 diferent windows
    1 ip header info:
    WIP . DISABLED
    2 NEODC DISK TOOL (LOW DENSITY) that comes with the tracks example
    Track FC - 07 05 1 MSF: 00:00:0000 FFFFFF6A
    3 NEODC DISK TOOL (HIGH DENSITY) with the same tracks as above
     
  15. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454
    Ok there's the issue: Pal console but the GDI was NTSC, the GDI must match your console version. I'll post a note updating that
     
  16. truemaster1

    truemaster1 Gutsy Member

    Joined:
    Nov 10, 2015
    Messages:
    489
    Likes Received:
    202
    ah yeah the game is ntcu-u
     
  17. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    I wasn't suggesting splitting the data track, although that would actually be a great idea if you want the track count to match the original games. I think I just misunderstood what you were suggesting. You were actually suggesting that all of the audio tracks go into the first session, and then data is the 2nd session as usual. I interpreted your post as suggesting 3 audio tracks in session 1, data in session 2, and assumed it was a mistake because data wasn't mentioned at all. I've never had to build an MIL-CD for a game with CDDA, so I didn't realize it was common practice to throw all of the CDDA into the first session. What you actually suggested makes a lot more sense than my initial interpretation.
     
    -=FamilyGuy=- likes this.
  18. Mrneo240

    Mrneo240 Peppy Member

    Joined:
    Sep 15, 2017
    Messages:
    396
    Likes Received:
    454
    Well things are going well "kind of" I'm still doing some work and testing things but I'm having to use an emulAtor. I've found and isolated the functions in "bust a move 4" related to but I haven't been able to take a memory dump while the game is running so I'm not 100% on what parameters are being sent to those functions. The assembly is easy enough to follow but I'm still not super up to date on my sh4 registers and method parameters. It's a shame the dreamcast isn't x86 but I guess that's half the fun!

    (Does anyone know how to load a ram dump and executable into IDA? I can do one or the either but I haven't been able to do both at the same time to see what is being pulled from memory.)

    So far it's been enough though to:
    Load the disc tool
    Swap to bust a move 4 (slightly edited track3, just changed ip.bin region header to JUE)
    Then play the tracks using the reconstructed functions (sh4 to c is a huge pain for me, I've been basically translating it to x86 and then to c which takes me forever)

    So it's progress but for this to work what is going to happen is the tool will be have to put in place of the games executable and the correct "sound emulation mode" will be set and then it should be a simple matter of getting the music to play and then copying the changes back. (Idk, I'm still working on how this part will work)
     

Share This Page