notaz.gp2x.de
/
gpsp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup: remove cpu ctrl files, move tests
[gpsp.git]
/
video.c
diff --git
a/video.c
b/video.c
index
e1f749e
..
1240377
100644
(file)
--- a/
video.c
+++ b/
video.c
@@
-93,6
+93,7
@@
SDL_Surface *hw_screen;
#endif
SDL_Surface *screen;
const u32 video_scale = 1;
#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) \
#define get_screen_pixels() \
((u16 *)screen->pixels) \
@@
-3405,10
+3406,20
@@
void flip_screen()
SDL_Rect drect = {40, 40, 240, 160};
SDL_BlitSurface(screen, &srect, hw_screen, &drect);
}
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);
}
else
{
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);
}
#else
SDL_Flip(screen);
}
#else
SDL_Flip(screen);
@@
-3669,11
+3680,18
@@
void video_resolution_small()
current_scale = screen_scale;
#ifdef GP2X_BUILD
current_scale = screen_scale;
#ifdef GP2X_BUILD
+ int w, h;
SDL_FreeSurface(screen);
SDL_GP2X_AllowGfxMemory(NULL, 0);
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 *
screen = SDL_CreateRGBSurface(SDL_HWSURFACE,
small_resolution_width * video_scale, small_resolution_height *
@@
-3764,7
+3782,7
@@
void print_string_ext(const char *str, u16 fg_color, u16 bg_color,
/* EDIT */
/* EDIT */
- if(y + FONT_HEIGHT >
=
resolution_height)
+ if(y + FONT_HEIGHT > resolution_height)
return;
while(current_char)
return;
while(current_char)
@@
-3808,8
+3826,13
@@
void print_string_ext(const char *str, u16 fg_color, u16 bg_color,
str_index++;
}
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++];
+ }
+ }
}
}
}
}
@@
-3919,7
+3942,8
@@
void debug_screen_printl(const char *format, ...)
va_start(ap, format);
debug_screen_printf(format, ap);
va_start(ap, format);
debug_screen_printf(format, ap);
- debug_screen_printf("\n");
+ debug_screen_newline(1);
+// debug_screen_printf("\n");
va_end(ap);
}
va_end(ap);
}