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

Get current charset #315

Open
stefan-b-jakobsson opened this issue May 7, 2022 · 2 comments
Open

Get current charset #315

stefan-b-jakobsson opened this issue May 7, 2022 · 2 comments
Labels
enhancement New feature or request [KERNAL] Part of KERNAL

Comments

@stefan-b-jakobsson
Copy link
Contributor

Hi,

It would be nice if the Kernal had a function to retrieve the current charset, that is one of the following:

  • PETSCII upper case/graphics
  • PETSCII lower case/upper case
  • ISO
  • Custom

Briefly looking at the Kernal "prt" code at kernal/cbm/editor.s:498, it seems the value in memory address $0372 ("mode") is used to distinguish between PETSCII and ISO mode.

I cannot see any easy way to tell if PETSCII upper case/graphics or PETSCII lower case/upper case is active. Maybe the use of the mode value could be changed to tell those apart as well.

@mist64 mist64 added documentation Improvements or additions to documentation enhancement New feature or request [KERNAL] Part of KERNAL and removed documentation Improvements or additions to documentation labels May 7, 2022
@mist64
Copy link
Collaborator

mist64 commented May 7, 2022

Can you describe a use case where you would need this?

@stefan-b-jakobsson
Copy link
Contributor Author

I have this use case: X16 Edit doesn't change charset when started. It tries to detect the current charset and continue using it. This is nice to the user, who may continue working in the preferred charset without need to select it again.

For now, X16 Edit detects the current charset by reading and comparing tile data. This method is not very future proof, should the character definitions change for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request [KERNAL] Part of KERNAL
Projects
None yet
Development

No branches or pull requests

2 participants