-#CXXFLAGS=-pg -O3 -g -Wall -Weffc++ -Wstrict-null-sentinel -Wold-style-cast
-CXXFLAGS=-pg -g -Wall -Weffc++ -Wold-style-cast \
+#CXXFLAGS=-pg -O3 -g -Wall -Weffc++ -Wstrict-null-sentinel -Wold-style-cast
+CXXFLAGS=-pg -O3 -g -Wall -Weffc++ -Wold-style-cast \
-Woverloaded-virtual $(shell sdl-config --cflags)
LDFLAGS=-pg -g $(shell sdl-config --libs)
g++ $(CXXFLAGS) -DTEST_GBROM -o $@ GBRom.cc $(LDFLAGS)
tests/test_core: tests/test_core.cc gbcore.o MBC.o GBMemory.o GBRom.o \
- GBVideo.o util.o NoMBC.o MBC1.o
+ GBVideo.o util.o NoMBC.o MBC1.o wendi/disasm.o
g++ $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
wendi/CodeBlock.o: wendi/CodeBlock.cc wendi/CodeBlock.h
#include "../gbcore.h"
#include "../Logger.h"
+#include "../wendi/disasm.h"
#include <iostream>
#include <iomanip>
#include <sstream>
{
break;
}
- /*
+
else if (command == "disasm" || command == "d")
{
int start, end, pos;
pos = start;
while (pos < end)
{
- string ins;
- int len;
- gb.disassemble_opcode(pos, ins, len);
+ Instruction ins(disassemble_opcode(gb, pos));
cout << "0x" << std::hex << std::setw(4) << std::setfill('0') <<
pos << "\t";
- for (int i=0; i<len; i++)
+ for (int i=0; i<ins.length; i++)
cout << std::setw(2) << int(gb.memory.read(pos+i)) << " ";
- if (len < 3) cout << "\t";
- cout << "\t" << ins << endl;
- pos += len;
+ if (ins.length < 3) cout << "\t";
+ cout << "\t" << ins.all << endl;
+ pos += ins.length;
}
}
- */
+
else if (command == "x")
{
int addr = str2int(arguments[0]);