-
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+C65: new findings about how C65 memory management works for real #378
Comments
lgblgblgb
added a commit
that referenced
this issue
Mar 15, 2024
It seems to work without too much testing yet. The bad news though: it's seems to a be a bit slower than the old one :( I expected to opposite. This also uses the baking/mapping behaviour as mentioned in #378
lgblgblgb
added a commit
that referenced
this issue
Mar 19, 2024
More optimizations and modifications: * It seems the old method is superior: using linear addresses to the actual slot backend readers/writers * Introducing optional data-pointer driven mechanism for further emulation performance * Unfinished "memory-watch" mode * Various minor modifications and/or optimizations
Closed for the MEGA65 side of the story, as the in-development new memory decoder (#209) already uses it. Still this issue is remain open for the C65 emulator for now. |
lgblgblgb
added a commit
that referenced
this issue
May 12, 2024
This quite big change rewrites the MEGA65 emulation memory decoder subsystem. Some of the reasons: * Create a new, not overcomplicated decoder which can be understood at all without major headache, and can be also faster as per #209 * Taking account some new findings about how C65 worked (both Xemu and MEGA65 was wrong here) and adopted since then by MEGA65 as per #378 * More about the future (not ready in this commit): allow functionality for debugger implementation "watchmem" which can monitor about every memory r/w events debugger want to check as per #11 This commit is quite big as was mentioned, and may introduce some regressions. So it's important to have feedback in those cases. Also it changes the behaviour of memory decoding (#378). The new decoder seems to be already faster than the old one and more easy to understand and maintain. Also there is some room for future improvements still in every areas, including optimizations. The "memwatch" part currently is not usable though, but the basis are there to be able to implement that at all (wouldn't be possible with the older scheme).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ki-bo studying C65's memory management (running test programs on real C65) found several interesting facts and difference from the implementation done by MEGA65-core (also Xemu, in both of its C65 and MEGA65 emulator targets!).
See: MEGA65/mega65-core#712
And commit: MEGA65/mega65-core#718
Note: implementation in the MEGA65 emulator should be done with some "renovation" (rewrite ...) of the memory decoding (the current one is very messy, hard to maintain, slow, and very error-prone). See: #209
This issue is here for me, to make myself sure, won't forget this :)
The scheme
Loosely based on ki-bo's description.
MAP
MAP
has the higher priority. If a memory block isMAP
ed, not even the$D030
-based ROM mapping can override. Current (bad) behaviour:$D030
ROM mapping can overrideMAP
.CPU I/O port (addr 0/1)
Only there, if the 0th block is not
MAP
ed. Current (bad) behaviour: 0/1 is always there, even if 0th block isMAP
ed. Also, RAM is never written "behind" the CPU I/O port if CPU I/O port is visible.D030 (VIC-III) ROM mapping
MAP
as discussed above.$2XXXX
, never from$3XXXX
$D030
based ROM mapping are similar, and never conflictMEGA65 ROM protection question
MEGA65 only: what would happen if ROM is not write protected, this is a question we (MEGA65 team) can decided, as it's not limited by C65-correctness (on C65, ROM is always ROM, thus "write protected", we can say).
So, what's the behaviour in case of removed ROM protection with D030 ROM mapping?
Nothing changes it seems, the decision with MEGA65 to still write the underlying RAM in that case.
Original info:
MEGA65/mega65-core#712 (comment)
Banking behaviour question
$D030
based ROM banking and the "C64-way" banking never conflicts, however a question arises. Is there an "OR" condition between them? Ie, if C64 KERNAL is banked-in, it can be achieved with all the three combinations of:I suppose it's true, and all of three would yield in banking KERNAL in (unless the last 8K is not MAP'ed of course, since then it has the priority over banking). However - I assume - there is no cross-cause effect, ie, if CPU I/O port instructs banking KERNAL, the $D030's $E000 banking won't change, but the overall effect of those bits is "KERNAL is BANKed" if any (or both) source is set alone.
The text was updated successfully, but these errors were encountered: