From mint-bounce@lists.fishpool.fi Mon Mar 1 16:37:59 2010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:message-id:references:to :x-mailer; bh=BMsIwlCBffAdrPbvwJjf7dviG4FwRLhIIu5yGKrjUuA=; b=hpRFF5Fsm/Nn5rH42tnr8sA6jTsO9todSe+UTiDR276oVL3AXXiKtoRFycpMM+r+uz ZCWQRTQK29GhISO/jlgVNjt3uvzijvqzbyixVxz+UHvi04k9t4CME6GPFXLIWYC+SnJV 7nE2PcuerEJ6kOGlGsor+vMMHENsigA3HpkYA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=UKEQg0tZgesvVd7LChNrgWjF8RiQI100GcVbtJZw42yXfISzKAfBlSPxj+fLmchf0V AaSwME6y0WKJIj8IJWdF6T+5aZ4tU3X6IkckhfiQc7srZ8DyQg/yBov++lb958pGJiMM CeMeTz4l8cgdfSuJlvKWfeCmFvFrxvnWbqPkY= Subject: Re: [MiNT] Xaloader patch, take #42 Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: multipart/alternative; boundary=Apple-Mail-11--738160288 From: Peter Persson In-Reply-To: Date: Mon, 1 Mar 2010 22:35:32 +0100 Cc: mint Mailing-List Message-Id: <2352BB99-84F9-4D43-943E-FC38037A48C3@gmail.com> References: To: Miro Kropacek 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: --Apple-Mail-11--738160288 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 1 mar 2010, at 22.22, Miro Kropacek wrote: > Btw Pep, in case you aren't tired: >=20 > #define DEFAULT "xaaes.km" > #define DEFAULT_68000 "xaaes000.km" > +#define DEFAULT_68000 "xaaes000.km" > #defining it only once is enough I think :P No, I have no pride left whatsoever :) Yet another diff appended.=20 >=20 > --=20 > MiKRO / Mystic Bytes > http://mikro.atari.org --- ../xaloader.old/xaloader.c Fri Jul 13 23:33:02 2007 +++ xaloader.c Mon Mar 1 22:34:02 2010 @@ -10,6 +10,10 @@ =20 #define DEFAULT "xaaes.km" #define DEFAULT_68000 "xaaes000.km" +#define DEFAULT_68020 "xaaes020.km" +#define DEFAULT_68030 "xaaes030.km" +#define DEFAULT_68040 "xaaes040.km" +#define DEFAULT_68060 "xaaes060.km" =20 static void my_strlcpy(char *dst, const char *src, size_t n) @@ -57,7 +61,9 @@ } =20 /* - * - 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 +147,43 @@ else { long cpu; - =09 - name =3D DEFAULT; - =09 + char temp[384]; + /* if the system have a 68000 CPU we use the 68000 = compiled - * module + * module by default */ r =3D Ssystem(S_GETCOOKIE, C__CPU, &cpu); if (r =3D=3D 0 && cpu < 20) name =3D DEFAULT_68000; + else + name =3D DEFAULT; + =09 + my_strlcpy(temp, path, sizeof(path)); + r =3D Dsetpath(temp); + r =3D Dgetpath(temp, 0); + =09 + my_strlcat(temp, "\\", sizeof(temp)); + my_strlcat(temp, name, sizeof(temp)); + =09 + fh =3D Fopen(temp, O_RDONLY); + if (fh < 0) + { + /* default kernel module not available, select = module based on CPU type */ + r =3D Ssystem(S_GETCOOKIE, C__CPU, &cpu); + if(r =3D=3D 0) + { + switch(cpu) + { + case 20: name =3D = DEFAULT_68020; break; + case 30: name =3D = DEFAULT_68030; break; + case 40: name =3D = DEFAULT_68040; break; + case 60: name =3D = DEFAULT_68060; break; + =09 + default: break; + } + } + } + Fclose((int)fh); } =20 /* change to the XaAES module directory */ --Apple-Mail-11--738160288 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Btw Pep, = in case you aren't tired:

 #define DEFAULT   =      "xaaes.km"
 #define DEFAULT_68000 =  "xaaes000.km"
+#define DEFAULT_68000  "xaaes000.km"
#defining it only once is enough I think = :P

No, I have no pride = left whatsoever :) Yet another diff appended. 


--
MiKRO / Mystic Bytes
http://mikro.atari.org


--- = ../xaloader.old/xaloader.c Fri Jul 13 23:33:02 = 2007
+++ xaloader.c Mon Mar  1 22:34:02 = 2010
@@ -10,6 +10,10 = @@
 
 #define DEFAULT       =  "xaaes.km"
 #define DEFAULT_68000 =  "xaaes000.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 +61,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 = +147,43 @@
  else
  = {
  long = cpu;
- =
- name =3D = DEFAULT;
-
+ = char temp[384];
+
  = /* if the system have a 68000 CPU we use the 68000 = compiled
- * = module
+ * module by = default
  */
  r = =3D Ssystem(S_GETCOOKIE, C__CPU, &cpu);
  = if (r =3D=3D 0 && cpu < 20)
  = name =3D DEFAULT_68000;
+ else
+ = name =3D DEFAULT;
+
+ = my_strlcpy(temp, path, sizeof(path));
+ r = =3D Dsetpath(temp);
+ r =3D Dgetpath(temp, = 0);
+ =
+ my_strlcat(temp, "\\", = sizeof(temp));
+ my_strlcat(temp, name, = sizeof(temp));
+
+ = fh =3D Fopen(temp, O_RDONLY);
+ = if (fh < 0)
+ {
+ = /* default kernel module not available, select module based on = CPU type */
+ r =3D = Ssystem(S_GETCOOKIE, C__CPU, &cpu);
+ = if(r =3D=3D 0)
+ = {
+ = switch(cpu)
+ = {
+ = case 20: = name =3D DEFAULT_68020; break;
+ = case 30: name =3D DEFAULT_68030; = break;
+ = case 40: = name =3D DEFAULT_68040; break;
+ = case 60: name =3D DEFAULT_68060; = break;
+ =
+ = default: = break;
+ = }
+ = }
+ }
+ = Fclose((int)fh);
  = }
 
  /* change to the XaAES module = directory */

= --Apple-Mail-11--738160288--