1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
6 // Copyright (C) 1993-1996 by id Software, Inc.
8 // This source is available for distribution and/or modification
9 // only under the terms of the DOOM Source Code License as
10 // published by id Software. All rights reserved.
12 // The source is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
18 // Revision 1.1 2000/02/29 18:21:03 stegerg
19 // Doom port based on ADoomPPC. Read README.AROS!
23 // Main program, simply calls D_DoomMain high level loop.
25 //-----------------------------------------------------------------------------
27 const char amigaversion
[] = "$VER: ADoomPPC 1.3 " __AMIGADATE__
;
29 long __oslibversion
= 38; /* we require at least OS3.0 for LoadRGB32() */
30 char __stdiowin
[] = "CON:0/20/640/140/ADoomPPC";
31 char __stdiov37
[] = "/AUTO/CLOSE/WAIT";
36 #include <exec/exec.h>
37 #include <workbench/startup.h>
38 #include <workbench/workbench.h>
39 #include <workbench/icon.h>
40 #include <PowerUP/ppclib/ppc.h>
42 #include <proto/exec.h>
43 #include <proto/icon.h>
52 /**********************************************************************/
62 /**********************************************************************/
64 extern char **_WBArgv
;
66 int main (int argc
, char* argv
[])
71 /* these command line arguments are flags */
72 static char *flags
[] = {
112 /* these command line arguments each take a value */
113 static char *settings
[] = {
138 printf ("%s\n", &amigaversion
[6]);
142 /* run from WB, _WBArgv is name and TOOLTYPEs */
147 if ((myargv
= malloc(sizeof(char *)*MAXARGVS
)) == NULL
)
148 I_Error ("malloc(%d) failed", sizeof(char *)*MAXARGVS
);
149 memset (myargv
, 0, sizeof(char *)*MAXARGVS
);
150 memcpy (myargv
, argv
, sizeof(char *)*myargc
);
152 printf ("\nADoomPPC parameters are:\n\n ");
153 for (i
= 1; i
< myargc
; i
++)
154 printf (" %s", myargv
[i
]);
157 cpu_type
= PPCGetAttr(PPCINFOTAG_CPU
);
158 p
= M_CheckParm ("-cpu");
159 if (p
&& p
< myargc
- 1) {
160 cpu_type
= atoi (myargv
[p
+1]);
164 printf ("\nCPU is PPC603 ");
167 printf ("\nCPU is PPC604 ");
170 printf ("\nCPU is PPC602 ");
173 printf ("\nCPU is PPC603e ");
176 printf ("\nCPU is PPC603e+ ");
179 printf ("\nCPU is PPC604e ");
182 printf ("\nCPU is PPC ");
186 bus_clock
= PPCGetAttr(PPCINFOTAG_CPUCLOCK
);
187 printf ("running at %d MHz ", bus_clock
);
189 bus_clock
= 50000000;
191 bus_clock
= bus_clock
* 1000000;
192 i
= PPCGetAttr(PPCINFOTAG_CPUPLL
);
198 pll
= 1.0; // PLL is 1:1 (or bypassed)
202 pll
= 2.0; // PLL is 2:1
206 pll
= 3.0; // PLL is 3:1
209 if ((cpu_type
== 4) || (cpu_type
== 8))
210 pll
= 1.5; // PLL is 1.5:1
212 pll
= 4.0; // PLL is 4:1
215 pll
= 4.0; // PLL is 4:1
221 printf ("using a PLL divisor of %3.1f.\n", pll
);
223 bus_clock
= (int)((double)bus_clock
/ pll
);
224 p
= M_CheckParm ("-bus");
225 if (p
&& p
< myargc
- 1) {
226 bus_clock
= atoi (myargv
[p
+1]);
228 bus_MHz
= bus_clock
/ 1000000;
229 printf("Bus clock is %d MHz.\n\n", bus_MHz
);
231 tb_scale_lo
= ((double)(bus_clock
>> 2)) / 35.0;
232 tb_scale_hi
= (4.294967296E9
/ (double)(bus_clock
>> 2)) * 35.0;
234 SetFPMode (); /* set FPU rounding mode to "trunc towards -infinity" */
236 p
= M_CheckParm ("-forceversion");
237 if (p
&& p
< myargc
- 1)
238 VERSION
= atoi (myargv
[p
+1]);