--- hatari/src/debug/vars.c 2019/04/09 08:56:47 1.1 +++ hatari/src/debug/vars.c 2019/04/09 08:59:18 1.1.1.3 @@ -17,8 +17,9 @@ const char Vars_fileid[] = "Hatari vars. #include "configuration.h" #include "stMemory.h" #include "m68000.h" -#include "screen.h" /* for defines needed by video.h */ -#include "video.h" /* for Hatari video variable addresses */ +#include "screen.h" /* for defines needed by video.h */ +#include "video.h" /* for Hatari video variable addresses */ +#include "hatari-glue.h" /* for currprefs */ #include "debugInfo.h" #include "debugcpu.h" @@ -29,6 +30,12 @@ const char Vars_fileid[] = "Hatari vars. #include "vars.h" +static Uint32 GetCycleCounter(void) +{ + /* 64-bit, so only lower 32-bits are returned */ + return CyclesGlobalClockCounter; +} + /* Accessor functions for calculated Hatari values */ static Uint32 GetLineCycles(void) { @@ -133,6 +140,14 @@ static Uint32 GetVdiOpcode(void) return INVALID_OPCODE; } +/** return first word in OS call parameters + */ +static Uint32 GetOsCallParam(void) +{ + /* skip OS call opcode */ + return STMemory_ReadWord(Regs[REG_A7]+SIZE_WORD); +} + static Uint32 GetNextPC(void) { return Disasm_GetNextPC(M68000_GetPC()); @@ -146,6 +161,7 @@ static const var_addr_t hatari_vars[] = { "BSS", (Uint32*)DebugInfo_GetBSS, VALUE_TYPE_FUNCTION32, 0, "invalid before Desktop is up" }, { "CpuInstr", (Uint32*)DebugCpu_InstrCount, VALUE_TYPE_FUNCTION32, 0, "CPU instructions count" }, { "CpuOpcodeType", (Uint32*)DebugCpu_OpcodeType, VALUE_TYPE_FUNCTION32, 0, "internal CPU instruction type" }, + { "CycleCounter", (Uint32*)GetCycleCounter, VALUE_TYPE_FUNCTION32, 0, "global cycles counter (lower 32 bits)" }, { "DATA", (Uint32*)DebugInfo_GetDATA, VALUE_TYPE_FUNCTION32, 0, "invalid before Desktop is up" }, #if ENABLE_DSP_EMU { "DspInstr", (Uint32*)DebugDsp_InstrCount, VALUE_TYPE_FUNCTION32, 0, "DSP instructions count" }, @@ -158,6 +174,7 @@ static const var_addr_t hatari_vars[] = { "LineCycles", (Uint32*)GetLineCycles, VALUE_TYPE_FUNCTION32, 0, "is always divisable by 4" }, { "LineFOpcode", (Uint32*)GetLineFOpcode, VALUE_TYPE_FUNCTION32, 16, "$FFFF when not on Line-F opcode" }, { "NextPC", (Uint32*)GetNextPC, VALUE_TYPE_FUNCTION32, 0, NULL }, + { "OsCallParam", (Uint32*)GetOsCallParam, VALUE_TYPE_FUNCTION32, 16, "word value, valid only on OS call opcode breakpoint" }, { "TEXT", (Uint32*)DebugInfo_GetTEXT, VALUE_TYPE_FUNCTION32, 0, "invalid before Desktop is up" }, { "TEXTEnd", (Uint32*)DebugInfo_GetTEXTEnd, VALUE_TYPE_FUNCTION32, 0, "invalid before Desktop is up" }, { "VBL", (Uint32*)&nVBLs, VALUE_TYPE_VAR32, sizeof(nVBLs)*8, NULL },