Debugger: Lua - Fix cycle not returning a 64-bit value in getState()

This commit is contained in:
Sour 2019-05-22 20:35:50 -04:00
parent a891307efc
commit 118f1ccb94
3 changed files with 4 additions and 3 deletions

View File

@ -24,6 +24,7 @@
#include "LabelManager.h"
#define lua_pushintvalue(name, value) lua_pushliteral(lua, #name); lua_pushinteger(lua, (int)value); lua_settable(lua, -3);
#define lua_pushint64value(name, value) lua_pushliteral(lua, #name); lua_pushinteger(lua, (int64_t)value); lua_settable(lua, -3);
#define lua_pushdoublevalue(name, value) lua_pushliteral(lua, #name); lua_pushnumber(lua, (double)value); lua_settable(lua, -3);
#define lua_pushboolvalue(name, value) lua_pushliteral(lua, #name); lua_pushboolean(lua, (int)value); lua_settable(lua, -3);
#define lua_pushstringvalue(name, value) lua_pushliteral(lua, #name); lua_pushstring(lua, value.c_str()); lua_settable(lua, -3);
@ -941,7 +942,7 @@ int LuaApi::GetState(lua_State *lua)
lua_starttable("cpu");
lua_pushintvalue(a, state.CPU.A);
lua_pushintvalue(cycleCount, state.CPU.CycleCount);
lua_pushint64value(cycleCount, state.CPU.CycleCount);
lua_pushintvalue(irqFlag, state.CPU.IRQFlag);
lua_pushboolvalue(nmiFlag, state.CPU.NMIFlag);
lua_pushintvalue(pc, state.CPU.PC);

View File

@ -20,7 +20,7 @@ chapter: false
status: int,
a: int,
irqFlag: int,
cycleCount: int,
cycleCount: int (64-bit, unsigned),
pc: int,
y: int,
x: int,

View File

@ -42,7 +42,7 @@ The following tags can be used to customize the format:
[Cycle]: The current PPU cycle.
[Scanline]: The current PPU scanline.
[FrameCount]: The current PPU frame.
[CycleCount]: The current CPU cycle (32-bit signed value, resets to 0 at power on)
[CycleCount]: The current CPU cycle (64-bit unsigned value, resets to 0 at power on)
```
You can also specify some options by using a comma. e.g: