- ret = osdl_video_set_mode(pdata, width, height, bpp,
- (flags & SDL_DOUBLEBUF) ? 1 : 0);
- if (ret < 0)
+ if (pdata->border_l | pdata->border_r | pdata->border_t | pdata->border_b) {
+ if (pdata->border_l + pdata->border_r >= width
+ || pdata->border_t + pdata->border_b >= height)
+ {
+ err("specified border too large, ignoring");
+ pdata->border_l = pdata->border_r = pdata->border_t = pdata->border_b = 0;
+ }
+ }
+
+ fbmem = osdl_video_set_mode(pdata,
+ pdata->border_l, pdata->border_r, pdata->border_t, pdata->border_b,
+ width, height, bpp, (flags & SDL_DOUBLEBUF) ? 1 : 0);
+ if (fbmem == NULL) {
+ log("failing on mode %dx%d@%d, doublebuf %s",
+ width, height, bpp, (flags & SDL_DOUBLEBUF) ? "on" : "off");