#endif
memset(&M,0,sizeof(M));
if (memSize < 20480)
- PM_fatalError("Emulator requires at least 20Kb of memory!\n");
+ PM_fatalError("Emulator requires at least 20Kb of memory!\n");
if ((M.mem_base = (unsigned long)malloc(memSize)) == NULL)
- PM_fatalError("Out of memory!");
+ PM_fatalError("Out of memory!");
M.mem_size = memSize;
_BE_env.busmem_base = (ulong)PM_mapPhysicalAddr(0xA0000,0x5FFFF,true);
M.x86.debug = debugFlags;
_BE_env.vgaInfo.pciInfo = info->pciInfo;
_BE_env.vgaInfo.BIOSImage = info->BIOSImage;
if (info->BIOSImage) {
- _BE_env.biosmem_base = (ulong)info->BIOSImage;
- _BE_env.biosmem_limit = 0xC0000 + info->BIOSImageLen-1;
- }
+ _BE_env.biosmem_base = (ulong)info->BIOSImage;
+ _BE_env.biosmem_limit = 0xC0000 + info->BIOSImageLen-1;
+ }
else {
- _BE_env.biosmem_base = _BE_env.busmem_base + 0x20000;
- _BE_env.biosmem_limit = 0xC7FFF;
- }
+ _BE_env.biosmem_base = _BE_env.busmem_base + 0x20000;
+ _BE_env.biosmem_limit = 0xC7FFF;
+ }
if (*((u32*)info->LowMem) == 0)
- _BE_bios_init((u32*)info->LowMem);
+ _BE_bios_init((u32*)info->LowMem);
memcpy((u8*)M.mem_base,info->LowMem,sizeof(info->LowMem));
}
mode pointer that can be used to directly access the memory.
NOTE: The memory is *always* in little endian format, son on non-x86
- systems you will need to do endian translations to access this
- memory.
+ systems you will need to do endian translations to access this
+ memory.
****************************************************************************/
void * PMAPI BE_mapRealPointer(
uint r_seg,
u32 addr = ((u32)r_seg << 4) + r_off;
if (addr >= 0xC0000 && addr <= _BE_env.biosmem_limit) {
- return (void*)(_BE_env.biosmem_base + addr - 0xC0000);
- }
+ return (void*)(_BE_env.biosmem_base + addr - 0xC0000);
+ }
else if (addr >= 0xA0000 && addr <= 0xFFFFF) {
- return (void*)(_BE_env.busmem_base + addr - 0xA0000);
- }
+ return (void*)(_BE_env.busmem_base + addr - 0xA0000);
+ }
return (void*)(M.mem_base + addr);
}
we put the real mode code we execute for issuing interrupts).
NOTE: The memory is *always* in little endian format, son on non-x86
- systems you will need to do endian translations to access this
- memory.
+ systems you will need to do endian translations to access this
+ memory.
****************************************************************************/
void * PMAPI BE_getVESABuf(
uint *len,
PM_imports *pmImp)
{
static BE_exports _BE_exports = {
- sizeof(BE_exports),
- BE_init,
- BE_setVGA,
- BE_getVGA,
- BE_mapRealPointer,
- BE_getVESABuf,
- BE_callRealMode,
- BE_int86,
- BE_int86x,
- NULL,
- BE_exit,
- };
+ sizeof(BE_exports),
+ BE_init,
+ BE_setVGA,
+ BE_getVGA,
+ BE_mapRealPointer,
+ BE_getVESABuf,
+ BE_callRealMode,
+ BE_int86,
+ BE_int86x,
+ NULL,
+ BE_exit,
+ };
int i,max;
ulong *p;
- // Initialize all default imports to point to fatal error handler
- // for upwards compatibility.
+ /* Initialize all default imports to point to fatal error handler */
+ /* for upwards compatibility. */
max = sizeof(_PM_imports)/sizeof(BE_initLibrary_t);
for (i = 0,p = (ulong*)&_PM_imports; i < max; i++)
- *p++ = (ulong)_PM_fatalErrorHandler;
+ *p++ = (ulong)_PM_fatalErrorHandler;
- // Now copy all our imported functions
+ /* Now copy all our imported functions */
memcpy(&_PM_imports,pmImp,MIN(sizeof(_PM_imports),pmImp->dwSize));
return &_BE_exports;
}