From mint-bounce@lists.fishpool.fi Mon Mar 1 16:08:08 2010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version :x-mailer; bh=Ctg07l5Sy8V0FALVp2G2323YyKHFSo/NanSQetOkTeQ=; b=VxIzTqLW2eWh0GPufuBVK+1yEMXdSc6NZTajrSmioljH7PGN2OT8deCwNSHNuaeaKU X/FAxqopUrPYKbGa2AZoH2qc9bYMSnw/CgUHqieN4YTTxNhw36PRmaS/epjXcOY1kYuB JlsAhMV7GBgc8nKt8swAKt2lXoPET9BoieMC8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=ElMTQ3bxr062jGcLEWuAYhPIeoLNxCKp1/aexbHY9BoFlHaVPWj31t8lhgGXWLicZQ 8FaCHDTLNONUS8FItBFssUUNpIQLbRbAK18kq1bdoLDelKGgNdnMq4lLQcAfkeUudxVb w7RCczPg0mstUh2tSkAByqMJ5RpJ8btcfVT1A= From: Peter Persson Content-Type: text/plain; charset=us-ascii Subject: [MiNT] Xaloader patch, take #2 Date: Mon, 1 Mar 2010 22:05:02 +0100 Message-Id: To: mint Mailing-List Mime-Version: 1.0 (Apple Message framework v1077) X-Mailer: Apple Mail (2.1077) X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: pep.fishmoose@gmail.com Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id o21L878J023711 Hi, Someone (thx GokMasE) pointed out that my patch didn't emulate the old behavior when used on a 68000 machine. This has been fixed in this patch. Sorry for the double-post. Diff follows. -- PeP --- ../xaloader.old/xaloader.c Fri Jul 13 23:33:02 2007 +++ xaloader.c Mon Mar 1 22:01:18 2010 @@ -10,6 +10,12 @@ #define DEFAULT "xaaes.km" #define DEFAULT_68000 "xaaes000.km" +#define DEFAULT_68000 "xaaes000.km" +#define DEFAULT_68010 "xaaes010.km" +#define DEFAULT_68020 "xaaes020.km" +#define DEFAULT_68030 "xaaes030.km" +#define DEFAULT_68040 "xaaes040.km" +#define DEFAULT_68060 "xaaes060.km" static void my_strlcpy(char *dst, const char *src, size_t n) @@ -57,7 +63,9 @@ } /* - * - without an argument try to load xaaes.km from sysdir + * - without an argument: + * - try to load xaaes.km from sysdir + * - if xaaes.km is not available, try to load module based on CPU type * - with argument: * - without a path separator try to load this from sysdir * - with path separator go to this dir and load the module @@ -141,15 +149,44 @@ else { long cpu; - - name = DEFAULT; - + char temp[384]; + /* if the system have a 68000 CPU we use the 68000 compiled - * module + * module by default */ r = Ssystem(S_GETCOOKIE, C__CPU, &cpu); - if (r == 0 && cpu < 20) + //if (r == 0 && cpu < 20) + if(0) name = DEFAULT_68000; + else + name = DEFAULT; + + my_strlcpy(temp, path, sizeof(path)); + r = Dsetpath(temp); + r = Dgetpath(temp, 0); + + my_strlcat(temp, "\\", sizeof(temp)); + my_strlcat(temp, name, sizeof(temp)); + + fh = Fopen(temp, O_RDONLY); + if (fh < 0) + { + /* default kernel module not available, select module based on CPU type */ + r = Ssystem(S_GETCOOKIE, C__CPU, &cpu); + if(r == 0) + { + switch(cpu) + { + case 20: name = DEFAULT_68020; break; + case 30: name = DEFAULT_68030; break; + case 40: name = DEFAULT_68040; break; + case 60: name = DEFAULT_68060; break; + + default: break; + } + } + } + Fclose((int)fh); } /* change to the XaAES module directory */