Thursday, February 18, 2016

Making IRR visible in the debugger

I thought, why not have the IRR visible in the debugger window. So adding the line

state_add( UPD7810_IRR, "IRR", m_irr).formatstr("%04X");

to upd7810.cpp

and

UPD7810_IRR to this enum in upd7810.h

enum
{
UPD7810_PC=1, UPD7810_SP, UPD7810_PSW,
UPD7810_EA, UPD7810_V, UPD7810_A, UPD7810_VA,
UPD7810_BC, UPD7810_B, UPD7810_C, UPD7810_DE, UPD7810_D, UPD7810_E, UPD7810_HL, UPD7810_H, UPD7810_L,
UPD7810_EA2, UPD7810_V2, UPD7810_A2, UPD7810_VA2,
...
UPD7810_LV0, UPD7810_LV1,
UPD7810_IRR
};


gives me this:



It shows up at the position you add it in the list in upd7810.cpp.

And one side effect of this is that now you can print this from the debugger, and use in tracelog:

print irr
printf "%04X",irr

No comments:

Post a Comment