forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

libgs,video mode and strange behavior.

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
nicp067



Joined: 20 Jan 2004
Posts: 15
Location: Quebec,Canada

PostPosted: Fri Jul 02, 2004 10:18 pm    Post subject: libgs,video mode and strange behavior. Reply with quote

hi, dunno if someone can help me out on this one.

Im trying to draw some stuff on the screen in vga 640x480 mode. Im doing something like:

gsDriver myGsDriver;

myGsDriver.setDisplayMode(640, 480, 68, 35,
GS_PSMCT32, 2, 0x1A, GS_TV_NONINTERLACE,
GS_ENABLE, GS_PSMZ32);

myGsDriver.drawPipe.RectFlat(0, 0, 640, 480, 0, GS_SET_RGBA(0,0xFF,0,0x80));

the thing is on the x axis 1 pixel = 2 pixel on the monitor so everything look 2 time larger. i know that I can specify in DISPLAY1(0x12000080) the horinzontal mag, is that it. and should I do that in gslib?

Thank you
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Sat Jul 03, 2004 4:14 am    Post subject: Reply with quote

Are you telling the PS2 to use NTSC, then telling it to be non-interlaced? If so, it will display only half the lines on the screen since a TV can't do what you ask. You don't usually tell the CRTC how many lines to display so much as tell it what video mode you want, that resolution you specify is for use by the GS to tell it how big a framebuffer to use.

Take a look in a tutorial I have on my site ( http://www.oopo.net/consoledev/files/ps2-doublebuffer.txt ) which explains how to set up different video modes and use them, including VGA (640x480) and HDTV (480p).
Back to top
View user's profile Send private message Visit poster's website
nicp067



Joined: 20 Jan 2004
Posts: 15
Location: Quebec,Canada

PostPosted: Sat Jul 03, 2004 8:36 am    Post subject: Reply with quote

fixed my problem. I should have explained more, I was actually trying to use vga 640x480 60 hertz (0x1a) on a Computer monitor.

for a tv screen you have to set magh on DISPLAY1(0x12000080) and DISPLAY2(0x120000a0) to something like 3 but on the computer monitor it should be 0 or maybe 1? anyway setting it at 0 fixed every thing.

now can someone explain the start position you can set also? I know x and y -5 are fine on a tv but how can you find the proper value for other mode.
for now i just try randomly. on my computer screen x 0 and y 0 put 0,0 coordinate almost in the middle of the screen for x and y is amost right.

Thank you ooPo.
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Sat Jul 03, 2004 8:50 am    Post subject: Reply with quote

Those values are typically dictated by the mode specification itself, but since TVs differ you generally have to let the users adjust it on their own. So... trial and error, but what works for you may not work for all so don't hard code some values in if you can help it.

There's free information on those quirky registers available in the kernel source from ps2linux. Take a look on ps2linux.com and see if you can get a copy of ps2gs.c, I know you can browse the source on that site but I don't remember how to get to it. Also, if you already have the kit, take a look in the gs guide. Its not very informative, but at least it puts names to the values.
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jul 03, 2004 2:58 pm    Post subject: Reply with quote

You get the most info on setting the display registers for modes from the kernel code for PS2 Linux. Just download the kernel source and unpack it. It shows how to set a considerable number of modes directly.
Back to top
View user's profile Send private message AIM Address
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Sat Jul 03, 2004 3:43 pm    Post subject: Reply with quote

The ps2linux kernel source will give you magic numbers, but it won't tell you why you're putting them there. There's better places to get info, but not many are as free to read as the kernel source itself.

What I'd like to know is why you felt it necessary to repeat just what I said, but in a less helpful manner. :)
Back to top
View user's profile Send private message Visit poster's website
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Jul 03, 2004 9:48 pm    Post subject: Reply with quote

The PS2/Linux kernel source is the only place where those magic GS undocumented priveledged registers are used in code. Pro developers are explicitly forbidden from using them directly. There is no other documentation on those registers except inside the secret SCEI laser-guarded defense fortress which may or may not exist.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sun Jul 04, 2004 7:41 am    Post subject: Reply with quote

Well AFAIK the reason they don't tell you what those regs mean is cause it is possible to damage TVs and monitors by setting stupid values. In many respects I think this is rubbish but knowing what things like SMODE1 does is probably not very important anyway :)
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Jul 04, 2004 3:09 pm    Post subject: Reply with quote

Exactly. If you look at the Linux code, you'll see that the undocumented registers are setting the sync timing which has the potential of frying your monitor. I did that to a Commodore monitor about 5 years back... it came up with the video mode - for about 5 seconds, then POP!!! The picture went away and lots of smoke came out of the monitor. Many new monitors are designed to ignore out of range signals, but if they aren't, you can easily blow the monitor using out of range sync. It's not a wonder Sony doesn't want you messing with it. They have certain "safe" values they use with the modes they set, and don't want you doing anything beyond that.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group