41 |
|
#define DEBUG 0 |
42 |
|
#include "debug.h" |
43 |
|
|
44 |
+ |
#if ENABLE_MON |
45 |
+ |
#include "mon.h" |
46 |
+ |
|
47 |
+ |
static uint32 mon_read_byte_b2(uint32 adr) |
48 |
+ |
{ |
49 |
+ |
return ReadMacInt8(adr); |
50 |
+ |
} |
51 |
+ |
|
52 |
+ |
static void mon_write_byte_b2(uint32 adr, uint32 b) |
53 |
+ |
{ |
54 |
+ |
WriteMacInt8(adr, b); |
55 |
+ |
} |
56 |
+ |
#endif |
57 |
+ |
|
58 |
|
|
59 |
|
/* |
60 |
|
* Initialize everything, returns false on error |
79 |
|
TwentyFourBitAddressing = true; |
80 |
|
break; |
81 |
|
case ROM_VERSION_II: |
82 |
< |
CPUType = 2; |
82 |
> |
CPUType = PrefsFindInt32("cpu"); |
83 |
> |
if (CPUType < 2) CPUType = 2; |
84 |
> |
if (CPUType > 4) CPUType = 4; |
85 |
|
FPUType = PrefsFindBool("fpu") ? 1 : 0; |
86 |
+ |
if (CPUType == 4) FPUType = 1; // 68040 always with FPU |
87 |
|
TwentyFourBitAddressing = true; |
88 |
|
break; |
89 |
|
case ROM_VERSION_32: |
90 |
< |
CPUType = 3; |
90 |
> |
CPUType = PrefsFindInt32("cpu"); |
91 |
> |
if (CPUType < 2) CPUType = 2; |
92 |
> |
if (CPUType > 4) CPUType = 4; |
93 |
|
FPUType = PrefsFindBool("fpu") ? 1 : 0; |
94 |
+ |
if (CPUType == 4) FPUType = 1; // 68040 always with FPU |
95 |
|
TwentyFourBitAddressing = false; |
96 |
|
break; |
97 |
|
} |
115 |
|
CDROMInit(); |
116 |
|
SCSIInit(); |
117 |
|
|
118 |
+ |
#if SUPPORTS_EXTFS |
119 |
|
// Init external file system |
120 |
|
ExtFSInit(); |
121 |
+ |
#endif |
122 |
|
|
123 |
|
// Init serial ports |
124 |
|
SerialInit(); |
150 |
|
ErrorAlert(GetString(STR_UNSUPPORTED_ROM_TYPE_ERR)); |
151 |
|
return false; |
152 |
|
} |
153 |
+ |
|
154 |
+ |
#if ENABLE_MON |
155 |
+ |
// Initialize mon |
156 |
+ |
mon_init(); |
157 |
+ |
mon_read_byte = mon_read_byte_b2; |
158 |
+ |
mon_write_byte = mon_write_byte_b2; |
159 |
+ |
#endif |
160 |
+ |
|
161 |
|
return true; |
162 |
|
} |
163 |
|
|
168 |
|
|
169 |
|
void ExitAll(void) |
170 |
|
{ |
171 |
+ |
#if ENABLE_MON |
172 |
+ |
// Deinitialize mon |
173 |
+ |
mon_exit(); |
174 |
+ |
#endif |
175 |
+ |
|
176 |
|
// Save XPRAM |
177 |
|
XPRAMExit(); |
178 |
|
|
194 |
|
// Exit network |
195 |
|
EtherExit(); |
196 |
|
|
197 |
+ |
#if SUPPORTS_EXTFS |
198 |
|
// Exit external file system |
199 |
|
ExtFSExit(); |
200 |
+ |
#endif |
201 |
|
|
202 |
|
// Exit drivers |
203 |
|
SCSIExit(); |