Sega fishlife patched version that runs on any retail Dreamcast

Discussion in 'Sega Dreamcast Development and Research' started by Anthony817, Jun 2, 2019.

  1. darcagn

    darcagn Site Supporter 2013, Site Supporter 2014

    Joined:
    May 13, 2007
    Messages:
    559
    Likes Received:
    296
    Ok, so here's a fix for the problem -- now after using this fix CDI, Fish Life now works on all of my Dreamcasts, and emulators too!
    https://dcemulation.org/files/FishLifeFix-darcagn.zip

    If you are getting the ufInitSystem miss error on your console, simply load this CDI up on GDEMU or via a CD-R. It will erase partition 3 (the partition that has all the individual game entries) and replace the partition with the exact partition from the Fish Life Musée Bolo fish flash bin. When you see the graphical pattern on the screen, it's done! Afterwards, the JC GDI file or the CDI I linked in the above post should work without a hitch!
     
    Last edited: Jun 3, 2019
  2. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    320
    Likes Received:
    85
    i can confirm the same for some reason the gdi writes to flash but the cdi can't, tested with demul delete the dc.flash from nvram cdi will fail but gdi works normally, if you run the gdi first then the cdi will work too.
     
    darcagn likes this.
  3. darcagn

    darcagn Site Supporter 2013, Site Supporter 2014

    Joined:
    May 13, 2007
    Messages:
    559
    Likes Received:
    296
    An explanation for that could be if there's something special in the IP.BIN and it was overwritten by binhack during the CDI creation process. I did notice on the SWAT DC forums that the Dreamshell hacked version must have IP.BIN checked to run in Dreamshell for it to work.
    But I don't think this is really strictly the case, because I ran the GDI many times first with failure both on GDEMU and lxdream emulator, before I tried the CDI file.
    On lxdream eventually it started working with my JP flash and EU flash files, but it never worked the first time.

    I also tested by running the image many times with errors and checked if anything in the flash changed (so, for example, maybe it will write something different each time it runs and then after a certain # of tries it finally sees it as a 'proper' flash partition), but nothing was changing.

    Thanks for confirming my Dreamcasts and I are not crazy though.
     
    MetalliC and -=FamilyGuy=- like this.
  4. Mrneo240

    Mrneo240 Enthusiastic Member

    Joined:
    Sep 15, 2017
    Messages:
    520
    Likes Received:
    624
    Ip.bin Is responsible for updating playlog. So they probably use some of the same code to write flash
     
    MetalliC, darcagn and -=FamilyGuy=- like this.
  5. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    320
    Likes Received:
    85
    Mrneo240 likes this.
  6. darcagn

    darcagn Site Supporter 2013, Site Supporter 2014

    Joined:
    May 13, 2007
    Messages:
    559
    Likes Received:
    296
    Interesting, I did not know that. A year or two ago I was doing some research on binhacking utilities and thought I had downloaded pretty much every binhacking utility that ever publicly existed, but I didn't have that one!
     
  7. Mrneo240

    Mrneo240 Enthusiastic Member

    Joined:
    Sep 15, 2017
    Messages:
    520
    Likes Received:
    624
  8. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    320
    Likes Received:
    85
  9. MetalliC

    MetalliC Spirited Member

    Joined:
    Apr 23, 2014
    Messages:
    180
    Likes Received:
    133
    right, original IP.BIN's bootstrap code update playlog (partition 3) and put there Fish Life record (also initialise partition if it empty)
    next, game run, and at some point checking playlog, if Fish Life record was not found - it will hang with "ufInitSystem miss" message.
    but, CDI's IP.BIN does not update playlog, and in result game hang, unless flash already had Fish Life record.

    to properly fix this game CDI I'd suggest copy original bootstrap code (from GDI IP.BIN, starting from 3800h offset to its end), into CDI's IP.BIN, and also replace 1ST_READ.BIN with scrambled.
     
    Last edited: Jun 5, 2019
  10. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    320
    Likes Received:
    85
    bootstrap 1 is located 3800-5FFF also why to scramble the 1ST_READ.BIN?

    tasted with the original bootcode and unscrambled bin and have the same error
     
  11. MetalliC

    MetalliC Spirited Member

    Joined:
    Apr 23, 2014
    Messages:
    180
    Likes Received:
    133
    there is 2 bootstraps, as was said from 3800 and till the end, there needed to restore both.
    because BIOS load MIL-CD 1ST_READ.BIN with descrambling, and normally require it to be scrambled.
    but some of customized IP.BINs (like this one CDI) have injected one more de-descramble routine (in bootstrap2 I'd guess), which gives possibility to use regular not scrambled 1ST_READ.BINs
     
    Last edited: Jun 5, 2019
  12. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    320
    Likes Received:
    85
    is this possible without LBA hack on cdi? how can i use it in 45000 LBA?
    i have the IP.BIN and the scrambled 1ST_READ.BIN how can i make the cdi?
     
  13. Mrneo240

    Mrneo240 Enthusiastic Member

    Joined:
    Sep 15, 2017
    Messages:
    520
    Likes Received:
    624
    Yes you could make data/data lba 45000 image but the idea would still be your drive would be Holly locked.
     
  14. MetalliC

    MetalliC Spirited Member

    Joined:
    Apr 23, 2014
    Messages:
    180
    Likes Received:
    133
    ah, right, I forgot about holly protection. screw it then, it will not work "as is", needed to inject unlock code.
     
  15. Mrneo240

    Mrneo240 Enthusiastic Member

    Joined:
    Sep 15, 2017
    Messages:
    520
    Likes Received:
    624
    I did just that and still doesn't work. I'm lost
     
  16. MetalliC

    MetalliC Spirited Member

    Joined:
    Apr 23, 2014
    Messages:
    180
    Likes Received:
    133
    where you injected unlock and how it "doesn't work" ?
    I suppose unlock code should be before any flash ROM access.
     
  17. Mrneo240

    Mrneo240 Enthusiastic Member

    Joined:
    Sep 15, 2017
    Messages:
    520
    Likes Received:
    624
    I overwrite the first 12 instructions at 0x8c00b800 to jump to my own code.

    That code, sets up cache, does unlock and reloads CD, then sets up registers how they were and jumps to the second part of the IP.bin to where it would originally jump.

    The actual application loads fine but only if the flash info is already present
     
  18. darcagn

    darcagn Site Supporter 2013, Site Supporter 2014

    Joined:
    May 13, 2007
    Messages:
    559
    Likes Received:
    296
    I really think the flash code (whether the writing part in the bootstrap or the reading part in the binary) is buggy or there's a condition not being accounted for here.

    I really do promise that I ran the japanese-cake GDI (not just the CDI version) with original IP.BIN intact many times on both the emulator and Dreamcast+GDEMU and was getting failures. So most likely your custom bootstrap is doing what you intended.

    Maybe the most pragmatic approach would be to take the approach I did with the CDI, but instead leverage neoIP code to overwrite partition 3 with the Fish Life flash image if Y (or whatever) is held down at the license screen. It's a hacky solution, but short of trying to bugfix Sega's code, it'd be a working solution, and I don't think partition 3 stores any information that the end user would particularly miss.
     
  19. megavolt85

    megavolt85 Peppy Member

    Joined:
    Jan 8, 2015
    Messages:
    332
    Likes Received:
    483
    menu settings saved to partition 3

    build image with hacked binary and custom IP.BIN
    1) check on EMU with writed parametrs in partition 3
    2) check on EMU with clear flashrom
    with clear flashrom you can't save settings in start menu
     

    Attached Files:

    madsheep likes this.
  20. MetalliC

    MetalliC Spirited Member

    Joined:
    Apr 23, 2014
    Messages:
    180
    Likes Received:
    133
    as was said: game's flash code REQUIRE flash to already have Fish Life Amazon game record in partition 3.
    "ufInitSystem miss" error message is shown if it was not found.

    when I clear flash partition 3 in emulator, run GDI game and put break point at start of 1st_read.bin - when breakpoint hit I see Fish Life record in the flash.
    how is that possible ? because original IP.BIN put it there

    but, then I run CDI game image, at start of 1stread.bin breakpoint I still see empty flash part.3
    and game will hang with error..
     
    Last edited: Jun 11, 2019

Share This Page