Resolution Of Tv Out


kouky

Member
Joined
Sep 3, 2006
Messages
185
Location
London
Website
www.caou.org
Hi there,

I'm trying to get the TV out resolution higher than 320x240 to get more details when playing on TV screen.

I'm wishing to change the resolution of the main SDL surface from 320x240 to 640x480 when display is switched to TV, but can make it work... just freeze on black screen

Code:
#ifndef _HOST_
FB_TVCONF tv_cfg;
#endif

screen = SDL_SetVideoMode(320, 240, 16, SDL_SWSURFACE);

void goPal()
{
    #ifndef _HOST_
    tv_cfg.command = COMMAND_COMMONVIEW;
    tv_cfg.tv_mode = MES_DPC_VBS_PAL_BGHI;
    tv_cfg.SecScreenWidth = 640;
    tv_cfg.SecScreenHeight = 480;
    SDL_TvConfig(&tv_cfg);

    #endif _HOST_

}

So far it's fine and running on tv at normal resolution, but if i add those lines after switching to tv out, then it freezes

Code:
    SDL_FreeSurface(screen[0]);
    screen = SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE);

Any hints?
 
I'm just curious, is the TV out on the Caanoo a 480i signal, or a 240p signal, when in 320x240? Cause if it's 240p I much prefer that actually for classic games, makes it look better. And for 640x480, 480i would be more appropriate.

I have right now, only LCD monitors which don't ID what the sync is. My Sony PVM production monitor is in the car, so I can't use it right now to test the signal (cause that will tell me everything, and being a CRT, you can just notice it clearly).
 
I'm not certain how the tvout on the caanoo works, but i did make games with options for tv out on the gp2x, 640x480 is not a valid resolution if i'm not mistaken, i even had options to counteract overscan by centering the image on the television and not using the whole surface to blit things on. I do remember that gp2x had "special sdl lib" made by paeryn that had modifications for tv out so i don't know what it did under the hood.

try reading some docs if availible on the chip for tv out or try setting resolution to 720x576 (640x480 fits into 720x576 so make a temporary 640x480 buffer and blit that buffer on the 720x576 in the middle). There are other things you can try like using SDL_GetLastError to know the error OR make sure your in tv out mode and try to use the SDL functions that give information on the availible screen resolutions, that way you know your not using the wrong values for set video mode

On the game(s) aspect i also used 640x480 and i had made a simple (upscale x 2) function for my graphics that i ran on the graphics while loading depending if the gp2x was in tv out mode or not the same logic can be applied for tv out for the caanoo. The upscale function just doubles each pixel and repeats a line of pixels. You can also use the rotozoom functions but you can not use it in real time for upscaling your 320x240 video screen image that would be way to slow, just make your game logic so that it allows the values to be multiplied with say like *2 (640x480) * 3 (960*720) etc. You can use the same functions for windows / linux desktop builds and use *4 then for 1024x960 resolution (that's how i did it with my games and porting them)
 
Thank you for the sugestions Joyrider, I will try that.

My ultimate dream would be to have a 640x480 surface displayed on TV while having a 320x240 surface with different content displayed on the LCD screen, but that might be too much to ask for the Caanoo...
 
kouky said:
Thank you for the sugestions Joyrider, I will try that.

My ultimate dream would be to have a 640x480 surface displayed on TV while having a 320x240 surface with different content displayed on the LCD screen, but that might be too much to ask for the Caanoo...

I think if the caanoo works the same as the gp2x regarding tv out the lcd display will be turned off, i'm not certain if both could be turned on at the same time but i guess not unless with some hacking perhaps driver hacking i might be wrong though
 
Last edited by a moderator:
Back
Top