--- SheepShaver/src/include/cpu_emulation.h 2003/12/03 15:06:09 1.6 +++ SheepShaver/src/include/cpu_emulation.h 2004/01/12 15:37:23 1.10 @@ -1,7 +1,7 @@ /* * cpu_emulation.h - Definitions for CPU emulation and Mac memory access * - * SheepShaver (C) 1997-2002 Christian Bauer and Marc Hellwig + * SheepShaver (C) 1997-2004 Christian Bauer and Marc Hellwig * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,18 +27,16 @@ */ // Constants -const uint32 ROM_BASE = 0x40800000; // Base address of ROM -const uint32 ROM_SIZE = 0x00400000; // Size of ROM file -const uint32 ROM_AREA_SIZE = 0x500000; // Size of ROM area -const uint32 ROM_END = ROM_BASE + ROM_SIZE; // End of ROM -const uint32 DR_CACHE_BASE = 0x69000000; // Address of DR cache -const uint32 DR_CACHE_SIZE = 0x80000; // Size of DR Cache -const uint32 SHEEP_BASE = 0x60000000; // Address of SheepShaver data -const uint32 SHEEP_SIZE = 0x40000; // Size of SheepShaver data - -const uint32 KERNEL_DATA_BASE = 0x68ffe000; // Address of Kernel Data -const uint32 KERNEL_DATA2_BASE = 0x5fffe000;// Alternate address of Kernel Data -const uint32 KERNEL_AREA_SIZE = 0x2000; // Size of Kernel Data area +const uintptr ROM_BASE = 0x40800000; // Base address of ROM +const uint32 ROM_SIZE = 0x400000; // Size of ROM file +const uint32 ROM_AREA_SIZE = 0x500000; // Size of ROM area +const uintptr ROM_END = ROM_BASE + ROM_SIZE; // End of ROM +const uintptr DR_CACHE_BASE = 0x69000000; // Address of DR cache +const uint32 DR_CACHE_SIZE = 0x80000; // Size of DR Cache + +const uintptr KERNEL_DATA_BASE = 0x68ffe000; // Address of Kernel Data +const uintptr KERNEL_DATA2_BASE = 0x5fffe000; // Alternate address of Kernel Data +const uint32 KERNEL_AREA_SIZE = 0x2000; // Size of Kernel Data area // MacOS 68k Emulator Data struct EmulatorData { @@ -54,9 +52,6 @@ struct KernelData { // RAM and ROM pointers (allocated and set by main_*.cpp) extern uint32 RAMBase; // Base address of Mac RAM extern uint32 RAMSize; // Size address of Mac RAM -extern uint32 SheepStack1Base; // SheepShaver first alternate stack base -extern uint32 SheepStack2Base; // SheepShaver second alternate stack base -extern uint32 SheepThunksBase; // SheepShaver thunks base // Mac memory access functions #if EMULATED_PPC @@ -95,14 +90,19 @@ static inline void *Mac2Mac_memcpy(uint3 * 680x0 and PPC emulation */ +// 68k procedure helper to write a big endian 16-bit word +#ifdef WORDS_BIGENDIAN +#define PW(W) W +#else +#define PW(X) ((((X) >> 8) & 0xff) | (((X) & 0xff) << 8)) +#endif + struct M68kRegisters; extern void Execute68k(uint32, M68kRegisters *r); // Execute 68k subroutine from EMUL_OP routine, must be ended with RTS extern void Execute68kTrap(uint16 trap, M68kRegisters *r); // Execute 68k A-Trap from EMUL_OP routine #if EMULATED_PPC extern void FlushCodeCache(uintptr start, uintptr end); // Invalidate emulator caches -extern void ExecuteNative(int selector); // Execute native code from EMUL_OP routine (real mode switch) -#else -extern void ExecutePPC(void (*func)(void)); // Execute PPC code from EMUL_OP routine (real mode switch) #endif +extern void ExecuteNative(int selector); // Execute native code from EMUL_OP routine (real mode switch) #endif