]> Shamusworld >> Repos - virtualjaguar/commitdiff
Changes to accomodate PAL/NTSC screen heights
authorShamus Hammons <jlhamm@acm.org>
Tue, 11 Nov 2003 05:07:33 +0000 (05:07 +0000)
committerShamus Hammons <jlhamm@acm.org>
Tue, 11 Nov 2003 05:07:33 +0000 (05:07 +0000)
src/include/video.h
src/tom.cpp
src/video.cpp

index 2d8a91c0bf0e82f92668edb20070fd5207373132..2d9cafeca4800a1bf68ca73828d98eb1258fee4b 100644 (file)
@@ -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);
index 7f425b9e6990af913c8c3d0994e528a58217e8f8..0757601f732e920a05be5c45576cddb19029d7db 100644 (file)
@@ -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();
index cd214e069d9d26c0bda4b94a194caa2d7d6cadc6..ffeee21d0e70139820954f489fc358fad5f46a58 100644 (file)
@@ -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;
 }