X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvideo.cpp;h=601fc307c9cb6b34e9165cff708e7c68548db11c;hb=a1ad40785ac6d954051e4e5882436da9a58cc3a6;hp=1df9fca1e15627bfd619bfb8fb77dbf810729130;hpb=824222a5bc2a86fdef6763104fc0f48b8972cfbe;p=virtualjaguar diff --git a/src/video.cpp b/src/video.cpp index 1df9fca..601fc30 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -13,10 +13,11 @@ // External global variables //shouldn't these exist here??? Prolly. -extern SDL_Surface * surface, * mainSurface; -extern Uint32 mainSurfaceFlags; -extern int16 * backbuffer; -extern SDL_Joystick * joystick; +//And now, they do! :-) +SDL_Surface * surface, * mainSurface; +Uint32 mainSurfaceFlags; +int16 * backbuffer; +SDL_Joystick * joystick; // // Prime SDL and create surfaces @@ -102,6 +103,12 @@ bool InitVideo(void) } } + // Set up the backbuffer +//To be safe, this should be 1280 * 625 * 2... +// backbuffer = (int16 *)malloc(845 * 525 * sizeof(int16)); + backbuffer = (int16 *)malloc(1280 * 625 * sizeof(int16)); + memset(backbuffer, 0x44, VIRTUAL_SCREEN_WIDTH * VIRTUAL_SCREEN_HEIGHT * sizeof(int16)); + return true; } @@ -117,6 +124,8 @@ void VideoDone(void) SDL_FreeSurface(surface); SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_TIMER); SDL_Quit(); + + free(backbuffer); } //