home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************/
- /* ScreenMode */
- /******************************************************************************/
-
- /* Version 1.2 written 7.10.1991 by McTendy */
- /* Compiler: Aztec C 5.0d */
- /* You need OS2.0-includes (or higher) */
-
- #include <functions.h>
- #include <graphics/gfxbase.h>
- #include <exec/execbase.h>
-
- struct GfxBase *GfxBase;
-
- main(ArgC,ArgV)
- int ArgC;
- char *ArgV[];
- {
- char arg;
-
- puts("ScreenMode 1.2");
- puts("written 1991 by Mc Tendy");
- puts("This program changes some parameters in the GfxBase, so that");
- puts("all customscreens are opened either in PAL- or NTSC-mode.");
- puts("Runs only under Kickstart V36+.\n");
-
- if(!(GfxBase = (struct GfxBase*)OpenLibrary((UBYTE*)"graphics.library",36))) { puts("Needs graphics.library V36+"); exit(10); }
-
- if(ArgC > 2)
- {
- Help();
- CloseLibrary((struct Library*)GfxBase);
- exit(0);
- }
-
- if(ArgC > 1)
- arg = ArgV[1][0];
- else
- arg = (GfxBase->monitor_id == REQUEST_NTSC)?'p':'n'; /* change modes if no argument */
-
- switch(arg)
- {
- case 'n':
- case 'N':
- GfxBase->DisplayFlags = NTSC;
- GfxBase->monitor_id = REQUEST_NTSC;
- GfxBase->NormalDisplayRows = 240;
- puts("NTSC-Patch installed");
- break;
- case 'p':
- case 'P':
- GfxBase->DisplayFlags = PAL;
- GfxBase->monitor_id = REQUEST_PAL;
- GfxBase->NormalDisplayRows = 282;
- puts("PAL-Patch installed");
- break;
- default:
- Help();
- }
-
- CloseLibrary((struct Library*)GfxBase);
- exit(0);
- }
-
- Help()
- {
- puts("Type ScreenMode NTSC to install NTSC-mode");
- puts("Type ScreenMode PAL to install PAL-mode");
- puts("Type ScreenMode to change between NTSC and PAL-mode");
- }
-