home *** CD-ROM | disk | FTP | other *** search
/ M.u.C.S. Disc 2000 / MUCS2000.iso / falcon / gamefix / mini2.c < prev    next >
C/C++ Source or Header  |  1995-04-30  |  2KB  |  72 lines

  1. /***********************************************/
  2. /* Modulname      : MINI1.C                    */
  3. /* Autor          : Thomas Binder              */
  4. /* Zweck:         : Miniprogramm, das aus      */
  5. /*                  GAMEFIX heraus gespeichert */
  6. /*                  werden kann und wie "OK/   */
  7. /*                  Booten" wirkt, also einen  */
  8. /*                  "Magic Pack" im Speicher   */
  9. /*                  anlegt und dann einen      */
  10. /*                  Reset auslöst.             */
  11. /* Compiler       : Pure C 1.0                 */
  12. /* Erstellt am    : 28.08.1993                 */
  13. /* Letzte Änderung: 03.09.1993                 */
  14. /***********************************************/
  15.  
  16. #include <tos.h>
  17. #include <aes.h>
  18. #include <portab.h>
  19. #include <falcon.h>
  20. #include <string.h>
  21. #include "gamefix.h"
  22.  
  23. /* Prototypen */
  24. LONG set(void);
  25.  
  26. /* Globale Variablen */
  27. extern WORD mtype;
  28. char loadprogram[129] = "\x0\x0\xab\xce";
  29. char commandline[] = "";
  30.  
  31. LONG main(void)
  32. {
  33.     char    stdpath[129],
  34.             *backslash;
  35.     
  36.     /* Programm beenden, wenn die alte Bild- */
  37.     /* schirmadresse aktiviert werden soll, */
  38.     /* aber kein ST-Kompatibilitäsmodus aktiv */
  39.     /* ist */
  40.     if (settings[_SCRBASE])
  41.         if (!(Vsetmode(-1) & STMODES))
  42.             return(0L);
  43.     /* Welcher Monitor ist dran? */
  44.     mtype = mon_type();
  45.     /* Einstellroutine aufrufen */
  46.     Supexec(set);
  47.     /* Soll ein Programm nachgeladen werden? */
  48.     if (loadprogram[0])
  49.     {
  50.         /* Wenn ja, dessen Pfad zum aktuellen */
  51.         /* machen */
  52.         if (loadprogram[1] == ':')
  53.         {
  54.             Dsetdrv((WORD)loadprogram[0] - 65);
  55.             strcpy(stdpath, &loadprogram[2]);
  56.         }
  57.         else
  58.             strcpy(stdpath, loadprogram);
  59.         if ((backslash = strrchr(stdpath, '\\'))
  60.             != 0L)
  61.         {
  62.             backslash[1] = 0;
  63.         }
  64.         Dsetpath(stdpath);
  65.         /* Programm laden & ausführen */
  66.         return(Pexec(0, loadprogram, commandline,
  67.             0L));
  68.     }
  69.     return(0L);
  70. }
  71. /* Modulende */
  72.