X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=video.c;h=7415c7642255362944303f72fd66b756f7e43a69;hb=4cdfc0bc7b3dd2051b8027da4e2f35bbb9897307;hp=19a4c11b4238b3b31b4e6b2f3ee4336919cea5c1;hpb=010878638d6510ff2992e33fda84e137a1c2a9e0;p=gpsp.git diff --git a/video.c b/video.c index 19a4c11..7415c76 100644 --- a/video.c +++ b/video.c @@ -79,6 +79,18 @@ static void Ge_Finish_Callback(int id, void *arg) { } +#define get_screen_pixels() \ + screen_pixels \ + +#define get_screen_pitch() \ + screen_pitch \ + +#elif defined(WIZ_BUILD) + +static u32 screen_offset = 0; +static u16 *screen_pixels = NULL; +const u32 screen_pitch = 320; + #define get_screen_pixels() \ screen_pixels \ @@ -3323,6 +3335,14 @@ void flip_screen() } } +#elif defined(WIZ_BUILD) + +void flip_screen() +{ + pollux_video_flip(); + screen_pixels = (u16 *)gpsp_gp2x_screen + screen_offset; +} + #else #define integer_scale_copy_2() \ @@ -3406,6 +3426,13 @@ void flip_screen() SDL_Rect drect = {40, 40, 240, 160}; SDL_BlitSurface(screen, &srect, hw_screen, &drect); } + else if((screen_scale == scaled_aspect) && + (resolution_width == small_resolution_width) && + (resolution_height == small_resolution_height)) + { + SDL_Rect drect = {0, 10, 0, 0}; + SDL_BlitSurface(screen, NULL, hw_screen, &drect); + } else { SDL_BlitSurface(screen, NULL, hw_screen, NULL); @@ -3516,6 +3543,12 @@ void init_video() GE_CMD(NOP, 0); } +#elif defined(WIZ_BUILD) + +void init_video() +{ +} + #else void init_video() @@ -3644,6 +3677,44 @@ void clear_screen(u16 color) sceGuSync(0, 0); */ } +#elif defined(WIZ_BUILD) + +void video_resolution_large() +{ + screen_offset = 0; + resolution_width = 320; + resolution_height = 240; + + fb_use_buffers(1); + flip_screen(); + clear_screen(0); +} + +void video_resolution_small() +{ + screen_offset = 320*40 + 40; + resolution_width = 240; + resolution_height = 160; + + fb_use_buffers(999); + clear_screen(0); + flip_screen(); +} + +void set_gba_resolution(video_scale_type scale) +{ + screen_scale = scale; +} + +void clear_screen(u16 color) +{ + u32 col = ((u32)color << 16) | color; + u32 *p = gpsp_gp2x_screen; + int c = 320*240/2; + while (c-- > 0) + *p++ = col; +} + #else void video_resolution_large() @@ -3673,11 +3744,18 @@ void video_resolution_small() current_scale = screen_scale; #ifdef GP2X_BUILD + int w, h; SDL_FreeSurface(screen); SDL_GP2X_AllowGfxMemory(NULL, 0); - hw_screen = SDL_SetVideoMode((screen_scale == unscaled ? 320 : - small_resolution_width * video_scale), (screen_scale == unscaled ? 320 : - small_resolution_height * video_scale), 16, SDL_HWSURFACE); + + w = 320; h = 240; + if (screen_scale != unscaled) + { + w = small_resolution_width * video_scale; + h = small_resolution_height * video_scale; + } + if (screen_scale == scaled_aspect) h += 20; + hw_screen = SDL_SetVideoMode(w, h, 16, SDL_HWSURFACE); screen = SDL_CreateRGBSurface(SDL_HWSURFACE, small_resolution_width * video_scale, small_resolution_height * @@ -3768,7 +3846,7 @@ void print_string_ext(const char *str, u16 fg_color, u16 bg_color, /* EDIT */ - if(y + FONT_HEIGHT >= resolution_height) + if(y + FONT_HEIGHT > resolution_height) return; while(current_char) @@ -3812,8 +3890,13 @@ void print_string_ext(const char *str, u16 fg_color, u16 bg_color, str_index++; } - if(current_x + FONT_WIDTH >= resolution_width /* EDIT */) - break; + if(current_x + FONT_WIDTH > resolution_width /* EDIT */) + { + while (current_char && current_char != '\n') + { + current_char = str[str_index++]; + } + } } } @@ -3923,7 +4006,8 @@ void debug_screen_printl(const char *format, ...) va_start(ap, format); debug_screen_printf(format, ap); - debug_screen_printf("\n"); + debug_screen_newline(1); +// debug_screen_printf("\n"); va_end(ap); }