Disable ASCII/DIN? (CAPS LOCK)

Started by MIRKOSOFT, February 22, 2011, 09:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MIRKOSOFT

Hi!


I don't know how to write this Q...


As first: I want to use CAPS LOCK function on German C128DCR - no problem:



lda $0ac5
ora #$80
sta $0ac5



but... this enables layout of International (or US) keyboard and CHANGES THE FONT TO GERMAN!


So, here's the problem.
I set up my own Slovak layout and applied CAPS function.
In VIC mode is no problem - my charset is located at $2000 - $27ff, so, is not overwritten. Sure is that standard location is overvritten.
I'm not using VIC mode only, so the layout is the same also in VDC.
I copied my charset at $2000 - 3fff (so, at standard location), even in 16kB VDC is not possible locate it other, and then I press ASCII/DIN as CAPS LOCK...
BIG PROBLEM: my charset is overwritten and layout disorder chars - so, I turn off ASCII/DIN.
This does no other than copies International charset to the same location.
But my set layout can not display correct characters.


So, it looks like ASCII/DIN as CAPS LOCK in other layouts is not possible - I mean is.


But else one problem:


I'm working with full size of VDC RAM and if I set bitmap mode and for example set bitmap at $2000 and then press ASCII/DIN, it rewrites bitmap!!!!


Yes, VDC has registers to locate charsets to other location, but system copies everytime to standard location...


So, IS POSSIBLE TO TURN OFF OVERWRITTING (CHANGING) FONTS?


I have some tips, I tried to disable ASCII/DIN - but first pressing copies German charset and then is disabled....


Tips are here:



SYSTEM KEY=PEEK(211) - everybody knows
0  - normal
1  - SHIFT
2  - Commodore
4  - Control
8  - ALT
16 - CAPS LOCK or ASCII/DIN or ASCII/CC




ASCII/DIN (ASCII/CC) to CAPS LOCK:
----------------------------------------------




You do the disabling by setting bit 7 in the memory location at address $0AC5 equal to 1. One side effect of doing this is that if you do it when the ASCII/CC or ASCII/DIN key is not pressed and afterwards press the key, you will get the same effect as when pressing the CAPS LOCK key on an international keyboard, i.e. letter keys will be SHIFTed while numbers will not be SHIFTed, but national charset will be shown.




lda $0ac5
ora #$80
sta $0ac5



SWITCHER ASCII/DIN TO CAPS LOCK
---------------------------------------------

lda $0ac5
eor #$80
sta $0ac5



Disabling key / setting chasets
----------------------------
ASCII/DIN should be Bit 6 of the CPUs I/O Port at $0001. 1=ASCII/0=DIN
This bit is used to select either the ASCII or the DIN character ROM of a C128. When data direction is set to INPUT, the charset is selected externally with the ASCII/DIN key.



poke0,peek(0)or64:poke1,peek(1)and191 = national font
poke0,peek(0)and191:poke1,peek(1)or64 = standard font


poke0,111 - sets output on adress $0000 - not possible to switch ASCII/CAPS - but first hit of ASCII/CAPS works - ths is the problem
poke0,47 - sets input on adress $0000 - ASCII/CAPS enabled


poke1,51 = national font
poke1,115 = standard font


So, in summary: WHAT I NEED TO DO?


DISABLE OVERWRITTING CHARSETS IN VDC (AND IF IS POSSIBLE IN VIC).


Many many thanks for every reply!


Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

Hydrophilic

It sounds like you are on the right track... if you store $80 into $ac5 (BANK 0: POKE 2757, 128), then the KERNAL will not clobber VDC RAM with character updates.

As for the VIC, you have discovered that you can POKE the font you want, but the user can over-ride by pressing ASCII/DIN.  This is because you, as programmer, can only force the value to 0v.  You can not force the voltage to +5v.  So if you poke to get the +5v (standard character set), the user always can press ASCII/DIN and force it back to 0v.  The only sure way to prevent this, is to open the computer and disconnect the ASCII/DIN line from the CHAR ROM.

But this is only a problem for VIC if you use ROM for characters.  You can load your own charset into RAM, and tell VIC to use that... then ASCII/DIN will not change the VIC font.

For example, if you copy a font to RAM at $2000~$27FF and you want the VIC text at standard location ($400), then you can try this:

BANK 15 : REM JUST IN CASE
POKE 217,4 : REM DISABLE CHAR ROM IN TEXT MODE
POKE 2604, 24: REM TEXT AT $400, FONT AT $2000

For more info, consult C128 Programmers Reference Guide or Mapping the C128 and lookup locations $D9 and $A2C.

Good luck!
I'm kupo for kupo nuts!

MIRKOSOFT

Thank you Robert!


It's really great tip!


All what I wanter is disabling overwritting VDC charset---


I applied CAPS LOCK for ASCII/DIN and VDC charset is ok, layout also!


My surprise - ever when I applied this CAPS I was working in VIC mode....


And the memory $1000 - $1800 has no copied charset by bit2...


MANY THANKS!




Else one thing:


CAN YOU HELP ME WITH DIFFERENCES OF VDC IN VICE AND REAL COMPUTER?
i HAVE SOON FINISHED DEMO OF ACE128 AND I GIVE YOU SOURCE CODE OF DEMO, WHERE I DO MISTAKE...
In VICE works totally correctly, on REAL MACHINE not! (64kB VDC RAM).


CAN YOU?


Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

Hydrophilic

Glad the ASCII/DIN tips helped.  I can't help much with VDC, unless you need 16kRAM testing.  I have original 128 with only 16k VRAM.  I bought some 64K chips over a year ago, but still haven't found the time to install them... busy, busy, busy!
I'm kupo for kupo nuts!

MIRKOSOFT

Hi Robert!


So, here's problem, ACE128 TOS will need full 64kB VDC RAM.
True is that demo contain not any part of code for OS, only DEMO routines, but have problem to run it correctly on REAL machine.
In VICE works perfectly.


You can help me also in the way that you will check my source code... (has good description in syntax of KickAssembler - no problem, easy syntax)
If you find any bug, you can correct it with description of error. Also, if you can and know anybody who wants to be in TEAM and can test it, it's in your choice.


IS it possible?


Of course - you and everybody who will work with OS will be in CREDITS.


Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

MIRKOSOFT

So, Robert...


You know functions BLOCK-COPY and BLOCK.WRITE in VDC...


Maybe this makes my problems... look in PM
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk