Path: chuka.playstation.co.uk!news From: "Alex Herbert" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: pmode in GsIMAGE Date: Wed, 10 Mar 1999 21:34:57 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 51 Message-ID: <7c6ovr$cij10@chuka.playstation.co.uk> References: <7ba63i$9po27@chuka.playstation.co.uk> <7bbjm6$abn3@chuka.playstation.co.uk> <7bpst3$l2g1@chuka.playstation.co.uk> <7br8vg$l2g2@chuka.playstation.co.uk> NNTP-Posting-Host: th-usr02-55.ndirect.co.uk X-Newsreader: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Rad wrote in message <7br8vg$l2g2@chuka.playstation.co.uk>... >Actually that's a good question - why are the cases 0x08 and 0x09? >I figured it had something to do with pmode being a signed short and the >playstation's byte ordering being different. > >The only explanation I could come up with is that: >hex bin dec >0x08 = 1000 = 0 >0x09 = 1001 = 1 >and that the playstation interprets the most significant bit as a positive >number. > >Anyone care to explain/correct? > >Thanks, >Rad. >rad@cyberdude.com >http://www.netyaroze-europe.com/~radpsx > Hmm, that doesn't sound right to me. That's not how the sign bit works. Negative numbers have the sign bit set. hex bin dec 0x0 = 0000 = 0 0x0 = 0001 = 1 0x8 = 1000 = -8 0x9 = 1001 = -7 This assumes that this is 4-bit signed, which is a bit odd in itself - the sign is bit 7 of a byte (char), and bit 15 of a short. Anyhow, this toubled me when I first started with the Yaroze. I thought that bit 3 indicated a mixed mode TIM, but I've just looked at the File Formats PDF and that says that it's bit 4. So, I don't know the answer. My solution was: tim.pmode &= 0x0007; just after the call to GsGetTimInfo(). This just masks off all the unwanted bits. Herbs