home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / screenmo.lzh / ScreenMode / ScreenMode.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-08  |  1.8 KB  |  71 lines

  1. /******************************************************************************/
  2. /*                                ScreenMode                                  */
  3. /******************************************************************************/
  4.  
  5. /* Version 1.2 written 7.10.1991 by McTendy */
  6. /* Compiler: Aztec C 5.0d                   */
  7. /* You need OS2.0-includes (or higher)      */
  8.  
  9. #include <functions.h>
  10. #include <graphics/gfxbase.h>
  11. #include <exec/execbase.h>
  12.  
  13. struct GfxBase         *GfxBase;
  14.  
  15. main(ArgC,ArgV)
  16. int ArgC;
  17. char *ArgV[];
  18. {
  19.     char arg;
  20.  
  21.     puts("ScreenMode 1.2");
  22.     puts("written 1991 by Mc Tendy");
  23.     puts("This program changes some parameters in the GfxBase, so that");
  24.     puts("all customscreens are opened either in PAL- or NTSC-mode.");
  25.     puts("Runs only under Kickstart V36+.\n");
  26.  
  27.     if(!(GfxBase       = (struct GfxBase*)OpenLibrary((UBYTE*)"graphics.library",36))) { puts("Needs graphics.library V36+"); exit(10); }
  28.  
  29.     if(ArgC > 2)
  30.     {
  31.         Help();
  32.         CloseLibrary((struct Library*)GfxBase);
  33.         exit(0);
  34.     }
  35.  
  36.     if(ArgC > 1)
  37.         arg = ArgV[1][0];
  38.     else
  39.         arg = (GfxBase->monitor_id == REQUEST_NTSC)?'p':'n';  /* change modes if no argument */
  40.  
  41.     switch(arg)
  42.     {
  43.     case 'n':
  44.     case 'N':
  45.         GfxBase->DisplayFlags = NTSC;
  46.         GfxBase->monitor_id = REQUEST_NTSC;
  47.         GfxBase->NormalDisplayRows = 240;
  48.         puts("NTSC-Patch installed");
  49.         break;
  50.     case 'p':
  51.     case 'P':
  52.         GfxBase->DisplayFlags = PAL;
  53.         GfxBase->monitor_id = REQUEST_PAL;
  54.         GfxBase->NormalDisplayRows = 282;
  55.         puts("PAL-Patch installed");
  56.         break;
  57.     default:
  58.         Help();
  59.     }
  60.  
  61.     CloseLibrary((struct Library*)GfxBase);
  62.     exit(0);
  63. }
  64.  
  65. Help()
  66. {
  67.     puts("Type ScreenMode NTSC to install NTSC-mode");
  68.     puts("Type ScreenMode PAL  to install PAL-mode");
  69.     puts("Type ScreenMode to change between NTSC and PAL-mode");
  70. }
  71.