Re-adding support for traceback
This commit is contained in:
parent
5170f5e983
commit
f70db77e69
|
@ -262,6 +262,22 @@ loop:
|
|||
|
||||
if ( clock_count >= clock_limit ) [[unlikely]] goto stop;
|
||||
|
||||
// If traceback support is enabled, trigger it here
|
||||
#ifdef _QUICKERNES_ENABLE_TRACEBACK_SUPPORT
|
||||
if (tracecb)
|
||||
{
|
||||
unsigned int scratch[7];
|
||||
scratch[0] = a;
|
||||
scratch[1] = x;
|
||||
scratch[2] = y;
|
||||
scratch[3] = sp;
|
||||
scratch[4] = pc - 1;
|
||||
scratch[5] = status;
|
||||
scratch[6] = opcode;
|
||||
tracecb(scratch);
|
||||
}
|
||||
#endif
|
||||
|
||||
clock_count += clock_table [opcode];
|
||||
|
||||
switch ( opcode )
|
||||
|
|
|
@ -14,6 +14,14 @@ typedef unsigned nes_addr_t; // 16-bit address
|
|||
class Cpu
|
||||
{
|
||||
public:
|
||||
|
||||
void set_tracecb(void (*cb)(unsigned int *data))
|
||||
{
|
||||
tracecb = cb;
|
||||
}
|
||||
|
||||
void (*tracecb)(unsigned int *dest);
|
||||
|
||||
// NES 6502 registers. *Not* kept updated during a call to run().
|
||||
struct registers_t
|
||||
{
|
||||
|
|
|
@ -45,6 +45,7 @@ class Emu
|
|||
const uint8_t *getHostPixels() const { return emu.ppu.host_pixels; }
|
||||
|
||||
int get_joypad_read_count() const { return emu.joypad_read_count; }
|
||||
void set_tracecb(void (*cb)(unsigned int *dest)) { emu.set_tracecb(cb); }
|
||||
|
||||
// Save emulator state variants
|
||||
void serializeState(jaffarCommon::serializer::Base& serializer) const { emu.serializeState(serializer); }
|
||||
|
|
Loading…
Reference in New Issue