Merge pull request #397 from LukeUsher/hle-database-cleanup

Remove EmuPatch from OOVPA Tables as it is no longer used
This commit is contained in:
Luke Usher 2017-04-25 11:23:10 +01:00 committed by GitHub
commit 928260f56b
2 changed files with 7 additions and 49 deletions

View File

@ -936,31 +936,7 @@ void VerifyHLEOOVPA(HLEVerifyContext *context, OOVPA *oovpa)
void VerifyHLEDataEntry(HLEVerifyContext *context, const OOVPATable *table, uint32 index, uint32 count)
{
if (context->against == nullptr) {
context->main_index = index;
// does this entry specify a redirection (patch)?
void * entry_redirect = table[index].emuPatch;
if (entry_redirect != nullptr) {
if (table[index].Oovpa == nullptr) {
HLEError(context, "Patch without an OOVPA at index %d",
index);
} else
// check no patch occurs twice in this table
for (uint32 t = index + 1; t < count; t++) {
if (entry_redirect == table[t].emuPatch) {
if (table[index].Oovpa == table[t].Oovpa) {
HLEError(context, "Patch registered again (with same OOVPA) at index %d",
t);
} else {
HLEError(context, "Patch also used for another OOVPA at index %d",
t);
}
}
}
}
}
else
context->against_index = index;
context->against_index = index;
// verify the OOVPA of this entry
if (table[index].Oovpa != nullptr)

View File

@ -36,23 +36,6 @@
#include "Cxbx.h"
// ******************************************************************
// * Take THIS C++ !!
// ******************************************************************
template <class BaseClass, typename MFT> inline void *MFPtoFP(MFT pMemFunc)
{
union
{
MFT pMemFunc;
void(*pFunc)();
}
ThisConv;
ThisConv.pMemFunc = pMemFunc;
return ThisConv.pFunc;
}
#pragma pack(1)
// ******************************************************************
@ -150,7 +133,6 @@ OOVPA_XREF(Name, Version, Count, XRefNoSaveIndex, XRefZero)
struct OOVPATable
{
OOVPA *Oovpa;
void *emuPatch;
char *szFuncName;
uint16_t Version : 13; // 2^13 = 8192, enough to store lowest and higest possible Library Version number in
uint16_t Flags : 3;
@ -160,8 +142,8 @@ const uint16_t Flag_DontScan = 1; // Indicates an entry that's currently disable
const uint16_t Flag_XRef = 2; // Indicates that an entry is an X-Ref
const uint16_t Flag_Reserved = 4;
#define OOVPA_TABLE_ENTRY_FULL(Oovpa, Patch, DebugName, Version, Flags) \
{ & Oovpa ## _ ## Version.Header, Patch, DebugName, Version, Flags }
#define OOVPA_TABLE_ENTRY_FULL(Oovpa, DebugName, Version, Flags) \
{ & Oovpa ## _ ## Version.Header, DebugName, Version, Flags }
// REGISTER_OOVPA is the ONLY allowed macro for registrations.
// Registrations MUST stay sorted to prevent duplicates and maintain overview.
@ -174,19 +156,19 @@ const uint16_t Flag_Reserved = 4;
#define PATCH /* most common registration, Symbol indicates both an OOVPA and Patch */
#define REGISTER_OOVPA_PATCH(Symbol, Version, ...) \
OOVPA_TABLE_ENTRY_FULL(Symbol, XTL::EMUPATCH(Symbol), #Symbol ##, Version, 0)
OOVPA_TABLE_ENTRY_FULL(Symbol, #Symbol ##, Version, 0)
#define XREF /* registration of an XRef-only OOVPA, for which no Patch is present */
#define REGISTER_OOVPA_XREF(Symbol, Version, ...) \
OOVPA_TABLE_ENTRY_FULL(Symbol, nullptr, #Symbol ##, Version, Flag_XRef)
OOVPA_TABLE_ENTRY_FULL(Symbol, #Symbol ##, Version, Flag_XRef)
#define ALIAS /* registration of a Patch using an alternatively named OOVPA */
#define REGISTER_OOVPA_ALIAS(Symbol, Version, AliasOovpa) \
OOVPA_TABLE_ENTRY_FULL(AliasOovpa, XTL::EMUPATCH(Symbol), #Symbol ##, Version, 0)
OOVPA_TABLE_ENTRY_FULL(AliasOovpa, #Symbol ##, Version, 0)
#define DISABLED /* registration is (temporarily) disabled by a flag */
#define REGISTER_OOVPA_DISABLED(Symbol, Version, ...) \
OOVPA_TABLE_ENTRY_FULL(Symbol, nullptr, #Symbol ##, Version, Flag_DontScan)
OOVPA_TABLE_ENTRY_FULL(Symbol, #Symbol ##, Version, Flag_DontScan)
#pragma pack()