Commodore 128 Alive!

Commodore 128 => 128 programmers => Assembly => Topic started by: MIRKOSOFT on July 24, 2009, 02:57 AM

Title: Exists routine "CHARACTER UNDER CURSOR"?
Post by: MIRKOSOFT on July 24, 2009, 02:57 AM
Hi!
I need to read chars on screen where is cursor.
e.g. cursor at position line 2, column 10 - which character is at this position?
Yes, I know that it can be done through reading address in screen memory, but I want to have it independent of any memory range.
I know st. about C128 Editor JUMP Table, there's routine:
$C009 LOOP5 - reads key to Accumultor from screenline
But I need to place cursor on any position and get character where cursor is.
Positioning is no problem (KERNAL routine PLOT - $FFF0).
Can anybody help me?
Thanks for every reply.
Miro
Title: Re: Exists routine "CHARACTER UNDER CURSOR"?
Post by: cbmguy on September 06, 2009, 02:44 AM
Kernal locations $0A29 for the VIC II hold the screen code under the cursor.   With the VDC, you might have to set things up explicitly first....  I have no map in front of me right now, but I can look at my old libraries for this--I remember doing this years ago.  Note that $0A29 is the screen code, not the PETSCII code.

C
Title: Re: Exists routine "CHARACTER UNDER CURSOR"?
Post by: cbmguy on September 06, 2009, 02:49 AM
Looks like the READCHR @ $CB58 will do what you want for both the VDC and the VIC II.  Screen code is in the Accumulator.  It's attribute is left @ address $F2.  Let me know if this works for ya.

Cheers,

C
Title: Re:Yes, works!
Post by: MIRKOSOFT on September 06, 2009, 03:14 AM
Hi!

Thanks.
Works correctly, really thanks. It's perfect for VIC-II and VDC.
Attribute works only with VIC-II. At VDC maybe it can be to find in other location than $F2.

Very, very thanks.

Cheers,

Miro
Title: Re: Exists routine "CHARACTER UNDER CURSOR"?
Post by: cbmguy on September 06, 2009, 08:58 AM
There is location $0A33 (CURCOL) that allows for VDC attribute info corresponding to the VDC cursor position.  VDC attributes: lower nibble holds the colour, bit 4=flashing, bit 5=underline, bit 6=reversed, bit 7=character set (set=lowercase, cleared=uppercase)

C
EhPortal 1.34 © 2025, WebDev