comparison src/video/fbcon/SDL_fbvideo.c @ 2669:e27bdcc80744 gsoc2008_nds

First commit. Added header configs for DS as well as a Makefile. Initial work on framebuffer video driver, currently not functioning as desired.
author Darren Alton <dalton@stevens.edu>
date Tue, 10 Jun 2008 06:45:39 +0000
parents 2c835d58faad
children e1da92da346c
comparison
equal deleted inserted replaced
2668:bb3241de289e 2669:e27bdcc80744
321 321
322 if ((*c == '\n') || (*c == '#') || (*c == 0)) 322 if ((*c == '\n') || (*c == '#') || (*c == 0))
323 blank = 1; 323 blank = 1;
324 else 324 else
325 blank = 0; 325 blank = 0;
326 } 326 } while (blank);
327 while (blank);
328 /* remove whitespace at the begining of the string */ 327 /* remove whitespace at the begining of the string */
329 i = 0; 328 i = 0;
330 do { 329 do {
331 line[i] = c[i]; 330 line[i] = c[i];
332 i++; 331 i++;
333 } 332 } while (c[i] != 0);
334 while (c[i] != 0);
335 return 1; 333 return 1;
336 } 334 }
337 335
338 static int 336 static int
339 read_fbmodes_mode(FILE * f, struct fb_var_screeninfo *vinfo) 337 read_fbmodes_mode(FILE * f, struct fb_var_screeninfo *vinfo)
345 do { 343 do {
346 if (read_fbmodes_line(f, line, sizeof(line)) == 0) 344 if (read_fbmodes_line(f, line, sizeof(line)) == 0)
347 return 0; 345 return 0;
348 if (SDL_strncmp(line, "geometry", 8) == 0) 346 if (SDL_strncmp(line, "geometry", 8) == 0)
349 break; 347 break;
350 } 348 } while (1);
351 while (1);
352 349
353 SDL_sscanf(line, "geometry %d %d %d %d %d", &vinfo->xres, &vinfo->yres, 350 SDL_sscanf(line, "geometry %d %d %d %d %d", &vinfo->xres, &vinfo->yres,
354 &vinfo->xres_virtual, &vinfo->yres_virtual, 351 &vinfo->xres_virtual, &vinfo->yres_virtual,
355 &vinfo->bits_per_pixel); 352 &vinfo->bits_per_pixel);
356 if (read_fbmodes_line(f, line, sizeof(line)) == 0) 353 if (read_fbmodes_line(f, line, sizeof(line)) == 0)
392 } else if (SDL_strncmp(line, "double", 6) == 0) { 389 } else if (SDL_strncmp(line, "double", 6) == 0) {
393 SDL_sscanf(line, "double %s", option); 390 SDL_sscanf(line, "double %s", option);
394 if (SDL_strncmp(option, "true", 4) == 0) 391 if (SDL_strncmp(option, "true", 4) == 0)
395 vinfo->vmode |= FB_VMODE_DOUBLE; 392 vinfo->vmode |= FB_VMODE_DOUBLE;
396 } 393 }
397 } 394 } while (SDL_strncmp(line, "endmode", 7) != 0);
398 while (SDL_strncmp(line, "endmode", 7) != 0);
399 395
400 return 1; 396 return 1;
401 } 397 }
402 398
403 static int 399 static int