--- hatari/src/debug/68kDisass.c 2019/04/09 08:49:26 1.1 +++ hatari/src/debug/68kDisass.c 2019/04/09 08:52:00 1.1.1.3 @@ -15,6 +15,7 @@ #include "main.h" #include "newcpu.h" #include "paths.h" +#include "profile.h" #include "tos.h" #include "68kDisass.h" @@ -31,12 +32,12 @@ typedef enum { static Diss68kOptions options = doptOpcodesSmall | doptRegisterSmall | doptStackSP | doptNoBrackets; // values <0 will hide the group -static int optionPosAddress = 0; // current address -static int optionPosHexdump = 10; // 16-bit words at this address -static int optionPosLabel = 35; // label, if defined -static int optionPosOpcode = 47; // opcode -static int optionPosOperand = 57; // operands for the opcode -static int optionPosComment = 82; // comment, if defined +static const int optionPosAddress = 0; // current address +static const int optionPosHexdump = 10; // 16-bit words at this address +static const int optionPosLabel = 35; // label, if defined +static const int optionPosOpcode = 47; // opcode +static const int optionPosOperand = 57; // operands for the opcode +static const int optionPosComment = 82; // comment, if defined /*** * Motorola 16-/32-Bit Microprocessor and coprocessor types @@ -325,7 +326,7 @@ static void Disass68kLoadSymbols(const static void Disass68kInit(const char *baseDirectory) { - char filename[PATH_MAX]; + char filename[FILENAME_MAX]; disStructCounts = 0; sprintf(filename, "%s/DisassStructs.txt", baseDirectory); @@ -2444,7 +2445,16 @@ static void Disass68k_loop (FILE *f, uae Disass68kComposeStr(lineBuffer, " ;", optionPosComment, 0); Disass68kComposeStr(lineBuffer, commentBuffer, optionPosComment+3, 0); } - + else if (optionPosComment >= 0) + { + /* assume comments are for things which aren't profiled */ + Uint32 count, cycles; + if (Profile_CpuAddressData(addr, &count, &cycles)) + { + sprintf(commentBuffer, "%d/%d times/cycles", count, cycles); + Disass68kComposeStr(lineBuffer, commentBuffer, optionPosComment+1, 0); + } + } fprintf(f, "%s\n", lineBuffer); // if(strstr(opcodeBuffer, "RTS") || strstr(opcodeBuffer, "RTE") || strstr(opcodeBuffer, "JMP") // || strstr(opcodeBuffer, "rts") || strstr(opcodeBuffer, "rte") || strstr(opcodeBuffer, "jmp"))