[comp.sys.amiga.programmer] A3000/PAL

mike@zorch.SF-Bay.ORG (Mike Smithwick) (06/28/91)

[]

How can I detect if I am on an A3000 set to PAL mode. It seems like 
GfxBase->DisplayFlags does not reflect this. 

mike


-- 
"There is no problem too big that can't be solved with high explosives"-Rush

Mike Smithwick - ames!zorch!mike

jpotter@ucs.adelaide.edu.au (Jonathan Potter) (06/28/91)

In article <1991Jun27.203040.13870@zorch.SF-Bay.ORG> mike@zorch.SF-Bay.ORG (Mike Smithwick) writes:
>[]
>
>How can I detect if I am on an A3000 set to PAL mode. It seems like
>GfxBase->DisplayFlags does not reflect this.

Another way to do it is to check the PowerSupplyFrequency and VBlankFrequency
fields of the ExecBase structure (i think they're called that). If they're
50Hz, you're PAL, if they're 60Hz, you're NTSC. If one is 50 and one is 60,
then you have an NTSC sized screen on a PAL system (this bug under 1.3 and
less occurs every so often).

Jon
-- 
| Jon Potter      |                              | I'd really like to      |
| P.O. Box 289    | jpotter@itd.adelaide.edu.au  |   change the world...   |
| Goodwood, SA    | FidoNet : 3:680/829          | But they won't give me  |
| Australia  5034 |                              |   the source code.      |

peter@cbmvax.commodore.com (Peter Cherna) (06/28/91)

In article <1991Jun27.203040.13870@zorch.SF-Bay.ORG> mike@zorch.SF-Bay.ORG (Mike Smithwick) writes:
>[]
>
>How can I detect if I am on an A3000 set to PAL mode. It seems like 
>GfxBase->DisplayFlags does not reflect this. 

GfxBase->DisplayFlags represents whether the HW is PAL or not.  (Under
ECS Agnus, you can have the HW set either way; it's a jumper-post on
the A3000 and a jumper-pad on A2000's & A500's).

An NTSC machine with the Workbench in PAL mode is not the same as a
PAL-jumpered machine.  It actually wouldn't be possible to change the
software's view of the jumper on the fly.

You can look at the Workbench's screen mode like this:


	/* A buffer to hold property-information about a mode */
	struct DisplayInfo dispinfo;

	/* Default to the hardware jumper setting: */
	isPAL = GfxBase->DisplayFlags & PAL;

	/* Find Workbench screen */
	wbsc = LockPubScreen( "Workbench" );
	/* Figure out the mode of the screen */
	modeID = GetVPModeID( &wbsc->ViewPort );
	UnlockPubScreen( NULL, wbsc );

	/* Find out about the properties of this mode */
	if ( GetDisplayInfoData( NULL, &dispinfo, sizeof( struct DisplayInfo ),
	    DTAG_DISP, modeID )
	{
	    /* Override based on the Workbench screen mode */
	    isPAL = dispinfo.PropertyFlags & DIPF_IS_PAL;
	}

>mike

     Peter
--
Peter Cherna, Operating Systems Development Group, Commodore-Amiga, Inc.
{uunet|rutgers}!cbmvax!peter    peter@cbmvax.commodore.com
My opinions do not necessarily represent the opinions of my employer.
"Gosh, didn't he have anything positive to say at all?"