mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-10-13 09:23:49 +00:00
Improve trace
This commit is contained in:
parent
38a187ee5b
commit
b9dbcc43a8
@ -117,7 +117,7 @@ func lineString(line []uint8, opcode opcode) string {
|
||||
case modeAccumulator:
|
||||
t += fmt.Sprintf(" A")
|
||||
case modeImmediate:
|
||||
t += fmt.Sprintf(" #%02x", line[1])
|
||||
t += fmt.Sprintf(" #$%02x", line[1])
|
||||
case modeZeroPage:
|
||||
t += fmt.Sprintf(" $%02x", line[1])
|
||||
case modeZeroPageX:
|
||||
@ -144,7 +144,7 @@ func lineString(line []uint8, opcode opcode) string {
|
||||
case modeAbsoluteIndexedIndirectX:
|
||||
t += fmt.Sprintf(" ($%04x,X)", getWordInLine(line))
|
||||
case modeZeroPageAndRelative:
|
||||
t += fmt.Sprintf(" $%02x *%+x", line[1], int8(line[2]))
|
||||
t += fmt.Sprintf(" $%02x %+x", line[1], int8(line[2]))
|
||||
default:
|
||||
t += "UNKNOWN MODE"
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ func (r *registers) updateFlagZN(t uint8) {
|
||||
}
|
||||
|
||||
func (r registers) String() string {
|
||||
return fmt.Sprintf("A: %#02x, X: %#02x, Y: %#02x, SP: %#02x, PC: %#04x, P: %#02x, (NV-BDIZC): %08b",
|
||||
r.getA(), r.getX(), r.getY(), r.getSP(), r.getPC(), r.getP(), r.getP())
|
||||
ch := (r.getA() & 0x3F) + 0x40
|
||||
return fmt.Sprintf("A: %#02x(%v), X: %#02x, Y: %#02x, SP: %#02x, PC: %#04x, P: %#02x, (NV-BDIZC): %08b",
|
||||
r.getA(), string(ch), r.getX(), r.getY(), r.getSP(), r.getPC(), r.getP(), r.getP())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user