174 |
|
QuitEmulator(); |
175 |
|
GadToolsBase = OpenLibrary((UBYTE *)"gadtools.library", 39); |
176 |
|
if (GadToolsBase == NULL) { |
177 |
< |
ErrorAlert(GetString(STR_NO_GADTOOLS_LIB_ERR)); |
177 |
> |
ErrorAlert(STR_NO_GADTOOLS_LIB_ERR); |
178 |
|
QuitEmulator(); |
179 |
|
} |
180 |
|
IFFParseBase = OpenLibrary((UBYTE *)"iffparse.library", 39); |
181 |
|
if (IFFParseBase == NULL) { |
182 |
< |
ErrorAlert(GetString(STR_NO_IFFPARSE_LIB_ERR)); |
182 |
> |
ErrorAlert(STR_NO_IFFPARSE_LIB_ERR); |
183 |
|
QuitEmulator(); |
184 |
|
} |
185 |
|
AslBase = OpenLibrary((UBYTE *)"asl.library", 36); |
186 |
|
if (AslBase == NULL) { |
187 |
< |
ErrorAlert(GetString(STR_NO_ASL_LIB_ERR)); |
187 |
> |
ErrorAlert(STR_NO_ASL_LIB_ERR); |
188 |
|
QuitEmulator(); |
189 |
|
} |
190 |
|
|
217 |
|
|
218 |
|
// Check start of Chip memory (because we need access to 0x0000..0x2000) |
219 |
|
if ((uint32)FindName(&SysBase->MemList, (UBYTE *)"chip memory") < 0x2000) { |
220 |
< |
ErrorAlert(GetString(STR_NO_PREPARE_EMUL_ERR)); |
220 |
> |
ErrorAlert(STR_NO_PREPARE_EMUL_ERR); |
221 |
|
QuitEmulator(); |
222 |
|
} |
223 |
|
|
224 |
|
// Open timer.device |
225 |
|
timereq = (struct timerequest *)AllocVec(sizeof(timerequest), MEMF_PUBLIC | MEMF_CLEAR); |
226 |
|
if (timereq == NULL) { |
227 |
< |
ErrorAlert(GetString(STR_NO_MEM_ERR)); |
227 |
> |
ErrorAlert(STR_NO_MEM_ERR); |
228 |
|
QuitEmulator(); |
229 |
|
} |
230 |
|
if (OpenDevice((UBYTE *)TIMERNAME, UNIT_MICROHZ, (struct IORequest *)timereq, 0)) { |
231 |
< |
ErrorAlert(GetString(STR_NO_TIMER_DEV_ERR)); |
231 |
> |
ErrorAlert(STR_NO_TIMER_DEV_ERR); |
232 |
|
QuitEmulator(); |
233 |
|
} |
234 |
|
TimerBase = (struct Library *)timereq->tr_node.io_Device; |
236 |
|
// Allocate scratch memory |
237 |
|
ScratchMem = (uint8 *)AllocMem(SCRATCH_MEM_SIZE, MEMF_PUBLIC); |
238 |
|
if (ScratchMem == NULL) { |
239 |
< |
ErrorAlert(GetString(STR_NO_MEM_ERR)); |
239 |
> |
ErrorAlert(STR_NO_MEM_ERR); |
240 |
|
QuitEmulator(); |
241 |
|
} |
242 |
|
ScratchMem += SCRATCH_MEM_SIZE/2; // ScratchMem points to middle of block |
261 |
|
RAMSize = newRAMSize; |
262 |
|
RAMBaseHost = (uint8 *)AllocVec(RAMSize + 0x100000, MEMF_PUBLIC); |
263 |
|
if (RAMBaseHost == NULL) { |
264 |
< |
ErrorAlert(GetString(STR_NO_MEM_ERR)); |
264 |
> |
ErrorAlert(STR_NO_MEM_ERR); |
265 |
|
QuitEmulator(); |
266 |
|
} |
267 |
|
} |
277 |
|
// Load Mac ROM |
278 |
|
BPTR rom_fh = Open(rom_path ? (char *)rom_path : (char *)ROM_FILE_NAME, MODE_OLDFILE); |
279 |
|
if (rom_fh == 0) { |
280 |
< |
ErrorAlert(GetString(STR_NO_ROM_FILE_ERR)); |
280 |
> |
ErrorAlert(STR_NO_ROM_FILE_ERR); |
281 |
|
QuitEmulator(); |
282 |
|
} |
283 |
|
printf(GetString(STR_READING_ROM_FILE)); |
284 |
|
Seek(rom_fh, 0, OFFSET_END); |
285 |
|
ROMSize = Seek(rom_fh, 0, OFFSET_CURRENT); |
286 |
|
if (ROMSize != 512*1024 && ROMSize != 1024*1024) { |
287 |
< |
ErrorAlert(GetString(STR_ROM_SIZE_ERR)); |
287 |
> |
ErrorAlert(STR_ROM_SIZE_ERR); |
288 |
|
Close(rom_fh); |
289 |
|
QuitEmulator(); |
290 |
|
} |
291 |
|
Seek(rom_fh, 0, OFFSET_BEGINNING); |
292 |
|
if (Read(rom_fh, ROMBaseHost, ROMSize) != ROMSize) { |
293 |
< |
ErrorAlert(GetString(STR_ROM_FILE_READ_ERR)); |
293 |
> |
ErrorAlert(STR_ROM_FILE_READ_ERR); |
294 |
|
Close(rom_fh); |
295 |
|
QuitEmulator(); |
296 |
|
} |