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

BMP Screenshots for linux #436

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mechanicallamb
Copy link

Implementation of screenshots for linux users only (someone else will have to implement the directory creation on windows, as I cant get SDL [and by extension sameboy] to build). MAC is on its own. Attempting to take screenshots with non-linux machines will not modify the system

Ctrl+S while playing creates a screenshot directory in the same directory as the rom and .sav. A new directory is created for each rom. Screenshots are saved as [ROM_TITLE]+[base 10(32-bit number)].bmp

This was tested on Ubuntu 20.04 with games pokemon crystal, legend of zelda: oracle of seasons, and legend of zelda: a link to the past

@LIJI32 LIJI32 force-pushed the master branch 4 times, most recently from 4ebe973 to 0989ee2 Compare December 30, 2022 17:45
@ISSOtm
Copy link
Contributor

ISSOtm commented Jun 17, 2024

This is a good idea, but after talking with @LIJI32, there is an agreement that using BMP is Not Great—PNG would be preferable instead. Consider using libpng instead?

(Using libpng may end up being necessary for other purposes, such as a Linux thumbnailer. I know Liji doesn't like its API, but I'm volunteering to co-own that kind of code.)

Also, it is highly ill-advised to using fixed-size buffers for a lot of the operations you're doing, especially path manipulation. This creates a lot of vulns from long path names, and while SameBoy isn't security-critical software, it's nice to avoid crashes where possible, and also potentially being a backdoor vector (unlikely as that may be...).

Please feel free to ask for advice on how to implement any of the above, fwiw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants