X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fjagdasm.cpp;h=31a67ef7d8852489a598b19a00c5a65de527a61e;hb=8103796dd981a8a1c2e18979fd5ef3a1f3f1ccdb;hp=2e449a76835449e15953dd74e45728420f07bed9;hpb=683f283e1328164c176618088c34408ea6c03cf7;p=virtualjaguar diff --git a/src/jagdasm.cpp b/src/jagdasm.cpp index 2e449a7..31a67ef 100644 --- a/src/jagdasm.cpp +++ b/src/jagdasm.cpp @@ -1,3 +1,21 @@ +// +// Jaguar RISC Disassembly +// +// Originally by David Raingeard +// GCC/SDL port by Niels Wagenaar (Linux/WIN32) and Carwin Jones (BeOS) +// Minor cleanups by James Hammons +// (C) 2012 Underground Software +// +// JLH = James Hammons +// +// Who When What +// --- ---------- ------------------------------------------------------------- +// JLH 06/01/2012 Created this log (long overdue! ;-) +// + +#include "jagdasm.h" + +#include #include "jaguar.h" #define ROPCODE(a) JaguarReadWord(a) @@ -5,7 +23,7 @@ uint8 convert_zero[32] = { 32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 }; -char * condition[32] = +const char * condition[32] = { "", "nz,", @@ -58,8 +76,9 @@ char * signed_16bit(int16 val) return temp; } -unsigned dasmjag(int dsp_type, char * buffer, unsigned pc) +unsigned dasmjag(int dsp_type, char * bufferOut, unsigned pc) { + char buffer[64]; int op = ROPCODE(pc); int reg1 = (op >> 5) & 31; int reg2 = op & 31; @@ -157,7 +176,7 @@ unsigned dasmjag(int dsp_type, char * buffer, unsigned pc) sprintf(buffer, "ADDQMOD $%X,R%02d", convert_zero[reg1], reg2); break; } - sprintf(buffer,"%-24s (%04X)", buffer, op); + sprintf(bufferOut,"%-24s (%04X)", buffer, op); return size; }