@@ -248,23 +248,35 @@ void vic4_close_frame_access ( void )
248
248
#ifdef XEMU_FILES_SCREENSHOT_SUPPORT
249
249
// Screenshot
250
250
if (XEMU_UNLIKELY (vic4_registered_screenshot_request )) {
251
- unsigned int x1 , y1 , x2 , y2 ;
252
- xemu_get_viewport (& x1 , & y1 , & x2 , & y2 );
251
+ unsigned int x1 , y1 , w , h ;
252
+ if (configdb .screenshot_and_exit ) {
253
+ // if it's "screenshot on exit" then we want the full NTSC/PAL frame (not the cropped viewport only)
254
+ x1 = 0 ;
255
+ y1 = 0 ;
256
+ w = TEXTURE_WIDTH ; // 720;
257
+ h = max_rasters ;
258
+ } else {
259
+ // This function returns the viewport as "bounding box" ...
260
+ xemu_get_viewport (& x1 , & y1 , & w , & h );
261
+ // ... let's calculate the width/height instead
262
+ w = w - x1 + 1 ;
263
+ h = h - y1 + 1 ;
264
+ }
253
265
vic4_registered_screenshot_request = 0 ;
254
266
if (!xemu_screenshot_png (
255
267
NULL , configdb .screenshot_and_exit ,
256
268
1 , 1 , // no ratio/zoom correction is applied
257
269
pixel_start + y1 * TEXTURE_WIDTH + x1 , // pixel pointer corresponding to the top left corner of the viewport
258
- x2 - x1 + 1 , // width
259
- y2 - y1 + 1 , // height
270
+ w , // width
271
+ h , // height
260
272
TEXTURE_WIDTH // full width (ie, width of the texture)
261
273
)) {
262
274
const char * p = strrchr (xemu_screenshot_full_path , DIRSEP_CHR );
263
275
if (p )
264
276
OSD (-1 , -1 , "%s" , p + 1 );
265
277
}
266
278
if (configdb .screenshot_and_exit ) {
267
- DEBUGPRINT ("VIC4: exiting on 'exit-on-screenshot' feature." NL );
279
+ DEBUGPRINT ("VIC4: exiting on 'exit-on-screenshot' feature (%ux%u) ." NL , w , h );
268
280
XEMUEXIT (0 );
269
281
}
270
282
}
0 commit comments