2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project 64 - A Nintendo 64 emulator. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
|
2010-05-25 09:15:19 +00:00
|
|
|
class CCompiledFunc
|
|
|
|
{
|
2010-05-30 01:54:42 +00:00
|
|
|
//constructor
|
2015-04-28 22:19:02 +00:00
|
|
|
CCompiledFunc(); // not implemented
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
public:
|
2015-04-28 22:19:02 +00:00
|
|
|
CCompiledFunc(const CCodeBlock & CodeBlock);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
typedef void (*Func)();
|
2010-05-25 09:15:19 +00:00
|
|
|
|
2010-05-30 01:54:42 +00:00
|
|
|
//Get Private Information
|
2015-04-28 22:19:02 +00:00
|
|
|
const DWORD EnterPC () const { return m_EnterPC; }
|
|
|
|
const DWORD MinPC () const { return m_MinPC; }
|
|
|
|
const DWORD MaxPC () const { return m_MaxPC; }
|
|
|
|
const Func Function () const { return m_Function; }
|
|
|
|
const MD5Digest& Hash () const { return m_Hash; }
|
2010-05-25 09:15:19 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
CCompiledFunc* Next () const { return m_Next; }
|
|
|
|
void SetNext(CCompiledFunc* Next) { m_Next = Next; }
|
2012-09-24 22:07:51 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
QWORD MemContents(int i) { return m_MemContents[i]; }
|
|
|
|
QWORD* MemLocation(int i) { return m_MemLocation[i]; }
|
2012-09-24 22:07:51 +00:00
|
|
|
|
2010-05-30 01:54:42 +00:00
|
|
|
private:
|
|
|
|
//Information
|
2015-04-28 22:19:02 +00:00
|
|
|
DWORD m_EnterPC; // The Entry PC
|
|
|
|
DWORD m_MinPC; // The Lowest PC in the function
|
|
|
|
DWORD m_MaxPC; // The Highest PC in the function
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2010-06-16 07:31:47 +00:00
|
|
|
MD5Digest m_Hash;
|
2010-05-30 01:54:42 +00:00
|
|
|
//From querying the recompiler get information about the function
|
|
|
|
Func m_Function;
|
2010-06-16 07:31:47 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
CCompiledFunc* m_Next;
|
2010-05-30 01:54:42 +00:00
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
//Validation
|
2012-09-24 22:07:51 +00:00
|
|
|
QWORD m_MemContents[2], * m_MemLocation[2];
|
2008-09-18 03:15:49 +00:00
|
|
|
};
|
2010-06-04 06:25:07 +00:00
|
|
|
|
2015-01-31 19:27:27 +00:00
|
|
|
typedef std::map<DWORD, CCompiledFunc *> CCompiledFuncList;
|