aboutsummaryrefslogtreecommitdiff
path: root/scale.c
diff options
context:
space:
mode:
authorneonloop2021-08-24 15:46:47 +0000
committerneonloop2021-08-24 15:46:47 +0000
commit0060a16ad707c1d6f2013947821ff55e377ceb92 (patch)
tree5b11937d6740537a02547de77c6ed87e41fcf86f /scale.c
parent702d6adc2133e21861e227cdb1ae8b0e4a89e410 (diff)
downloadpicoarch-0060a16ad707c1d6f2013947821ff55e377ceb92.tar.gz
picoarch-0060a16ad707c1d6f2013947821ff55e377ceb92.tar.bz2
picoarch-0060a16ad707c1d6f2013947821ff55e377ceb92.zip
Clears buffer when switching resolutions
Avoids screen persistence when switching from a higher to a lower resolution.
Diffstat (limited to 'scale.c')
-rw-r--r--scale.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scale.c b/scale.c
index 7287d5a..b145d60 100644
--- a/scale.c
+++ b/scale.c
@@ -347,7 +347,7 @@ static void scale_sharp_256xXXX_320xXXX(unsigned w, unsigned h, size_t pitch, co
static void scale_select_scaler(unsigned w, unsigned h, size_t pitch) {
double current_aspect_ratio = aspect_ratio > 0 ? aspect_ratio : ((double)w / (double)h);
- /* mame2000 sets resolutions / aspect ration without notifying
+ /* mame2000 sets resolutions / aspect ratio without notifying
* of changes, new should always override old */
if (!strcmp(core_name, "mame2000")) {
current_aspect_ratio = ((double)w / (double)h);
@@ -448,6 +448,7 @@ void scale(unsigned w, unsigned h, size_t pitch, const void *src, void *dst) {
if (w != prev.w || h != prev.h || pitch != prev.pitch) {
PA_INFO("Dimensions changed to %dx%d\n", w, h);
scale_select_scaler(w, h, pitch);
+ memset(dst, 0, SCREEN_HEIGHT * SCREEN_PITCH);
prev.w = w; prev.h = h; prev.pitch = pitch;
}