Dreamcast Widescreen Hacks

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

  1. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    893
    There's quite a bit of room in the bootsector, but that depends on how big the routine needs to be.

    Do you know why those values aren't in the executable itself? The way Dreamcast video library are handled? Per example, on Saturn, an AR code can be translated into a binary hack quite easily, I did it for panzer dragoon without problems to remove the AR check (yes, I hacked a binary to remove the AR check so I don't have to use AR codes for it when I have an AR plugged in).
     
  2. VIRGIN KLM

    VIRGIN KLM Active Member

    Joined:
    Nov 20, 2015
    Messages:
    44
    Likes Received:
    49
    That's not true, you can find the function code that handles the math and modify it so the game will initialize the value to the one that represents widescreen. Now THAT though needs a bit of work and some slight MIPS assembly knowledge. Nothing impossible, it has been done for PS2, PS1, XBOX, GC and the list goes on. Now the thing is who wants to put the effort into that. Not that it will be a tedious work to do, it's just that the plain widescreen hacks just do the job for now with a non-"invasive" method. What would be nice is if anybody would program a tiny program (like those programs that used to come in bootleg discs that would enable cheats in the game before it boots) and would let you choose between 4:3, 16:9 or any ather aspect ratio available for the game.

    EDIT: Upon re-reading your post I think we say the same thing or pretty like the same thing?
     
    Last edited: Nov 21, 2015
  3. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    893
    Yeah you're saying the same thing.

    An IP.BIN codebreaker-like stub would be very nice. I don't have the skills to code it myself, but I could write tools to inject it into gdis. Basically you enter the CB code and it generates the stub accordingly and inserts it into the gdi.

    I think it'd be a nice way to do it.
     
    Anthony817 likes this.
  4. Esppiral

    Esppiral Gutsy Member

    Joined:
    Oct 3, 2012
    Messages:
    495
    Likes Received:
    1,041
    Updated tomb raider patch the previous one was cropped this one isn't


    TOMB RAIDER THE LAST REVELATION PAL UK.
    02B75E28----3EC00000 (extra geometry clipping.)

    [​IMG]
     
    megavolt85 and Anthony817 like this.
  5. d123456

    d123456 Site Supporter 2015

    Joined:
    Jan 10, 2015
    Messages:
    23
    Likes Received:
    5
    Would it be possible to do a hex edit on an iso of this game to play on an actual dreamcast without doing codes, please?
     
  6. VIRGIN KLM

    VIRGIN KLM Active Member

    Joined:
    Nov 20, 2015
    Messages:
    44
    Likes Received:
    49
    I don't have the knowledge to do it.

    @Esppiral
    In Border Down using Demul there is a value at 2C19501A that handles width but I feel like I'm missing something. The game lets me apply the cheat only when it's paused, it will default it once you unpause. (Anticheat mechanism?) Could you give it a shot?
     
  7. LordFenixNC

    LordFenixNC Peppy Member

    Joined:
    Aug 24, 2014
    Messages:
    300
    Likes Received:
    72
    I would love to add moded gdr to my online catalog. 16x9 and the zoomed out versions.
     
  8. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    It's not in the baked into the executable because it gets calculated at runtime. We saw this when digging into Shenmue a bit more, with how the game actually derives it from 640x480 and a bunch of other calculations used the same set of values. There's nothing stopping a game from changing / updating the matrix at runtime, and we've already seen that several games do this. (The games where changing the value causes it to change back on the next frame, thus codes only work on hardware where Codebreaker can update the address frequently.) Codes can only be translated into binary hacks easily if they're dealing with constant data that isn't supposed to change anyway.

    After thinking about it some more, I think putting additional code into IP.BIN would be more work than necessary. Because some games need the value updated each frame to work, 1st_READ.BIN will still need to be patched so the additional code can be called. It would be easier just to do all of the patching ahead of time on the PC side, and there is usually room in 1ST_READ.BIN for extra code anyway. 32 bytes of free space is probably sufficient for every code posted in this thread so far. The thing we'd need to be careful about is to not patch the same function that codebreaker needs to hook for it's enable codes, otherwise you wouldn't be able to use that anymore.

    I'm not promising to do this just yet, but I'll look into it when time permits if someone else doesn't first.
     
  9. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    893
    Couldn't a minimal single-code CB be implemented in the ip.bin to update the value every frame?
    If you can swap the CB for a game and keep the code updating everyframe, it should also be possible to do this in a ip.bin isn't it?
    I'm not saying it'd be remotely easy.
     
  10. VIRGIN KLM

    VIRGIN KLM Active Member

    Joined:
    Nov 20, 2015
    Messages:
    44
    Likes Received:
    49
    In Unreal Tournament, with DEMUL using the address 2C258560 you are able to modify the width but it messes up the texture coordination system.
     
  11. VIRGIN KLM

    VIRGIN KLM Active Member

    Joined:
    Nov 20, 2015
    Messages:
    44
    Likes Received:
    49
    @Esppiral
    I'm pretty sure Ikaruga is incorrect.
    The correct address for width is 2C0CF560, changing it to 3F400000 affecting all geometry, including the stage/difficulty select screen, so I guess this is the global address.
    Also zeroing 2C0CF844 2C0CF864 2C0CF884 2C0CF8A4 removes the side black bars.
     
    Esppiral likes this.
  12. Esppiral

    Esppiral Gutsy Member

    Joined:
    Oct 3, 2012
    Messages:
    495
    Likes Received:
    1,041
    I'll update soul reaver and Ikaruga thanks for your corrections.
     
    VIRGIN KLM likes this.
  13. VIRGIN KLM

    VIRGIN KLM Active Member

    Joined:
    Nov 20, 2015
    Messages:
    44
    Likes Received:
    49
    No prob! Note though that what I've told you about those two games is still a matter of consideration, I'm still missing something from the puzzle. Don't straight-away change the addresses/values, give them an extensive test before because they still seem to have their issues. Both are pretty stubborn games.
     
  14. Gromber

    Gromber Spirited Member

    Joined:
    Apr 4, 2012
    Messages:
    115
    Likes Received:
    30
    Last edited: Nov 22, 2015
  15. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    You can put code to update the value wherever you want, but you still need to execute the code for it to do anything. Whether it goes in IP.BIN or not doesn't matter if nothing is going to use it.

    I don't know how DC codebreaker's hook works specifically, but I've done codes for other platforms and can explain how it works there. For things like the Gameboy Advance Codebreaker, the purpose of the enable code is to provide the address of the return instruction in a function that gets called every frame. (This could be something common in the SDK like reading input from the controller, waiting until the next frame, etc.) The codebreaker modifies the code at that address, replacing the return instruction with a jump to the code handler which applies all of the codes. At the end of the code handler it returns, going back to where it was originally supposed to return to. On newer systems where the enable code is optional, it still works the exact same way except the cheat device itself knows how to find the address where it needs to replace a return with a jump to the code handler. It won't work 100% of the time, but if a game is using the Dreamcast SDK it's probably going to use common methods that are the same across most games and SDK versions like njWaitVsync(). Since those methods are in multiple games, they know what it looks like and can search through 1st_READ.BIN for it and patch automatically.

    Unless the Dreamcast CB code handler works via some other means than other cheat devices and platforms, it's going to work like I've described above. So even though it may be possible to put into IP.BIN, you're still going to need logic to search for a function in 1st_read.bin to modify along with the logic to write the new values each frame. Hence why I mentioned it would be easier to just patch everything in 1ST_READ.BIN ahead of time on the PC side. The only advantage of doing it in IP.BIN would be that it leaves 1st_READ.BIN unmodified on the disc. I guess you could do a hybrid solution, where you have a game-specific IP.BIN and just the 'enable code' search is done on the PC side, if the ultimate goal was to keep the executable clean.

    In some cases, there are ways to apply codes without patching the executable at all. It looks like the DC has some timer interrupts. If a game doesn't clear them and doesn't use all of them, it could be possible to use one of them to automatically run a code handler. I don't know enough about the DC from a hardware standpoint at this point to know if it's feasible to use them for this purpose and there isn't a lot of documentation on the subject other than the KOS source code.
     
    Mrneo240, SiZiOUS, Anthony817 and 3 others like this.
  16. Jun Misugi

    Jun Misugi Member

    Joined:
    Oct 31, 2015
    Messages:
    9
    Likes Received:
    3
    Thank you very much but it doesn't works for me, i've a black screen.
     
  17. VIRGIN KLM

    VIRGIN KLM Active Member

    Joined:
    Nov 20, 2015
    Messages:
    44
    Likes Received:
    49
    Yep, the code I posted was for Demul, updated the post for a Dreamcast RAW format.
     
  18. Gromber

    Gromber Spirited Member

    Joined:
    Apr 4, 2012
    Messages:
    115
    Likes Received:
    30
    sega rally 2 ntscu code doesnt work for me on real dreamcast, can anyone test the game please? and capcom vs snk.
     
    Last edited: Nov 23, 2015
  19. Esppiral

    Esppiral Gutsy Member

    Joined:
    Oct 3, 2012
    Messages:
    495
    Likes Received:
    1,041
    Couldn't we just patch the "isos" just in the same fashion as psx widescreen codes? it is pretty easy, we "just" need a debugger-decompiler with breakpoints.

    I've patched Um jammer lammy and Bugs bunny lost in time for the psx using that.
     
  20. VIRGIN KLM

    VIRGIN KLM Active Member

    Joined:
    Nov 20, 2015
    Messages:
    44
    Likes Received:
    49
    Yep you can.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page