X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fsdl%2Fmain.c;h=b672ee63da6c20c9354df6af71295d22043d1a83;hb=d54a3962dcb42f9921be75cf3754525ecef2bab6;hp=616b23d3c4c8d1c75b94e78f1c09d4580dbcce32;hpb=5a00ac1b6ff18814600e84e74d4d1e34847e9103;p=eradicate diff --git a/src/sdl/main.c b/src/sdl/main.c index 616b23d..b672ee6 100644 --- a/src/sdl/main.c +++ b/src/sdl/main.c @@ -36,15 +36,15 @@ int main(int argc, char **argv) xsz = FB_WIDTH * fbscale; ysz = FB_HEIGHT * fbscale; - fb_width = xsz; - fb_height = ysz; + fb_width = FB_WIDTH; + fb_height = FB_HEIGHT; fb_size = FB_WIDTH * FB_HEIGHT * FB_BPP / 8; if(!(fb_buf = malloc(fb_size + FB_WIDTH * 4))) { fprintf(stderr, "failed to allocate virtual framebuffer\n"); return 1; } - fb_pixels = (char*)fb_buf + FB_WIDTH * 2; + vmem = fb_pixels = (uint16_t*)((char*)fb_buf + FB_WIDTH * 2); SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_NOPARACHUTE); if(!(fbsurf = SDL_SetVideoMode(xsz, ysz, FB_BPP, sdl_flags))) { @@ -99,6 +99,8 @@ void blit_frame(void *pixels, int vsync) int i, j; unsigned short *sptr, *dptr; + if(show_fps) dbg_fps(pixels); + if(vsync) { wait_vsync(); }