#include <pthread.h>
+#include <math.h>
#include "console.h"
#include "maru_sdl.h"
#include "emul_state.h"
{ //sdl surface
SDL_Surface *processing_screen = NULL;
- if (current_scale_factor <= 0.5) {
- /* zoom filter : c00 c0-1 c01 c-10 c10 */
- processing_screen = maru_rotozoom(surface_qemu, (int)current_screen_degree, current_scale_factor);
- SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
- } else if (current_scale_factor != 1.0 || current_screen_degree != 0.0) {
+ if (current_scale_factor < 0.5) {
// workaround
// set color key 'magenta'
surface_qemu->format->colorkey = 0xFF00FF;
- /* zoom filter : c00 c01 c10 c11 */
+ //image processing
processing_screen = rotozoomSurface(surface_qemu, current_screen_degree, current_scale_factor, 1);
SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
+ } else if (current_scale_factor != 1.0 || current_screen_degree != 0.0) {
+ //image processing
+ processing_screen = maru_rotozoom(surface_qemu, (int)current_screen_degree, current_scale_factor);
+ SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
} else { //as-is
SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL);
}
unsigned int sum_b = 0; //0x000000ff
unsigned int c00 = (x * src_w) + y;
- unsigned int c01 = (y + 1 > src_w) ? c00 : c00 + 1;
- unsigned int c10 = (x + 1 > src_h) ? c00 : ((x + 1) * src_w) + y;
- unsigned int c11 = (y + 1 > src_w) ? c00 : c10 + 1;
+ unsigned int c01 = (y + 1 >= src_w) ? c00 : c00 + 1;
+ unsigned int c10 = (x + 1 >= src_h) ? c00 : ((x + 1) * src_w) + y;
+ unsigned int c11 = (y + 1 >= src_w) ? c00 : c10 + 1;
sum_r = (src_addr[c00] & R_CHANNEL_MASK) + (src_addr[c01] & R_CHANNEL_MASK) +
(src_addr[c10] & R_CHANNEL_MASK) + (src_addr[c11] & R_CHANNEL_MASK);