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:
comex 2013-12-16 22:27:13 -05:00
parent 07820aaa9e
commit d619ccee21
3 changed files with 28 additions and 1047 deletions

File diff suppressed because it is too large Load Diff

View File

@ -24,37 +24,7 @@ namespace Gecko
{
Code() : address(0), data(0) {}
union
{
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
//{
//
//};
};
u32 address, data;
std::string original_line;
@ -75,7 +45,6 @@ namespace Gecko
void SetActiveCodes(const std::vector<GeckoCode>& gcodes);
bool RunActiveCodes();
void RunCodeHandler();
const std::map<u32, std::vector<u32> >& GetInsertedAsmCodes();
} // namespace Gecko

View File

@ -312,51 +312,11 @@ u32 Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa,
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
int numSystemInstructions = 0;
for (int i = 0; i < maxsize; i++)
{
UGeckoInstruction inst;
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);
}
}
UGeckoInstruction inst = JitInterface::Read_Opcode_JIT(address);
if (inst.hex != 0)
{