all repos — mgba @ 1300b7570dafd8f204202d74f3d62c177b87436b

mGBA Game Boy Advance Emulator

PSP2: Add fullscreen toggle
Jeffrey Pfau jeffrey@endrift.com
Sun, 26 Jul 2015 16:28:49 -0700
commit

1300b7570dafd8f204202d74f3d62c177b87436b

parent

e3f0c87399e058d1fb080737079f3937f6efc15f

1 files changed, 15 insertions(+), 1 deletions(-)

jump to
M src/platform/psp2/main.csrc/platform/psp2/main.c

@@ -74,6 +74,8 @@

int main() { printf("%s initializing", projectName); bool running = true; + bool fullscreen = false; + bool fsToggle = false; struct GBAVideoSoftwareRenderer renderer; GBAVideoSoftwareRendererCreate(&renderer);

@@ -154,6 +156,14 @@ if (pad.buttons & PSP2_CTRL_TRIANGLE) {

running = false; break; } + if (pad.buttons & PSP2_CTRL_SQUARE) { + if (!fsToggle) { + fullscreen = !fullscreen; + } + fsToggle = true; + } else { + fsToggle = false; + } activeKeys = GBAInputMapKeyBits(&inputMap, PSP2_INPUT, pad.buttons, 0); enum GBAKey angles = GBAInputMapAxis(&inputMap, PSP2_INPUT, 0, pad.ly);

@@ -192,7 +202,11 @@ MutexUnlock(&audioContext.mutex);

vita2d_start_drawing(); vita2d_clear_screen(); - vita2d_draw_texture_scale(tex, 120, 32, 3.0f, 3.0f); + if (fullscreen) { + vita2d_draw_texture_scale(tex, 0, 0, 960.0f / 240.0f, 544.0f / 160.0f); + } else { + vita2d_draw_texture_scale(tex, 120, 32, 3.0f, 3.0f); + } vita2d_end_drawing(); vita2d_swap_buffers();