mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Remove the flawed, unused attempt to manually emulate Gecko codes.
Parsing Gecko codes (in any manner) is much like parsing HTML with regex - that w̷a̶y̸ l̵i̷e̴s̵ m̴̲a̵͈d̵̝n̵̙ę̵͎̞̼̙̼͔̞͖͎̝s̵̨̬̱͍͓͉̠̯̤͙̝s̷͍̲̲̭̼͍͎͖̤̭̘. Luckily, with the embedded codehandler.bin, the monstrosity may remain at only one implementation. Anyway, removing the inserted_asm_codes thing probably speeds up the interpreter a bit.
This commit is contained in:
parent
07820aaa9e
commit
d619ccee21
File diff suppressed because it is too large
Load Diff
@ -24,37 +24,7 @@ namespace Gecko
|
|||||||
{
|
{
|
||||||
Code() : address(0), data(0) {}
|
Code() : address(0), data(0) {}
|
||||||
|
|
||||||
union
|
u32 address, data;
|
||||||
{
|
|
||||||
u32 address;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
u32 gcaddress : 25;
|
|
||||||
u32 subtype: 3;
|
|
||||||
u32 use_po : 1;
|
|
||||||
u32 type: 3;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
u32 n : 4;
|
|
||||||
u32 z : 12;
|
|
||||||
u32 y : 4;
|
|
||||||
u32 t : 4;
|
|
||||||
//u32 s : 4;
|
|
||||||
//u32 : 4;
|
|
||||||
};// subsubtype;
|
|
||||||
};
|
|
||||||
|
|
||||||
union
|
|
||||||
{
|
|
||||||
u32 data;
|
|
||||||
//struct
|
|
||||||
//{
|
|
||||||
//
|
|
||||||
//};
|
|
||||||
};
|
|
||||||
|
|
||||||
std::string original_line;
|
std::string original_line;
|
||||||
|
|
||||||
@ -75,7 +45,6 @@ namespace Gecko
|
|||||||
void SetActiveCodes(const std::vector<GeckoCode>& gcodes);
|
void SetActiveCodes(const std::vector<GeckoCode>& gcodes);
|
||||||
bool RunActiveCodes();
|
bool RunActiveCodes();
|
||||||
void RunCodeHandler();
|
void RunCodeHandler();
|
||||||
const std::map<u32, std::vector<u32> >& GetInsertedAsmCodes();
|
|
||||||
|
|
||||||
} // namespace Gecko
|
} // namespace Gecko
|
||||||
|
|
||||||
|
@ -312,51 +312,11 @@ u32 Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa,
|
|||||||
|
|
||||||
u32 returnAddress = 0;
|
u32 returnAddress = 0;
|
||||||
|
|
||||||
// Used for Gecko CST1 code. (See GeckoCode/GeckoCode.h)
|
|
||||||
// We use std::queue but it is not so slow
|
|
||||||
// because cst1_instructions does not allocate memory so many times.
|
|
||||||
std::queue<UGeckoInstruction> cst1_instructions;
|
|
||||||
const std::map<u32, std::vector<u32> >& inserted_asm_codes =
|
|
||||||
Gecko::GetInsertedAsmCodes();
|
|
||||||
|
|
||||||
// Do analysis of the code, look for dependencies etc
|
// Do analysis of the code, look for dependencies etc
|
||||||
int numSystemInstructions = 0;
|
int numSystemInstructions = 0;
|
||||||
for (int i = 0; i < maxsize; i++)
|
for (int i = 0; i < maxsize; i++)
|
||||||
{
|
{
|
||||||
UGeckoInstruction inst;
|
UGeckoInstruction inst = JitInterface::Read_Opcode_JIT(address);
|
||||||
|
|
||||||
if (!cst1_instructions.empty())
|
|
||||||
{
|
|
||||||
// If the Gecko CST1 instruction queue is not empty,
|
|
||||||
// we consume the first instruction.
|
|
||||||
inst = UGeckoInstruction(cst1_instructions.front());
|
|
||||||
cst1_instructions.pop();
|
|
||||||
address -= 4;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// If the address is the insertion point of Gecko CST1 code,
|
|
||||||
// we push the code into the instruction queue and
|
|
||||||
// consume the first instruction.
|
|
||||||
std::map<u32, std::vector<u32> >::const_iterator it =
|
|
||||||
inserted_asm_codes.find(address);
|
|
||||||
if (it != inserted_asm_codes.end())
|
|
||||||
{
|
|
||||||
const std::vector<u32>& codes = it->second;
|
|
||||||
for (u32 c : codes)
|
|
||||||
{
|
|
||||||
cst1_instructions.push(c);
|
|
||||||
}
|
|
||||||
inst = UGeckoInstruction(cst1_instructions.front());
|
|
||||||
cst1_instructions.pop();
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
inst = JitInterface::Read_Opcode_JIT(address);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inst.hex != 0)
|
if (inst.hex != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user