-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MEGA65: D018 VIC-II hot register does not update lowercase/uppercase #381
Comments
You may need to use ROM 920384 to see the Run/Stop-Restore behavior. This looks like a VIC-II register issue, but the Run/Stop-Restore behavior was only noticed with the most recent ROM. (It was originally filed as a ROM issue: https://github.com/MEGA65/mega65-rom/issues/18 ) This appears to be an issue with the emulation of VIC-II hot registers, so I won't pursue a ROM change for now. |
@dansanderson Thanks for the report. At the first glance, it does not seem to have anything to do with the run/stop + restore directly, but indeed as you've also described, some generic VIC register emulation anomaly instead.
It upper case mode, I get: The interesting part here, that bit 0 (AFAIK!) is not used for anything. That's why it's always got back as set (in Xemu). Maybe MEGA65 handles that unused (?) bit differently though? In any way, I wouldn't say that's the problem here, though for sure it's better to have the same read-back value as on MEGA65. But the core of the issue - I think - it's not this, but how the charset info is updated on that by propagating though the hot-register "theory". By the way, this looks very interesting for me. ROM Also thanks to @gurcei to report the bug originally to |
Hmm, that's interesting:
This is the code fragment being used (I already moved one line around, but that's not the point here), when register The reason for that @dansanderson Please confirm, that you find this theory reasonable. As I noticed with the previous comment - I think - it's makes sense the problem here, that there should be no condition to "filter out" the "same value written" but always execute the stuff, which is needed when native VIC-IV and $D018 writes are "mixed" in time, thus the condition has the false assumption sometimes, that there is no change to deal with. Also I would make bit 0 being read as Looking the VHDL, I have the suspect that something very odd is going on, writing charptr via VIC-IV native way ("precise register") would also alter the result what $D018 will read (surely, only some bits of it). Maybe also true for screen address. I feel kind of unsecure about this whole logic though ... By the way: this problem can be manifest as a bug in the other similar case as well, when screen address is modified natively with VIC-IV native register then writing Thus, my supposed fix so far, what I need to test further:
|
Hmm, thinking again on the topic of reading back D018 should be MEGA65-accurate. Maybe I should read back the "precise" registers of VIC-IV through reading $D018, at least according to VHDL, that is what MEGA65 does, surely only the 4-4 bits of each at the right position. That would also solve the issue to be compatible show MEGA65 does the reading back business (including the "unused" bit 0 problem). But it feels still odd for me, that writing native VIC-IV registers have a "partial" effect on reading a legacy VIC-II register (ie some bits of the native ones only). |
Possibly of interest: I notice that POKE'ing 16 or 24 to $D069 also back-propagates a change to $D018 36 or 38. I also notice that if I |
$D018 behavour was kind of bad. The problems I have tried to fixed: 1. There was a condition to only propogate the change of $D018 if there was really a change on the written value compared to the previous. This seems to make sense, however this is wrong. As natively writing the "precise address" register can change the real address and the $D018 write does not aware it was changed thus there is no propogation. Fix: always propogate, no condition. 2. $D018 readback is based on $D018 value written before. This is also wrong, as according to the VHDL, it seems, the actual precise address is used to read by reading $D018, at least some bits of it. Fix: reading $D018 uses the precise addresses (both for video ptr and char ptr). Note: this may also fix another very similar issue with the video ptr, as it's the very same case, also in register $D018.
@dansanderson Oh, I forgot to react: thanks for your comment. Hopefully this problem has been fixed for now. If you still think there is some anomaly, please just re-open the issue, but I close it for now. |
Describe the bug
After I set the MEGA65 to lowercase by pressing Mega+Shift, when I type
POKE $D018,36
it returns to uppercase. This propagates to$D069
= 16 via the "hot register" as described in the Compendium page M-18. In Xemu, I can switch to lowercase with Option+Shift, but when I typePOKE $D018,36
it remains in lowercase.I also notice that
?PEEK($D018)
returns 37 in both cases, while the MEGA65 is 36 when upper and 38 when lower.$D069
correctly switches between 16 uppercase and 24 lowercase in both MEGA65 and Xemu.This was noticed because Run/Stop-Restore tries to return to uppercase by resetting the lower VIC-II registers, expecting hot register behavior. Going lowercase then pressing Run/Stop-Restore in MEGA65 returns to uppercase. In Xemu, it stays in lowercase.
Used version of the project
Version 20230201214849-master.
To Reproduce
Alternatively,
POKE $D018,36
to attempt to return to uppercase.Expected behavior
Should switch back to uppercase.
Computer/Device (please complete the following information):
The text was updated successfully, but these errors were encountered: