X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=video.c;h=457a7b5b500696c49cdac724fd2c22a5c989a39f;hb=638cc6264cf3e8d1f046885fb68b5a1e22729d06;hp=7415c7642255362944303f72fd66b756f7e43a69;hpb=4cdfc0bc7b3dd2051b8027da4e2f35bbb9897307;p=gpsp.git diff --git a/video.c b/video.c index 7415c76..457a7b5 100644 --- a/video.c +++ b/video.c @@ -105,7 +105,6 @@ SDL_Surface *hw_screen; #endif SDL_Surface *screen; const u32 video_scale = 1; -extern void gp2x_flush_cache(void *beginning_addr, void *end_addr, int flags); #define get_screen_pixels() \ ((u16 *)screen->pixels) \ @@ -3339,6 +3338,12 @@ void flip_screen() void flip_screen() { + if((screen_scale == scaled_aspect) && + (resolution_width == small_resolution_width) && + (resolution_height == small_resolution_height)) + { + upscale_aspect(gpsp_gp2x_screen, screen_pixels); + } pollux_video_flip(); screen_pixels = (u16 *)gpsp_gp2x_screen + screen_offset; } @@ -3437,9 +3442,7 @@ void flip_screen() { SDL_BlitSurface(screen, NULL, hw_screen, NULL); } - /* it is unclear if this syscall takes virtual or physical addresses, - * but using virtual seems to work for me. */ - gp2x_flush_cache(hw_screen->pixels, hw_screen->pixels + 320*240, 0); + warm_cache_op_all(WOP_D_CLEAN); } #else SDL_Flip(screen); @@ -3564,7 +3567,7 @@ void init_video() screen = SDL_CreateRGBSurface(SDL_HWSURFACE, 240 * video_scale, 160 * video_scale, 16, 0xFFFF, 0xFFFF, 0xFFFF, 0); - gp2x_load_mmuhack(); + warm_change_cb_upper(WCB_C_BIT|WCB_B_BIT, 1); #else screen = SDL_SetVideoMode(240 * video_scale, 160 * video_scale, 16, 0); #endif @@ -3692,13 +3695,19 @@ void video_resolution_large() void video_resolution_small() { - screen_offset = 320*40 + 40; + if(screen_scale == scaled_aspect) + screen_offset = 320*(80 - 14) + 80; + else + screen_offset = 320*40 + 40; resolution_width = 240; resolution_height = 160; - fb_use_buffers(999); + fb_use_buffers(3); clear_screen(0); flip_screen(); + clear_screen(0); + flip_screen(); + clear_screen(0); } void set_gba_resolution(video_scale_type scale) @@ -3731,7 +3740,7 @@ void video_resolution_large() resolution_height = 240; SDL_ShowCursor(0); - gp2x_load_mmuhack(); + warm_change_cb_upper(WCB_C_BIT|WCB_B_BIT, 1); #else screen = SDL_SetVideoMode(480, 272, 16, 0); resolution_width = 480; @@ -3763,7 +3772,7 @@ void video_resolution_small() SDL_ShowCursor(0); - gp2x_load_mmuhack(); + warm_change_cb_upper(WCB_C_BIT|WCB_B_BIT, 1); #else screen = SDL_SetVideoMode(small_resolution_width * video_scale, small_resolution_height * video_scale, 16, 0);