Path: utzoo!mnetor!uunet!husc6!hao!ames!amdahl!ptsfa!well!shf From: shf@well.UUCP (Stuart H. Ferguson) Newsgroups: comp.sys.amiga Subject: Re: LACE Workbench Message-ID: <5173@well.UUCP> Date: 6 Feb 88 22:59:13 GMT References: <5145@well.UUCP> <5147@well.UUCP> Reply-To: shf@well.UUCP (Stuart H. Ferguson) Organization: The Blue Planet Lines: 63 I (Stuart H. Ferguson) asked: >What's a good (read: fast/simple) way to detect if the Workbench screen is in >interlace mode? I need to do this to compute the aspect ratio for pixels on >*any* Workbench screen. Thanx in advance. Leo ('Bols Ewhac' Schwab) replied [edited]: > > Well, you could do this: > [code fragment to open window and examine Modes flag for ViewPort] > > However, this will probably not be very useful when 1.4 comes out. > If I'm reading Dale's and Jimm's minds correctly, under future >operating systems, you won't be able to make any assumptions about what the >WorkBench screen looks like (case in point: The Hedley (sp?) monitor). > Dale thought of this already, and somewhere in GfxBase are a couple >of variables called NormalDPMX and NormalDPMY. These give the DotsPerMetre >measurements of the screen. You're supposed to calculate aspect ratios from >these. > Exactly how you do that, I have no idea. Dale, could you clear that >up? Personally, I've never understood how those variables worked, >particularly if there are multiple viewports on the screen. Yeah, I use these variables, as well as a couple of fields called NormalDisplayRows and NormalDisplayColumns. On my machine, these fields contain the fixed values: NormalDisplayRows: 200 NormalDisplayColumns: 640 NormalDPMX: 1280 NormalDPMY: 1098 These values do *not* change if I set the Workbench to interlace in preferences and reboot. So "Normal" means a 640 x 200 screen, and the values for other resolution modes are left as an exercize for the programmer. So, if the Workbench is in interlace mode, you have to multiply NormalDisplayRows by 2 to get the correct value. But, the aspect ratio for pixels computed from the measures above is 0.858, which is the aspect ratio for pixels at maximum resolution, i.e. a 640 x 400 screen. Mixed bag, this "Normal" stuff. (BTW this aspect ratio looks better than the one I figured out using a ruler. I recomend it.) Although using these fields lets software adapt to changing hardware, this particular "standard" way of storing the parameters of the monitor could be a problem for programs that run on the Workbench Screen. If a program needs to know the aspect ratio or just the maximum sized window possible, its values will be off by a factor of two if it fails to take in to account that the Workbench is in interlace mode. On the original question -- how to find out if the Workbench is in interlace mode -- I've found that there is a LaceWB field in the Preferences structure, so I'll try reading it out from there. I would like to find out without opening a dummy window, thank you. Part of the point is so I can open a window that fills the screen (minus one or two pixels at the top :-). There are also a couple of fields in the GfxBase called MaxDisplayRow and MaxDisplayColumn with values (again on my machine) of 261 and 465, respectively. Anyone know what these are? -- Stuart Ferguson (shf@well.UUCP) Action by HAVOC (shf@Solar.Stanford.EDU)