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

Simplify zoom logic, add 256x384 crop option for DS games, fix FPS bug #5

Merged
merged 4 commits into from Aug 8, 2020
Merged

Simplify zoom logic, add 256x384 crop option for DS games, fix FPS bug #5

merged 4 commits into from Aug 8, 2020

Conversation

sudofox
Copy link
Contributor

@sudofox sudofox commented Jul 28, 2020

Now you can press C to crop the window to 256x384 (works with split mode) when you've launched a game in "original resolution" mode.

https://en-americas-support.nintendo.com/app/answers/detail/a_id/179/~/how-to-play-nintendo-ds-and-dsi-games-in-their-original-resolution

@sudofox
Copy link
Contributor Author

sudofox commented Jul 28, 2020

Hold on, I made a mistake with the zoom levels.

@sudofox
Copy link
Contributor Author

sudofox commented Jul 28, 2020

Still working on it, might take a bit to finish.

// Zoom notes

// pressing the 0 key should be treated as zoomLevel 10
// Math for screen height in split/nonsplit can be combined
// width ratio calculated by (halfNativeWidth * zoomLevel) + halfNativeWidth

// For combined, non-cropped mode...

screenWidth = (200 * zoomLevel) + 200
screenHeight = (3 * screenWidth / 5) * 2

// For top screen, non-cropped mode

screenWidth = (200 * zoomLevel) + 200
screenHeight = (3 * screenWidth / 5)

// For the bottom screen, non-cropped mode

screenWidth  = (160 * zoomLevel) + 160
screenHeight = (3 * screenWidth / 4)

// For combined, cropped mode

screenWidth  = (128 * zoomLevel) + 128
screenHeight = (3 * screenWidth / 4) * 2

// For split, cropped mode

screenWidth  = (128 * zoomLevel) + 128
screenHeight = (3 * screenWidth / 4)

@sudofox
Copy link
Contributor Author

sudofox commented Jul 28, 2020

That should make things nice and spiffy. Wish I would stop accidentally committing to GitHub without the commits being tied to my account properly, lol.

Also, sorry if the math in the setSize calls is overcomplicated, this is maybe my first or second time writing C++ code and I was a bit confused about how to properly create temporary variables.

@sudofox sudofox changed the title Add option to crop to original resolution for DS games Simplify zoom logic, add option to crop to original resolution for DS games Jul 28, 2020
@sudofox
Copy link
Contributor Author

sudofox commented Jul 28, 2020

That's a one-line fix for a problem where FPS would go up to 4000 FPS when the 3DS was closed or disconnected. I'd close my 3DS and come back to a laptop blasting its fans as fast as it could muster.

@sudofox sudofox changed the title Simplify zoom logic, add option to crop to original resolution for DS games Simplify zoom logic, add 256x384 crop option for DS games, fix FPS bug Jul 28, 2020
@Gotos
Copy link
Owner

Gotos commented Jul 29, 2020

Thanks!
I haven't been home in a while, but will be by the end of the week. I'll hope I can test this at the weekend and merge it, if I don't find problems :)
[Edit:] Looking at the code, it definitely looks a lot cleaner than my old code tho, much appreciated :D

@sudofox
Copy link
Contributor Author

sudofox commented Aug 8, 2020

How're we looking?

@Gotos Gotos merged commit 683c8be into Gotos:master Aug 8, 2020
@Gotos
Copy link
Owner

Gotos commented Aug 8, 2020

Just got around to test this, looks good. Thanks! :)

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