Author Topic: How to check current charset mode - U/L CASE?  (Read 715 times)

0 Members and 1 Guest are viewing this topic.

Offline MIRKOSOFT

  • C128 user
  • ******
  • Posts: 809
  • Age: 33
  • Location: Zvolen
  • Activity:
    4.8%
  • Country: sk
  • Reputation: 188
  • Gender: Male
  • C128 programmer
  • With us since: 13/02/2009
    YearsYearsYearsYears
    • View Profile
    • MIRKOSOFT
How to check current charset mode - U/L CASE?
« on: April 20, 2012, 03:11 PM »
Hi!

I have simple Q:

I need to know current charset mode, if is UpperCase or LowerCase...

In case of VDC mode - need to know which case is used, then switch to UpperCase, send character and switch to known state before sending character...

Can anybody help me?

Many many thanks for every help, reply or comments.

Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster, more intelligent and more powerful... is targetted to programmation...

64ever 128her
sixty-for-ever one-twenty-either

C128 = C64² + more

http://www.mirkosoft.sk

Offline Dirk Vroomen

  • KIM-1 user
  • **
  • Posts: 36
  • Age: 47
  • Location: Germany
  • Activity:
    0%
  • Country: de
  • Reputation: 3
  • Gender: Male
  • C128 - Developer
  • With us since: 18/05/2011
    YearsYears
    • View Profile
Re: How to check current charset mode - U/L CASE?
« Reply #1 on: April 20, 2012, 05:26 PM »
Hi Miro!

For 40 columns: check value of address 53272

For 80 columns: current attributes for char in address 241:
For charset-detection check if bit 7 is set or not.

Best regards,
Dirk

Offline MIRKOSOFT

  • C128 user
  • ******
  • Posts: 809
  • Age: 33
  • Location: Zvolen
  • Activity:
    4.8%
  • Country: sk
  • Reputation: 188
  • Gender: Male
  • C128 programmer
  • With us since: 13/02/2009
    YearsYearsYearsYears
    • View Profile
    • MIRKOSOFT
Re: How to check current charset mode - U/L CASE?
« Reply #2 on: April 20, 2012, 05:50 PM »
Hi Dirk!

Thank you very much...

VDC mode works really perfect...

In case of VIC mode it is impossible to check 53272 'cause if are shadow registers of VIC turned off, 53272 holds position of charset for VIC...

e.g. if is 24 - then is charset at 8192 - 10239

So, there's no way to check...

but what I need really is your help.

Eslse again many many thanks.

Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster, more intelligent and more powerful... is targetted to programmation...

64ever 128her
sixty-for-ever one-twenty-either

C128 = C64² + more

http://www.mirkosoft.sk

Offline Hydrophilic

  • 128D user
  • *******
  • Posts: 1225
  • Age: 41
  • Location: Earth... still!
  • Activity:
    2.2%
  • Reputation: 232
  • Gender: Male
  • With us since: 25/01/2007
    YearsYearsYearsYearsYearsYears
    • View Profile
    • H2Obsesson
Re: How to check current charset mode - U/L CASE?
« Reply #3 on: April 21, 2012, 05:34 AM »
I agree with Dirk Vroomen.  Check $d018 (53272).  If bit 1 is set then upper/lower case, if bit 1 is clear then upper/graphic.
Code: [Select]
LDA $D018
AND #2
BNE upper_lower
;else upper_graphic
Shadow register does not matter if all you want to do is check the video mode.

Quote from: MIRKOSOFT
if is 24 - then is charset at 8192 ...
24 = $18 then charset at $2000... that is not right!!  Charset must be at $1000 or $1800 (unless using custom font, in which case changing upper/lower/graphic does not apply).

Are you trying to change the charset in Bitmap mode???  In bitmap mode, the 'charset' points to $2000 but of course it is a bitmap (and not text) so changing upper/lower/graphic does not apply.

Maybe you are trying to change charset in split-screen mode (both bitmap and text) ???
If that is the case, then shadow register would be important.  In that case check $a2c (2604) bit 1.  It should have value $14 (20) in upper/graphic mode or value $16 (22) in upper/lower case.

If you are not using standard text mode, then you should say it so people can post accordingly.
« Last Edit: April 21, 2012, 05:53 AM by Hydrophilic »
I'm kupo for kupo nuts!

 



Back to top