Dreamcast Widescreen Hacks

Discussion in 'Sega Dreamcast Development and Research' started by S4pph4rad, Oct 20, 2015.

  1. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    123
    Likes Received:
    91
    Complete list of codes moved to Sega Retro Wiki:
    https://segaretro.org/List_of_Dreamcast_Widescreen_Codes
    It's a Wiki, so feel free to add additional codes as you make them.

    Also, Esppiral wrote a tutorial on how to easily find Widescreen codes using DEmul and Cheat Engine:
    http://assemblergames.com/l/threads/widescreen-hacks.58620/page-27#post-900119

    Original post:
    =============
    These have been done on Gamecube, PS2, and even PS1, so I was wondering why nobody has attempted it on Dreamcast prior to now. I decided to do so, to give me an excuse to play though Shenmue 1 and 2 again. These are codebreaker codes, you still need the enable code for the respective game to use them. Tested on actual hardware, I can post a video if someone wants it for some reason.

    Provided in 2 different forms, depending on which you prefer.

    Shenmue 1 US: (Updated 2015-10-25)
    02230250 43800000 (Original Code, best for VGA)
    or
    02230250 438E38E4 for equivalent to 720x480 (DVD resolution)
    or
    02230250 43700000 for equivalent to 854x480 (Actual 16x9)

    Shenmue 2 EU: (Updated 2015-10-25)
    0231186C 43800000 (Original Code, best for VGA)
    or
    0231186C 438E38E4 for equivalent to 720x480 (DVD resolution)
    or
    0231186C 43700000 for equivalent to 854x480 (Actual 16x9)

    Before:
    [​IMG]
    After:
    [​IMG]

    Similar to the codes for other platforms, this is anamorphic widescreen so you're not getting higher resolution. Some additional changes could probably be made like shrinking the HUD too, but this is the simplest solution. Consider these version 1. There's still some pop-in occasionally near the edges of the screen, but it's not as bad as when you use an emulator to extend the visible area. That could probably be fixed with deeper analysis into how it decides when something goes out of range.

    It's pretty much the equivalent to what happens when you enable widescreen hacks in Devolution when running Gamecube games on Wii U, that also modifies 3D view matrix without messing with the HUDs in various games.

    Feel free to port the codes to other versions of the games, these were the versions I own.

    Is this something other people are interested in?
     
    Last edited: Aug 15, 2016
    bomb78, lostlight, Gromber and 8 others like this.
  2. MonkeyBoyJoey

    MonkeyBoyJoey 70's Robot Anime GEPPY-X (PS1) Fanatic

    Joined:
    Mar 1, 2015
    Messages:
    1,493
    Likes Received:
    222
    To my understanding, many Dreamcast games are native widescreen (720x480p). The problem is that the image is 720x480p in a 640x480p window. Most VGA monitors mistake this for 640x480p and squish it to that resolution. I've seen some HDTVs accept it correctly and it looks great.
     
  3. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    2,357
    Likes Received:
    311
    @darcagn could confirm this, but I think the DC outputs 720x480, but only 640x480 are actually not blank pixels.

    This is a nice trick @S4pph4rad, mind telling us how you pulled this off?
    Any increased lagging on real hardware from the extra detail? On Shenmue II per example?

    Also, does anyone know how to interpret CB codes to figure how to patch the executable instead? IIRC saturn AR was kinda obvious, hopefully this is the same.
     
  4. wombat

    wombat Site Supporter 2011,2013,2014,2015

    Joined:
    Mar 14, 2004
    Messages:
    2,530
    Likes Received:
    203
    @S4pph4rad this is great! During the Dreamcast hey day I was very disappointed to find out only a view games supported 16:9, so what you demonstrated here is a wish coming true.

    Hopefully your widescreen hacks can be interpreted into a patch, for easy usage (and especially for use with GDEMU)
     
  5. Anthony817

    Anthony817 Intrepid Member

    Joined:
    May 12, 2010
    Messages:
    660
    Likes Received:
    135
    Wow! Great idea. I always wondered why more games didn't have the option to display in widescreen since the true resolution of the console is able to output in it.

    Anyways, I think these should be able to be patched into backups of the games. Is that something that could be relatively easily done?

    And yes please if you can do a video comparing both that would be great. Thanks.

    Would be awesome to see this done on the games that work online like 4X4 Evo, Quake and PSO.
     
  6. shengoro86

    shengoro86 Active Member

    Joined:
    Dec 30, 2013
    Messages:
    27
    Likes Received:
    7
    Awesome S4pph4rad!!!! Thank you for this.
    I am going to look into how we can prepatch the games now for widescreen (I do a LOT of Shenmue hacks)
    www.youtube.com/lordcanti
     
    SILENT_Pavel likes this.
  7. IlDucci

    IlDucci Site Supporter 2015

    Joined:
    Aug 24, 2011
    Messages:
    43
    Likes Received:
    10
    I might have something to share. I have an (Edited: European) LG 32' LCD and the PAL copies of both games. On the original, unmodified versions, when I turn on the 60 Hz mode, it's like the screen crops itself top and down. Doesn't happen with 50Hz, where I get the usual black borders. That helps with the resolution thing?
     
    Last edited: Oct 21, 2015
  8. shengoro86

    shengoro86 Active Member

    Joined:
    Dec 30, 2013
    Messages:
    27
    Likes Received:
    7
    Interesting. I can port the PAL Hz switcher to the NTSC version and then test since we now have the RAM offsets. Worst case scenario, I might be able to firefack a trainer into Shenmue before it starts to toggle this codebreaker code.

    Does anyone know if CDB uses encrypted codes? I know one of the code utilities does. Dont remember which one.
     
  9. shengoro86

    shengoro86 Active Member

    Joined:
    Dec 30, 2013
    Messages:
    27
    Likes Received:
    7
    Ok here is my solution to bake this in to the game itself.

    1. I will port the PAL Hz switcher into the NTSC version of the game.
    2. I'll (at hex level) try to figure out how it switches the Hz output
    3. If it is done via RAM swapping, I'll change the RAM codes to match the codebreaker offsets (or the unencrypted ones)
    4. I'll have someone else hack the textures of the menu to change what it says to show a "Resolution Picker" instead of a Hz picker.
    5. I'll then just pack it up as a cdi with bootmake and release it as a Widescreen Shenmue.

    S4pph4rad will be primarily credited of course.

    I'll put up the work being done on my mods site.
     
    Anthony817 likes this.
  10. wombat

    wombat Site Supporter 2011,2013,2014,2015

    Joined:
    Mar 14, 2004
    Messages:
    2,530
    Likes Received:
    203
    If I understand your post correctly @shengoro86, does this mean you're planning to use the 50/60Hz selector as a 4:3 / 16:9 selector? If so, please take into consideration that players who use VGA won't see the selector show up and thus won't be able to take use of the widescreen hack.
     
  11. shengoro86

    shengoro86 Active Member

    Joined:
    Dec 30, 2013
    Messages:
    27
    Likes Received:
    7
    Well this will only be a prototype to see if it is even possible. Once I know how the menu works and if it can even be hacked without disassembly, Ill just make two versions to download. One for 50Hz players and one for 60Hz players.

    I think it is possible since that menu can affect the PowerVR directly. I dont think Shenmue has some weird API layer on top of it. It probably talks directly to the hardware.

    Ill be looking into this on Saturday.

    Worst case scenario, I'll make a custom trainer to be patched into 1st read or something.
    That will allow VGA players to see it.

    Does anyone know what the default Hz is on a PAL DC? Like say if that menu never existed, what will it use?
     
    Last edited: Oct 21, 2015
  12. IlDucci

    IlDucci Site Supporter 2015

    Joined:
    Aug 24, 2011
    Messages:
    43
    Likes Received:
    10
    Here's the proof of the crop (Watch the top text for reference)
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    @shengoro86 : If there was no selector, the game would instantly switch to 50 Hz mode.
     
    Last edited: Oct 21, 2015
    shengoro86 likes this.
  13. shengoro86

    shengoro86 Active Member

    Joined:
    Dec 30, 2013
    Messages:
    27
    Likes Received:
    7
    Thanks! I will document this.
     
  14. Anthony817

    Anthony817 Intrepid Member

    Joined:
    May 12, 2010
    Messages:
    660
    Likes Received:
    135
    Ziming and I were speaking about this and he was asking about the cutscenes if it affected the letterbox mode. Do you guys see any issues with it displaying the full bars? I don't have any discs left or I would test it out myself.
     
  15. shengoro86

    shengoro86 Active Member

    Joined:
    Dec 30, 2013
    Messages:
    27
    Likes Received:
    7
    I would assume the black bars would only be in the 4:3 ratio. At least that is how it is on an emulator.
     
  16. Esppiral

    Esppiral Peppy Member

    Joined:
    Oct 3, 2012
    Messages:
    341
    Likes Received:
    714
    This is incredible!!! Could this also be done with other Dreamcast Games?
     
  17. zouzzz

    zouzzz Site Supporter 2013

    Joined:
    Mar 24, 2008
    Messages:
    317
    Likes Received:
    33
  18. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    2,357
    Likes Received:
    311
    The bootbin (1st_read.bin) is loaded in ram at virtual address 0x8C010000 (0x0000018C in big endian).
    It seems to me 02230250/0231186C should be a little endian address that points inside a loaded executable, probably 1st_read.bin, although it seems it's not using the virutal addressing; maybe physical adressing (http://mc.pp.se/dc/memory.html)? Maybe the first one or two characters are a CB command too, like constantly write, etc..

    If we can find the corresponding offset in the executable, we could easily patch it.

    [EDIT]

    After looking into this a little more, I think I got it:
    02230250 43800000
    02 (write 8 half-bytes) 230250 (at virtual address 0x8C230250, physical 0x0C230250) 43800000 (the 4 bytes).
    Since the bootbin is loaded at address 0x8C010000, we should go to offset 0x00130250 (decimal 1245776) of the bootbin and change whatever is there to 0x43800000.
     
    Last edited: Oct 21, 2015
    TerdFerguson, shengoro86 and Esppiral like this.
  19. shengoro86

    shengoro86 Active Member

    Joined:
    Dec 30, 2013
    Messages:
    27
    Likes Received:
    7


    FamilyGuy, ill be looking into this too. I'll report to you if you like me to hand you anything i find.

    I opened a dev thread on the dojo.
    http://www.shenmuedojo.net/forum/viewtopic.php?f=37&t=49229

    Could someone find the widescreen code for the undub mod?

    http://www.shenmuedojo.net/forum/viewtopic.php?f=37&t=46869
     
  20. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    2,357
    Likes Received:
    311

Share This Page