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.7 by cebix, 2000-07-14T21:29:10Z vs.
Revision 1.9 by jlachmann, 2000-08-20T14:08:41Z

# Line 75 | Line 75 | uint32 ROMBaseMac;             // ROM base (Mac add
75   uint8 *ROMBaseHost;             // ROM base (host address space)
76   uint32 ROMSize;                 // Size of ROM
77  
78 + uint32 MacsBugFlags = 0xbff;
79 +
80  
81   // CPU and FPU type, addressing mode
82   int CPUType;
# Line 242 | Line 244 | int main(void)
244                  WarningAlert(GetString(STR_SMALL_RAM_WARN));
245                  RAMSize = 1024*1024;
246          }
247 <        RAMBaseHost = (uint8 *)AllocMem(RAMSize + 0x100000, MEMF_PUBLIC);
248 <        if (RAMBaseHost == NULL) {
249 <                ErrorAlert(GetString(STR_NO_MEM_ERR));
250 <                QuitEmulator();
251 <        }
247 >        RAMBaseHost = (uint8 *)AllocVec(RAMSize + 0x100000, MEMF_PUBLIC);
248 > //      if (RAMBaseHost == NULL) {
249 > //              ErrorAlert(GetString(STR_NO_MEM_ERR));
250 > //              QuitEmulator();
251 > //      }
252 >        if (RAMBaseHost == NULL)
253 >                {
254 >                uint32 newRAMSize = AvailMem(MEMF_LARGEST) - 0x100000;
255 >                char xText[120];
256 >
257 >                sprintf(xText, GetString(STR_NOT_ENOUGH_MEM_WARN), RAMSize, newRAMSize);
258 >
259 >                if (1 != ChoiceAlert(xText, "Use", "Quit"))
260 >                        QuitEmulator();
261 >
262 >                RAMSize = newRAMSize;
263 >                RAMBaseHost = (uint8 *)AllocVec(RAMSize + 0x100000, MEMF_PUBLIC);
264 >                if (RAMBaseHost == NULL) {
265 >                        ErrorAlert(GetString(STR_NO_MEM_ERR));
266 >                        QuitEmulator();
267 >                }
268 >                }
269          RAMBaseMac = (uint32)RAMBaseHost;
270          D(bug("Mac RAM starts at %08lx\n", RAMBaseHost));
271          ROMBaseHost = RAMBaseHost + RAMSize;
# Line 313 | Line 332 | int main(void)
332          // Set task priority to -1 so we don't use all processing time
333          SetTaskPri(MainTask, -1);
334  
335 +        WriteMacInt32(MacsBugFlags, 0);
336 +
337          // Swap stack to Mac RAM area
338          stack_swap.stk_Lower = RAMBaseHost;
339          stack_swap.stk_Upper = (ULONG)RAMBaseHost + RAMSize;
# Line 375 | Line 396 | void QuitEmulator(void)
396  
397          // Delete RAM/ROM area
398          if (RAMBaseHost)
399 <                FreeMem(RAMBaseHost, RAMSize + 0x100000);
399 >                FreeVec(RAMBaseHost);
400  
401          // Delete scratch memory area
402          if (ScratchMem)
# Line 453 | Line 474 | void TriggerInterrupt(void)
474          Signal(MainTask, IRQSigMask);
475   }
476  
477 + void TriggerNMI(void)
478 + {
479 +        AsmTriggerNMI();
480 + }
481 +
482  
483   /*
484   *  60Hz thread
# Line 610 | Line 636 | void __saveds IllInstrHandler(trap_regs
636                  EmulatedSR |= 0x0700;
637  
638                  // Call opcode routine
639 <                EmulOp(*(uint16 *)(r->pc), (M68kRegisters *)r);
639 >                EmulOp(opcode, (M68kRegisters *)r);
640                  r->pc += 2;
641  
642                  // Restore interrupts

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines