X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvideo.cpp;h=4507363cf99c23dd941d0d70a1c1e05d598c272a;hb=731669ecc1eb876e42104a8a4ba49ac00572c020;hp=65a9fdde3f41923a33e74dcc4d7b92d5fa28d938;hpb=307af672917ace9879491388ee55943c4fe03aa1;p=virtualjaguar diff --git a/src/video.cpp b/src/video.cpp index 65a9fdd..4507363 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -4,20 +4,22 @@ // by James L. Hammons // +#include "video.h" + #include "tom.h" #include "sdlemu_opengl.h" #include "settings.h" -#include "video.h" +#include "log.h" // External global variables //shouldn't these exist here??? Prolly. //And now, they do! :-) SDL_Surface * surface, * mainSurface; +SDL_Joystick * joystick; Uint32 mainSurfaceFlags; //int16 * backbuffer; uint32 * backbuffer; -SDL_Joystick * joystick; // One of the reasons why OpenGL is slower then normal SDL rendering, is because // the data is being pumped into the buffer every frame with a overflow as result. @@ -101,8 +103,14 @@ bool InitVideo(void) /* surface = SDL_CreateRGBSurface(SDL_SWSURFACE, VIRTUAL_SCREEN_WIDTH, (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL), 16, 0x7C00, 0x03E0, 0x001F, 0);//*/ + + uint32 vsWidth = VIRTUAL_SCREEN_WIDTH; + + if (vjs.renderType == RT_TV) + vsWidth = 1280; //24BPP - surface = SDL_CreateRGBSurface(SDL_SWSURFACE, VIRTUAL_SCREEN_WIDTH, +// surface = SDL_CreateRGBSurface(SDL_SWSURFACE, VIRTUAL_SCREEN_WIDTH, + surface = SDL_CreateRGBSurface(SDL_SWSURFACE, vsWidth, (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL), 32, #if SDL_BYTEORDER == SDL_BIG_ENDIAN 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); @@ -186,7 +194,10 @@ void RenderBackbuffer(void) SDL_Delay(10); // memcpy(surface->pixels, backbuffer, tom_getVideoModeWidth() * tom_getVideoModeHeight() * 2); - memcpy(surface->pixels, backbuffer, tom_getVideoModeWidth() * tom_getVideoModeHeight() * 4); + if (vjs.renderType == RT_NORMAL) + memcpy(surface->pixels, backbuffer, tom_getVideoModeWidth() * tom_getVideoModeHeight() * 4); + else if (vjs.renderType == RT_TV) + memcpy(surface->pixels, backbuffer, 1280 * tom_getVideoModeHeight() * 4); if (SDL_MUSTLOCK(surface)) SDL_UnlockSurface(surface); @@ -258,14 +269,6 @@ void ResizeScreen(uint32 width, uint32 height) SDL_WM_SetCaption(window_title, window_title); } -// -// Return the screen's pitch -// -/*uint32 GetSDLScreenPitch(void) -{ - return surface->pitch; -}*/ - // // Return the screen's width in pixels //