In x128, when b1c64mode.prg is executed, the mode setup code is copied to bank 1 $3800-. When Monitor is activated, it sees the byte $3800 as $2f, yet in memory it is really $a9 = 169 (LDA #). The copied code is otherwise listed correctly.
I was the last one to touch the monitor code that reads the memory for the D and M commands, but I think I traced this to something else.
To trace what the monitor is reading, I set a breakpoint at c128mem.c:mem_bank_peek()
-> case bank256_cpu:
-> mem_peek_with_config(mem_config which is 7
-> no special case applies, so at the bottom
-> mem_peek_with_config_c64(config
-> ram_peek_c64(addr)
I didn't write the 128 banking code (I just know it was much more complicated than previously thought) but I strongly suspect that these comparisons should be
Oh, and in the call from mem_peek_with_config_c64(config to ram_peek_c64(), the config parameter is lost and instead the global mem_config is used. That is incorrect, but will probably always work anyway since the only value for config that the monitor will ever use will be the current_config.
Last edit: Olaf Seibert 2023-12-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When the CPU I/O port $00 value is changed from $2f, then the address $3800 value in the monitor changes accordingly. Here the change is from $2f > $af = 175.
It worked in r43499 and r43787, but r44109 has the error. In the in-between r44070 b1c64mode.prg did not work.
Last edit: Jussi Ala-Könni 2023-12-27
Yes, I can reproduce it if I run
x128 -default b1c64mode.prg
, then go into the monitor:I was the last one to touch the monitor code that reads the memory for the
D
andM
commands, but I think I traced this to something else.To trace what the monitor is reading, I set a breakpoint at c128mem.c:mem_bank_peek()
-> case bank256_cpu:
-> mem_peek_with_config(mem_config which is 7
-> no special case applies, so at the bottom
-> mem_peek_with_config_c64(config
-> ram_peek_c64(addr)
I didn't write the 128 banking code (I just know it was much more complicated than previously thought) but I strongly suspect that these comparisons should be
@oldwoman37, do you agree?
Oh, and in the call from
mem_peek_with_config_c64(config
toram_peek_c64()
, theconfig
parameter is lost and instead the globalmem_config
is used. That is incorrect, but will probably always work anyway since the only value forconfig
that the monitor will ever use will be the current_config.Last edit: Olaf Seibert 2023-12-29
Yes, this seems like it would be a problem. Please go ahead and commit the change. My current changes would break everything else.
When the CPU I/O port $00 value is changed from $2f, then the address $3800 value in the monitor changes accordingly. Here the change is from $2f > $af = 175.
The error occurs in normal C64 mode as well.
Last edit: Jussi Ala-Könni 2023-12-30
I committed the proposed fix in r44940. Please retest when the build is available from https://github.com/VICE-Team/svn-mirror/releases . Thanks!
i tested it before, and it solved the issue for me. but i am no experienced user.
After a quick test I see no problems.
Great! I'll close this one then.