mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-12-21 02:32:06 +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:
|
case modeAccumulator:
|
||||||
t += fmt.Sprintf(" A")
|
t += fmt.Sprintf(" A")
|
||||||
case modeImmediate:
|
case modeImmediate:
|
||||||
t += fmt.Sprintf(" #%02x", line[1])
|
t += fmt.Sprintf(" #$%02x", line[1])
|
||||||
case modeZeroPage:
|
case modeZeroPage:
|
||||||
t += fmt.Sprintf(" $%02x", line[1])
|
t += fmt.Sprintf(" $%02x", line[1])
|
||||||
case modeZeroPageX:
|
case modeZeroPageX:
|
||||||
@ -144,7 +144,7 @@ func lineString(line []uint8, opcode opcode) string {
|
|||||||
case modeAbsoluteIndexedIndirectX:
|
case modeAbsoluteIndexedIndirectX:
|
||||||
t += fmt.Sprintf(" ($%04x,X)", getWordInLine(line))
|
t += fmt.Sprintf(" ($%04x,X)", getWordInLine(line))
|
||||||
case modeZeroPageAndRelative:
|
case modeZeroPageAndRelative:
|
||||||
t += fmt.Sprintf(" $%02x *%+x", line[1], int8(line[2]))
|
t += fmt.Sprintf(" $%02x %+x", line[1], int8(line[2]))
|
||||||
default:
|
default:
|
||||||
t += "UNKNOWN MODE"
|
t += "UNKNOWN MODE"
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ func (r *registers) updateFlagZN(t uint8) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r registers) String() string {
|
func (r registers) String() string {
|
||||||
return fmt.Sprintf("A: %#02x, X: %#02x, Y: %#02x, SP: %#02x, PC: %#04x, P: %#02x, (NV-BDIZC): %08b",
|
ch := (r.getA() & 0x3F) + 0x40
|
||||||
r.getA(), r.getX(), r.getY(), r.getSP(), r.getPC(), r.getP(), r.getP())
|
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