Restored disasm command in the emulator/debugger
authorslack <slack@codemaniacs.com>
Fri, 12 Sep 2008 01:56:27 +0000 (03:56 +0200)
committerslack <slack@codemaniacs.com>
Fri, 12 Sep 2008 01:56:27 +0000 (03:56 +0200)
Makefile
tests/test_core.cc

index 631e92c02b8fc8a15cdadf74381bc7d87cdd26a6..475c335f04e122e2e3cda2288d683eb304991d32 100644 (file)
--- 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
index 2d2775cc822ec8a09dd4d10e07aebe256a892ee9..ec615d66497ce50d394f142d6a1145a3c4b625c3 100644 (file)
@@ -1,5 +1,6 @@
 #include "../gbcore.h"
 #include "../Logger.h"
+#include "../wendi/disasm.h"
 #include <iostream>
 #include <iomanip>
 #include <sstream>
@@ -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<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]);