ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/BeOS/main_beos.cpp
(Generate patch)

Comparing SheepShaver/src/BeOS/main_beos.cpp (file contents):
Revision 1.5 by gbeauche, 2003-12-04T17:26:36Z vs.
Revision 1.8 by gbeauche, 2003-12-05T12:36:10Z

# Line 220 | Line 220 | system_info SysInfo;   // System informati
220  
221   static void *sig_stack = NULL;          // Stack for signal handlers
222   static void *extra_stack = NULL;        // Stack for SIGSEGV inside interrupt handler
223 < static uintptr SheepMem::base;          // Address of SheepShaver data
224 < static uintptr SheepMem::top;           // Top of SheepShaver data (stack like storage)
223 > uintptr SheepMem::zero_page = 0;        // Address of ro page filled in with zeros
224 > uintptr SheepMem::base;                         // Address of SheepShaver data
225 > uintptr SheepMem::top;                          // Top of SheepShaver data (stack like storage)
226   static area_id SheepMemArea;            // SheepShaver data area ID
227  
228  
# Line 578 | Line 579 | void SheepShaver::StartEmulator(void)
579          WriteMacInt32(XLM_PVR, PVR);                                                                    // Theoretical PVR
580          WriteMacInt32(XLM_BUS_CLOCK, BusClockSpeed);                                    // For DriverServicesLib patch
581          WriteMacInt16(XLM_EXEC_RETURN_OPCODE, M68K_EXEC_RETURN);                // For Execute68k() (RTS from the executed 68k code will jump here and end 68k mode)
582 +        WriteMacInt32(XLM_ZERO_PAGE, SheepMem::ZeroPage());                             // Pointer to read-only page with all bits set to 0
583   #if !EMULATED_PPC
584          WriteMacInt32(XLM_TOC, (uint32)TOC);                                                    // TOC pointer of emulator
585          WriteMacInt32(XLM_ETHER_INIT, *(uint32 *)InitStreamModule);             // DLPI ethernet driver functions
# Line 1265 | Line 1267 | void Execute68kTrap(uint16 trap, M68kReg
1267  
1268  
1269   /*
1268 *  Execute PPC code from EMUL_OP routine (real mode switch)
1269 */
1270
1271 void ExecutePPC(void (*func)())
1272 {
1273        SheepRoutineDescriptor desc(0, (uint32)func);
1274        M68kRegisters r;
1275        Execute68k((uint32)&desc, &r);
1276 }
1277
1278
1279 /*
1270   *  Quit emulator (must only be called from main thread)
1271   */
1272  
# Line 1331 | Line 1321 | void MakeExecutable(int dummy, void *sta
1321  
1322   void PatchAfterStartup(void)
1323   {
1324 <        ExecutePPC(VideoInstallAccel);
1324 >        ExecuteNative(NATIVE_VIDEO_INSTALL_ACCEL);
1325          InstallExtFS();
1326   }
1327  
# Line 1579 | Line 1569 | void SheepShaver::sigusr1_handler(vregs
1569                                          if (InterruptFlags & INTFLAG_VIA) {
1570                                                  ClearInterruptFlag(INTFLAG_VIA);
1571                                                  ADBInterrupt();
1572 <                                                ExecutePPC(VideoVBL);
1572 >                                                ExecuteNative(NATIVE_VIDEO_VBL);
1573                                          }
1574                                  }
1575   #endif
# Line 2091 | Line 2081 | bool SheepMem::Init(void)
2081          if (SheepMemArea < 0)
2082                  return false;
2083  
2084 +        // Create read-only area with all bits set to 0
2085 +        static const uint8 const_zero_page[4096] = {0,};
2086 +        zero_page = const_zero_page;
2087 +
2088          D(bug("SheepShaver area %ld at %p\n", SheepMemArea, base));
2089          top = base + size;
2090          return true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines