mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-26 06:49:33 +00:00
Fix cache flushing
This commit is contained in:
parent
c757fb9520
commit
4897a9e039
@ -103,7 +103,7 @@ pascal void* Retro68LoadSegment(uint8_t *p)
|
||||
++jtEntry;
|
||||
}
|
||||
|
||||
if(relocState.needFlushCache)
|
||||
if(relocState.hasFlushCodeCache)
|
||||
FlushCodeCache();
|
||||
|
||||
/* Load Exception Information */
|
||||
|
@ -89,8 +89,8 @@ typedef struct Retro68RelocState
|
||||
{
|
||||
Ptr bssPtr;
|
||||
Handle codeHandle;
|
||||
char hasStripAddr;
|
||||
char needFlushCache;
|
||||
char hasStripAddr;
|
||||
char hasFlushCodeCache;
|
||||
} Retro68RelocState;
|
||||
|
||||
extern Retro68RelocState relocState;
|
||||
|
@ -118,14 +118,17 @@ void Retro68Relocate()
|
||||
Boolean is128KROM = ((*ROM85) > 0);
|
||||
Boolean hasSysEnvirons = false;
|
||||
Boolean hasStripAddr = false;
|
||||
Boolean hasFlushCodeCache = false;
|
||||
if (is128KROM)
|
||||
{
|
||||
UniversalProcPtr trapSysEnv = GetOSTrapAddress(_SysEnvirons);
|
||||
UniversalProcPtr trapStripAddr = GetOSTrapAddress(_StripAddress);
|
||||
UniversalProcPtr trapFlushCodeCache = GetOSTrapAddress(0xA0BD);
|
||||
UniversalProcPtr trapUnimpl = GetOSTrapAddress(_Unimplemented);
|
||||
|
||||
hasSysEnvirons = (trapSysEnv != trapUnimpl);
|
||||
hasStripAddr = (trapStripAddr != trapUnimpl);
|
||||
hasFlushCodeCache = (trapFlushCodeCache != trapUnimpl);
|
||||
}
|
||||
|
||||
// Figure out the displacement
|
||||
@ -161,7 +164,8 @@ void Retro68Relocate()
|
||||
}
|
||||
}
|
||||
|
||||
rState->hasStripAddr = hasStripAddr;
|
||||
rState->hasStripAddr = hasStripAddr;
|
||||
rState->hasFlushCodeCache = hasFlushCodeCache;
|
||||
|
||||
// Locate the start of the FLT file header inside the code resource
|
||||
uint8_t *orig_stext, *orig_etext, *orig_sdata, *orig_edata, *orig_sbss, *orig_ebss;
|
||||
@ -261,7 +265,7 @@ void Retro68Relocate()
|
||||
RealApplyRelocations(base, relocatableSize, reloc, displacements);
|
||||
|
||||
// We're basically done.
|
||||
// Now check whether we're on 68040 or later and need to flush the cache.
|
||||
/*// Now check whether we're on 68040 or later and need to flush the cache.
|
||||
// only do this if SysEnvirons is available.
|
||||
// if SysEnvirons is not available, that means we're on an old System or ROM
|
||||
// and likely not using a 68040, so we won't do this
|
||||
@ -276,7 +280,9 @@ void Retro68Relocate()
|
||||
rState->needFlushCache = true;
|
||||
FlushCodeCache();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
if(hasFlushCodeCache)
|
||||
FlushCodeCache();
|
||||
|
||||
// accessing globals and calling functions is OK below here.
|
||||
// ... as long as it is in the current segment.
|
||||
|
Loading…
Reference in New Issue
Block a user