From: slack Date: Fri, 12 Sep 2008 01:56:27 +0000 (+0200) Subject: Restored disasm command in the emulator/debugger X-Git-Tag: v0.1~10 X-Git-Url: http://slack.codemaniacs.com/git/?a=commitdiff_plain;h=cb961fc02064ea34ed61a6044b1f27e1c855b825;p=wenboi.git Restored disasm command in the emulator/debugger --- diff --git a/Makefile b/Makefile index 631e92c..475c335 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -#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) @@ -33,7 +33,7 @@ tests/test_gbrom: GBRom.cc GBRom.h 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 diff --git a/tests/test_core.cc b/tests/test_core.cc index 2d2775c..ec615d6 100644 --- a/tests/test_core.cc +++ b/tests/test_core.cc @@ -1,5 +1,6 @@ #include "../gbcore.h" #include "../Logger.h" +#include "../wendi/disasm.h" #include #include #include @@ -139,7 +140,7 @@ int main(int argc, char **argv) { break; } - /* + else if (command == "disasm" || command == "d") { int start, end, pos; @@ -163,21 +164,19 @@ int main(int argc, char **argv) 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