Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pre-rendered cutscene corruption #188

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on May 22, 2024

  1. Fixes movie corruption due to a bad return type in getOffset().

    Dword_51F018 is a 256 element arry with 16 bit values ranging from
    65535 - -65535. Elements 0-127 are all positive 16bit values where
    as elements 128-255 are all negative 16bit values. getOffset() takes
    in an unsigned 16bit value, gets the signed representation of the
    lower 8 bits and adds it to the result of the Dword_51F018[] array
    after indexing
    
    Return type is capped at 16bits incase of an intentional overflow
    so the offset calculation does not exceed dest ptr of the memcpy()
    call during the decompression stage of the video.
    
    Not 100% on this fix as I have not fully reversed the decompression
    function to ensure the behavior of getOffset() and the decompression
    function are proper in tune with each other. However I have verified
    that this fixes both the intro cinematic and the vat explosion
    cutscene near the end of the game.
    
    Credit goes to @Northfear for their vita fork for pointing me in the
    right direction on where to start with this issue. See commit
    00c1269 on their fallout1-ce-vita
    fork for their fix. Due to the inconsistancy of the C STD library,
    I performed further verification of the fix because the bit width
    of int has no guarntees. This can lead to platform->platform issues
    as each compiler and triple target could assign int to be whatever
    bit width most suits it.
    dje4321 committed May 22, 2024
    Configuration menu
    Copy the full SHA
    c101fda View commit details
    Browse the repository at this point in the history