Skip to content
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

Wishlist: ability to easily read actual I/O mode (and maybe CPU speed as well) #777

Open
lgblgblgb opened this issue Jan 24, 2024 · 0 comments
Labels
enhancement A feature request or other kind of enhancement.

Comments

@lgblgblgb
Copy link
Contributor

lgblgblgb commented Jan 24, 2024

Is your feature request related to a problem? Please describe.

Sometimes there is need to query the actual I/O mode without any prior knowledge on that. Last time I saw this when someone wanted to write a debugger/monitor (sorry, I can't remember exactly), and wanted to display/get to know the actual I/O mode. Or maybe the same scenario but setting some MEGA65 specific thing: thus, the monitor/debugger must set MEGA65 I/O mode, do its thing, then restore the original I/O mode (so that should be queried before).

Similar but less serious issue: query the actual CPU speed. This one can be done, but very expensive, collecting "C128 fast", "C65 fast" and "MEGA65 fast" bits of various registers, and decode their meaning on certain combinations. Also the "speed gate" (the POKE 0,64 and 65) is something I am not even aware if can be queried at all (a program may want to know the actual speed set, even if it's overridden by the speed gate).

Describe the solution you'd like

For the first one: it's hard to find an I/O register which is available in all I/O modes. However we have one: $D02F the key register. Now, for sure, the behaviour of that register for writing shouldn't be bothered! However I mean about its meaning on reading. I am not sure, if it's a problem to change the read behaviour of the key register though. My idea is something like this:

  • of course, system's behaviour on writing $D02F shouldn't change!
  • reading $D02F though can return useful information which is available this way in all I/O modes without problem
  • read value:
    • bits 1-0: actual I/O mode, ie, C64, C65, MEGA65, MEGA65/Ethernet
    • bits 3-2: actual CPU speed set (thought this is maybe overridden currently by the speed gate!), ie: C64(1MHz), C128 fast (2MHz), C65 (3.5MHz), MEGA65 (40.5MHz)
    • bit 4: speed gate value
    • bits 7-5: reserved, or any other idea here?

Describe alternatives you've considered

Going to the corner of my room, and crying. :)

@lgblgblgb lgblgblgb added the new New report, not classified yet label Jan 24, 2024
@lydon42 lydon42 added enhancement A feature request or other kind of enhancement. and removed new New report, not classified yet labels Aug 18, 2024
@lydon42 lydon42 added this to the Steering Group milestone Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature request or other kind of enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants