ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/AmigaOS/main_amiga.cpp
(Generate patch)

Comparing BasiliskII/src/AmigaOS/main_amiga.cpp (file contents):
Revision 1.8 by cebix, 2000-07-22T16:00:34Z vs.
Revision 1.10 by cebix, 2000-09-04T16:30:47Z

# Line 242 | Line 242 | int main(void)
242                  WarningAlert(GetString(STR_SMALL_RAM_WARN));
243                  RAMSize = 1024*1024;
244          }
245 <        RAMBaseHost = (uint8 *)AllocMem(RAMSize + 0x100000, MEMF_PUBLIC);
245 >        RAMBaseHost = (uint8 *)AllocVec(RAMSize + 0x100000, MEMF_PUBLIC);
246          if (RAMBaseHost == NULL) {
247 <                ErrorAlert(GetString(STR_NO_MEM_ERR));
248 <                QuitEmulator();
247 >                uint32 newRAMSize = AvailMem(MEMF_LARGEST) - 0x100000;
248 >                char xText[120];
249 >
250 >                sprintf(xText, GetString(STR_NOT_ENOUGH_MEM_WARN), RAMSize, newRAMSize);
251 >
252 >                if (ChoiceAlert(xText, "Use", "Quit") != 1)
253 >                        QuitEmulator();
254 >
255 >                RAMSize = newRAMSize;
256 >                RAMBaseHost = (uint8 *)AllocVec(RAMSize + 0x100000, MEMF_PUBLIC);
257 >                if (RAMBaseHost == NULL) {
258 >                        ErrorAlert(GetString(STR_NO_MEM_ERR));
259 >                        QuitEmulator();
260 >                }
261          }
262          RAMBaseMac = (uint32)RAMBaseHost;
263          D(bug("Mac RAM starts at %08lx\n", RAMBaseHost));
# Line 313 | Line 325 | int main(void)
325          // Set task priority to -1 so we don't use all processing time
326          SetTaskPri(MainTask, -1);
327  
328 +        WriteMacInt32(0xbff, 0);        // MacsBugFlags
329 +
330          // Swap stack to Mac RAM area
331          stack_swap.stk_Lower = RAMBaseHost;
332          stack_swap.stk_Upper = (ULONG)RAMBaseHost + RAMSize;
# Line 375 | Line 389 | void QuitEmulator(void)
389  
390          // Delete RAM/ROM area
391          if (RAMBaseHost)
392 <                FreeMem(RAMBaseHost, RAMSize + 0x100000);
392 >                FreeVec(RAMBaseHost);
393  
394          // Delete scratch memory area
395          if (ScratchMem)
# Line 453 | Line 467 | void TriggerInterrupt(void)
467          Signal(MainTask, IRQSigMask);
468   }
469  
470 + void TriggerNMI(void)
471 + {
472 +        AsmTriggerNMI();
473 + }
474 +
475  
476   /*
477   *  60Hz thread

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines