Commodore 128 Alive!

Commodore 128 => 128 programmers => Topic started by: MIRKOSOFT on June 15, 2009, 08:38 AM

Title: HOW TO CHECK THAT IS KEY "40/80 DISPLAY" PRESSED?
Post by: MIRKOSOFT on June 15, 2009, 08:38 AM
Hi!
I tried with PEEK(212) or PEEK(211) to check key which was pressed. Every key has any value, but...
I can't recognize if is key "40/80 DISPLAY" is PRESSED or its STATUS - that if is LOCKED DOWN or NOT...
All informations will be helpfull.
Thanks for answers.

Miro
Title: Re: HOW TO CHECK THAT IS KEY "40/80 DISPLAY" PRESSED?
Post by: megabit on June 15, 2009, 11:54 PM

The 40/80 DISPLAY switch is not part of the Keyscan routine. The 40/80 DISPLAY switch is read during the reset routine.

If you want to know what screen mode you are in, you can peek 215. If it is 0, then you are in 40-col mode. If it is 128, then you are in 80-col mode.

Dan...
Title: "40/80 DISPLAY" PRESSED- FOUND SOLUTION
Post by: MIRKOSOFT on June 16, 2009, 04:18 AM
Hi!

I found solution how to read status and check waiting for "40/80 DISPLAY" key.
It's stored at $D505, 7th bit. If is 1 then is not pressed, when is 0 then is locked down.
In Basic is it simple:
PEEK(54533)AND128 - 128=up/0=down

Miro
EhPortal 1.34 © 2025, WebDev