Open
Conversation
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 <mk@deltabeard.com>
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 <mk@deltabeard.com>
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 <mk@deltabeard.com>
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 <mk@deltabeard.com>
Author
|
Changed to draft because turning off vsync on line 145 causes the game to run too fast, which demonstrates that there is something wrong in the timing code I added. |
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 <mk@deltabeard.com>
Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
Owner
|
Thanks for taking a look at this! Yeah, I ended up using the SDL filesystem functions for smolnes, which made it a lot more portable. It's a little sad to lose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request fixes issue #10, and possibly #1 (I haven't got a macOS system to test with). I've written some details in the commit messages. I understand that this is a size sensitive demo, so I tried to make the changes as helpful as possible.
These changes should theoretically allow any system that is supported by SDL2 to run this project. I have tested Windows 10, which wasn't supported before.
These changes might increase the number of characters in the obfuscated version, but I have not made changes to it (is pokegb.cc generated automatically or manually?).
SDL_WINDOWPOS_CENTEREDwas added because without it the window is created in the top right corner and it is not possible to move it easily due to the title bar being off-screen, but this could be changed to a magic value in the obfuscated version.Thanks.