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

Improve portability and multiple fixes #13

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Feb 12, 2024

  1. Makefile: simplify and use pkg-config for SDL2

    This allows for improved cross-platform building. Tested working on
    Windows 10 in a MinGW64 (w64devkit) development environment with the
    following commit.
    
    Signed-off-by: Mahyar Koshkouei <[email protected]>
    deltabeard committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    c1b785a View commit details
    Browse the repository at this point in the history
  2. main: use SDL functions only

    Removes mmap() and other non-portable instructions. Only SDL2 functions
    are used now. Tested working on Windows 10 in a MinGW64 development
    environment.
    
    This may fix issue binji#1, whereby a crash happens if rom.sav is not found.
    Now, if rom.sav is not found, 32kB is allocated, and then later saved on
    exit. Not tested on macOS.
    
    Signed-off-by: Mahyar Koshkouei <[email protected]>
    deltabeard committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    20a3f90 View commit details
    Browse the repository at this point in the history
  3. main: add frame timing

    Fixes issue binji#10 whereby gameplay would run at the speed of the monitor
    refresh rate. A delay is automatically calculated on each frame to slow
    down the gameplay if required. Note that this does not speed up the
    gameplay if the monitor has a refresh rate lower than 59 Hz. In such
    cases, VSYNC should just be disabled in the source code.
    
    Signed-off-by: Mahyar Koshkouei <[email protected]>
    deltabeard committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    8d8de02 View commit details
    Browse the repository at this point in the history
  4. main: use SDL instead of inttypes.h

    Might help reduce the number of bytes in the obfuscated version, and
    hopefully compensate for the additions made in the previous commits.
    
    Signed-off-by: Mahyar Koshkouei <[email protected]>
    deltabeard committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    e8ed8be View commit details
    Browse the repository at this point in the history
  5. main: center window & misc changes

    Reduced length of variable name. Although this doesn't matter as it will
    become obfuscated anyway.
    
    Reduce speed_compensation calculation to single line.
    
    Signed-off-by: Mahyar Koshkouei <[email protected]>
    deltabeard committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    dca3c4e View commit details
    Browse the repository at this point in the history
  6. main: fix running too fast when vsync off

    Signed-off-by: Mahyar Koshkouei <[email protected]>
    deltabeard committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    9e58632 View commit details
    Browse the repository at this point in the history