From: Shamus Hammons Date: Tue, 11 Nov 2003 05:07:33 +0000 (+0000) Subject: Changes to accomodate PAL/NTSC screen heights X-Git-Tag: 1.0.7~84 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0530264688efd52086a1382568f4d13b4281316;p=virtualjaguar Changes to accomodate PAL/NTSC screen heights --- diff --git a/src/include/video.h b/src/include/video.h index 2d8a91c..2d9cafe 100644 --- a/src/include/video.h +++ b/src/include/video.h @@ -6,7 +6,8 @@ #define __VIDEO_H__ #define VIRTUAL_SCREEN_WIDTH 320 -#define VIRTUAL_SCREEN_HEIGHT 240 +#define VIRTUAL_SCREEN_HEIGHT_NTSC 240 +#define VIRTUAL_SCREEN_HEIGHT_PAL 256 bool InitVideo(void); void VideoDone(void); diff --git a/src/tom.cpp b/src/tom.cpp index 7f425b9..0757601 100644 --- a/src/tom.cpp +++ b/src/tom.cpp @@ -359,7 +359,7 @@ render_xxx_scanline_fn * scanline_render_stretch[]= render_xxx_scanline_fn * scanline_render[8]; -// Screen info for various games... +// Screen info for various games [NTSC]... /* Doom TOM: Horizontal Display End written by M68K: 1727 @@ -970,8 +970,9 @@ uint32 tom_getVideoModeHeight(void) // return (vbb - vbe) >> 1; // Again, doesn't take interlacing into account... // This of course doesn't take interlacing into account. But I haven't seen any // Jaguar software that takes advantage of it either... -//Also, doesn't reflect PAL Jaguar either... !!! FIX !!! - return 240; // Set virtual screen height to 240 lines... +//Also, doesn't reflect PAL Jaguar either... !!! FIX !!! [DONE] +// return 240; // Set virtual screen height to 240 lines... + return (vjs.hardwareTypeNTSC ? 240 : 256); } // @@ -980,8 +981,6 @@ uint32 tom_getVideoModeHeight(void) // void tom_reset(void) { -// extern bool hardwareTypeNTSC; - op_reset(); blitter_reset(); //This should be done by JERRY! pcm_reset(); diff --git a/src/video.cpp b/src/video.cpp index cd214e0..ffeee21 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -58,9 +58,9 @@ bool InitVideo(void) mainSurfaceFlags |= SDL_FULLSCREEN; if (!vjs.useOpenGL) - mainSurface = SDL_SetVideoMode(VIRTUAL_SCREEN_WIDTH, VIRTUAL_SCREEN_HEIGHT, 16, mainSurfaceFlags); + mainSurface = SDL_SetVideoMode(VIRTUAL_SCREEN_WIDTH, VIRTUAL_SCREEN_HEIGHT_NTSC, 16, mainSurfaceFlags); else - mainSurface = SDL_SetVideoMode(VIRTUAL_SCREEN_WIDTH * 2, VIRTUAL_SCREEN_HEIGHT * 2, 16, mainSurfaceFlags); + mainSurface = SDL_SetVideoMode(VIRTUAL_SCREEN_WIDTH * 2, VIRTUAL_SCREEN_HEIGHT_NTSC * 2, 16, mainSurfaceFlags); if (mainSurface == NULL) { @@ -71,7 +71,7 @@ bool InitVideo(void) SDL_WM_SetCaption("Virtual Jaguar", "Virtual Jaguar"); // Create the primary SDL display (16 BPP, 5/5/5 RGB format) - surface = SDL_CreateRGBSurface(SDL_SWSURFACE, VIRTUAL_SCREEN_WIDTH, VIRTUAL_SCREEN_HEIGHT, + surface = SDL_CreateRGBSurface(SDL_SWSURFACE, VIRTUAL_SCREEN_WIDTH, VIRTUAL_SCREEN_HEIGHT_NTSC, 16, 0x7C00, 0x03E0, 0x001F, 0); if (surface == NULL) @@ -82,6 +82,7 @@ bool InitVideo(void) if (vjs.useOpenGL) //Should make another setting here, for either linear or nearest (instead of just picking one) +//And we have! ;-) sdlemu_init_opengl(surface, 1/*method*/, 2/*size*/, vjs.glFilter/*texture type (linear, nearest)*/); // Initialize Joystick support under SDL @@ -108,7 +109,7 @@ bool InitVideo(void) //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)); + memset(backbuffer, 0x44, VIRTUAL_SCREEN_WIDTH * VIRTUAL_SCREEN_HEIGHT_NTSC * sizeof(int16)); return true; }