clean up asfilter (remove unneeded functionality)

This commit is contained in:
Wolfgang Thaller 2014-09-25 01:58:24 +02:00
parent 4d936a889c
commit 17954e11d2

View File

@ -65,9 +65,6 @@ int main(int argc, char *argv[])
std::ifstream in(inputFileName); std::ifstream in(inputFileName);
std::ofstream out(tempFileName); std::ofstream out(tempFileName);
std::string wordS = "[0-9a-f][0-9a-f][0-9a-f][0-9a-f]";
rx::regex jsr("\t(jsr|jra) __magic_inline_(" + wordS + "(_" + wordS + ")*)");
rx::regex word(wordS);
rx::regex rts("\trts"); rx::regex rts("\trts");
rx::regex instruction("\t[a-z]+.*"); rx::regex instruction("\t[a-z]+.*");
rx::regex macsbug("# macsbug symbol"); rx::regex macsbug("# macsbug symbol");
@ -85,28 +82,14 @@ int main(int argc, char *argv[])
macsbugSymbol1 = false; macsbugSymbol1 = false;
rx::smatch match; rx::smatch match;
// ******* 1. __magic_inline hack for Toolbox calls // ******* 1. rtd hack
// //
// PrepareHeaders.hs converts calls to ONEWORDINLINE, TWOWORDINLINE etc. functions // GCC currently generates rtd instructions when returning
// into "jsr __magic_inline_a123" or "jsr __magic_inline_1234_5678", etc. // from pascal functions. This instruction is not supported on the original 68000,
// This is converted to a series of dc.w // so let's replace it.
if(rx::regex_match(line, match, jsr)) // This should really be done by GCC itself.
{
const rx::sregex_iterator end;
for (rx::sregex_iterator p(line.cbegin(), line.cend(), word);
p != end;
++p)
{
out << "\tdc.w 0x" << p->str() << std::endl;
}
if(match[1] == "jra")
{
out << "rts\n";
hadRts = true;
}
}
else if(rx::regex_match(line, match, rtd)) if(rx::regex_match(line, match, rtd))
{ {
out << "\tmove.l (%a7)+, %a0\n"; out << "\tmove.l (%a7)+, %a0\n";
out << "\tlea " + match[1] + "(%a7), %a7\n"; out << "\tlea " + match[1] + "(%a7), %a7\n";