Closed jasin closed 5 years ago
It should also be noted that the documentation and the program don't coincide
reset will clear breakpoints, not just labels
PC AC XR YR SP NV-BDIZC
6502: f102 00 ff 00 f9 10110100
.reset
PC AC XR YR SP NV-BDIZC
6502: 0000 00 00 00 ff 00110000
.show_breakpoints
Breakpoint 0: $F100
Breakpoint 1: $F101
Breakpoint 2: $F102
Jasin,
This is expected behavior for py65mon, as the input and output locations are at $F001 and $F004 by default.
The funny character you see is whatever was written to $F001, while $F004 will read back as a BRK (ASCII value 0) when a key has not been pressed. The input and output is handled at the memory level, so these addresses will respond that way even if it's the monitor loading or reading those addresses.
To solve your problem, see the top of "py65/monitor.py" where it says:
py65mon -- interact with a simulated 6502-based system
Usage: %s [options]
Options:
-h, --help : Show this message
-m, --mpu <device> : Choose which MPU device (default is 6502)
-l, --load <file> : Load a file at address 0
-r, --rom <file> : Load a rom at the top of address space and reset into it
-g, --goto <address> : Perform a goto command after loading any files
-i, --input <address> : define location of getc (default $f004)
-o, --output <address> : define location of putc (default $f001)
If you use the -i and -o options to provide new addresses (that aren't used by your ROM) then it should behave as you are expecting it to.
Thanks for fielding this @SamCoVT!
I've found a rather weird bug, I can't really explain it but maybe these code segments will help. But loading the same binary file to two different addresses leaves different results. Specifically to $f000 is broke. I've tried $0000, $0100, $f100 with success. It seems to be just $f000 that is causing the issue.
notice the weird character before wrote and the weird instruction at $f004:$f005
while any other address i use to load works...