English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 26 June 2022, 10:13   #1
dalton
tulou
 
dalton's Avatar
 
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 88
Programatically open NTSC screen on PAL amiga

Hi,

I know it's possible to switch between PAL and NTSC using the BEAMCON0 register. But I want to try to do system-friendly software. Is it possible to choose when you open a screen with Intuition's `OpenScreen` whether it should be PAL or NTSC?

Cheers
dalton is offline  
Old 26 June 2022, 11:25   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,214
Certainly - pick the right mode ID. The ones for PAL derive from the PAL monitor, the ones for NTSC for the NTSC monitor. The corresponding monitor masks (upper 16 bits of the 32-bit mode ID) you find in <graphics/modeid.h>, in particular

Code:
#define NTSC_MONITOR_ID                 0x00011000
#define PAL_MONITOR_ID                  0x00021000
However, a better approach would be to allow the user select a mode ID, e.g. by an ASL-ScreenMode requester.
Thomas Richter is offline  
Old 26 June 2022, 11:50   #3
dalton
tulou
 
dalton's Avatar
 
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 88
Ah! Does this go in the `ViewModes` property of `struct NewScreen`?

The pixel aspect ratio is very important for my application, and it's a screen saver so a requester on start is not really an option. Maybe I can work something out with tooltypes to make the mode user-configurable.
dalton is offline  
Old 26 June 2022, 12:52   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
ViewMode is a 16bit UWORD, it cannot hold these values.

You have to supply a TagList with the SA_DisplayID tag.

A TagList can be provided by a struct ExtNewScreen or by the use of the OpenScreenTagList function.
thomas is offline  
Old 26 June 2022, 13:32   #5
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,214
Quote:
Originally Posted by dalton View Post
The pixel aspect ratio is very important for my application, and it's a screen saver so a requester on start is not really an option. Maybe I can work something out with tooltypes to make the mode user-configurable.

The problem with a fixed monitor ID is that you do not even know whether the mode you selected is available, or if available, even displayable on the monitor of your user. For example, the user may have a VGA monitor attached to a graphics card, and 15kHz modes like NTSC may not even be visible by this monitor, or whether this is an OCS PAL machine without the ability to generate NTSC.



The best you can do is to use the same mode as the workbench (as this is clearly available and visible), and then scale the graphics of your application. Or, as said, use an ASL requester, and filter upfront by the aspect ratio. The pixel aspect ratio is included in the DisplayInfo structure, see <graphics/displayinfo.h>:


Code:
struct DisplayInfo
{
        struct  QueryHeader Header;
        UWORD   NotAvailable;   /* if NULL available, else see defines */
        ULONG   PropertyFlags;  /* Properties of this mode see defines */
        Point   Resolution;     /* ticks-per-pixel X/Y                 */
        UWORD   PixelSpeed;     /* aproximation in nanoseconds         */
        UWORD   NumStdSprites;  /* number of standard amiga sprites    */
        UWORD   PaletteRange;   /* OBSOLETE - use Red/Green/Blue bits instead */
        Point   SpriteResolution; /* std sprite ticks-per-pixel X/Y    */
        UBYTE   pad[4];         /* used internally */
        UBYTE   RedBits;        /* number of Red bits this display supports (V39) */
        UBYTE   GreenBits;      /* number of Green bits this display supports (V39) */
        UBYTE   BlueBits;       /* number of Blue bits this display supports (V39) */
        UBYTE   pad2[5];        /* find some use for this. */
        ULONG   reserved[2];    /* terminator */
};
In particular, the "Resolution" field is what you are after. It is not a "resolution", though, but a size of the pixels (larger values mean larger pixel dimensions). If Resolution.X is approximately equal to Resolution.Y, then you have approximately square pixels.


Note, however, that NTSC (lo-res, hi-res interlace) pixels are (in reality) not exactly square, even though the database says so.
Thomas Richter is offline  
Old 28 June 2022, 04:37   #6
Bruce Abbott
Registered User
 
Bruce Abbott's Avatar
 
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
Quote:
Originally Posted by dalton View Post
The pixel aspect ratio is very important for my application, and it's a screen saver
Screen saver graphics are by definition not very important.

The user may not appreciate you changing the screen mode to a scan rate that their monitor cannot handle. For example I have an A600 with Vampire RTG and nothing connected to the composite or RGB ports. Furthermore my TV is set up to not scale HDMI input, and it can't handle many of the Vampire's standard scan rates, so the only safe choice is to clone the Workbench screen.

It sucks to not have control over what screen modes you can use, but that's the price we pay for having the flexibility of hardware that is not tightly controlled. Even modern PC apps can have the same problem. We bought a Hewlett Packard Tablet as a replacement for our Windows 7 laptop to run our drone app. Turned out to be useless because the tablet is stuck on a ludicrously high resolution that cannot be changed, and Windows 10 can scale text but not graphics so the buttons were too small to operate on the touch screen.

Quote:
Maybe I can work something out with tooltypes to make the mode user-configurable.
Good idea. You might want to put some other options in there too. Even better would be to have the settings stored in a text file in ENV: or S:, and include a preferences editor for easy configuration via the GUI.
Bruce Abbott is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to use a PAL amiga in NTSC Mstone support.Hardware 14 03 October 2018 16:35
How to switch PAL Rev 6A A500 between PAL/NTSC? BarryB support.Hardware 10 03 August 2016 14:41
Amiga 520 PAL or NTSC? grizzlyaddams New to Emulation or Amiga scene 13 30 April 2015 19:51
NTSC A500 Pal/NTSC mod pics kipper2k Hardware pics 2 29 March 2009 07:56
Emulating NTSC KS 1.0 on a PAL Monitor (???, British TFT PC screen) The Rom Alien support.Other 5 09 July 2006 23:03

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:48.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12301 seconds with 13 queries