ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

amigaos-main.cpp

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #include "common/scummsys.h"
00024 
00025 #if defined(__amigaos4__)
00026 
00027 #include "backends/fs/amigaos4/amigaos4-fs.h"
00028 #include "backends/platform/sdl/amigaos/amigaos.h"
00029 #include "backends/plugins/sdl/sdl-provider.h"
00030 #include "base/main.h"
00031 
00032 int main(int argc, char *argv[]) {
00033 
00034     // The following will gather the application name and add the install path
00035     // to a variable in AmigaOS4's ENV(ARC) system. It will be placed in AppPaths
00036     // so that ScummVM can become AmiUpdate aware
00037     const char *const appname = "ResidualVM";
00038 
00039     BPTR lock;
00040     APTR oldwin;
00041 
00042     // Obtain a lock to the home directory
00043     if ((lock = IDOS->GetProgramDir())) {
00044         TEXT progpath[2048];
00045         TEXT apppath[1024] = "AppPaths";
00046 
00047         if (IDOS->DevNameFromLock(lock,
00048             progpath,
00049             sizeof(progpath),
00050             DN_FULLPATH)) {
00051 
00052             // Stop any "Insert volume..." type requesters
00053             oldwin = IDOS->SetProcWindow((APTR)-1);
00054 
00055             // Finally, set the variable to the path the executable was run from
00056             IDOS->AddPart( apppath, appname, 1024);
00057             IDOS->SetVar( apppath, progpath, -1, GVF_GLOBAL_ONLY|GVF_SAVE_VAR );
00058 
00059             // Turn system requesters back on
00060             IDOS->SetProcWindow( oldwin );
00061         }
00062     }
00063 
00064     // Set up a stack cookie to avoid crashes from a stack set too low
00065     static const char *stack_cookie __attribute__((used)) = "$STACK: 600000";
00066 
00067     // Create our OSystem instance
00068     g_system = new OSystem_AmigaOS();
00069     assert(g_system);
00070 
00071     // Pre initialize the backend
00072     ((OSystem_AmigaOS *)g_system)->init();
00073 
00074 #ifdef DYNAMIC_MODULES
00075     PluginManager::instance().addPluginProvider(new SDLPluginProvider());
00076 #endif
00077 
00078     // Invoke the actual ScummVM main entry point
00079     int res = scummvm_main(argc, argv);
00080 
00081     // Free OSystem
00082     g_system->destroy();
00083 
00084     return res;
00085 }
00086 
00087 #endif


Generated on Sat Feb 9 2019 05:00:25 for ResidualVM by doxygen 1.7.1
curved edge   curved edge