Login
Back to forumReply to this topicGo to last reply

Posted By

SVS
on 2003-10-17
 PLOT function from BASIC

I just discovered that the Kernal PLOT subroutine can be easy used by BASIC.
Did you already know this, pals?
It's important IMO, because of the essential lack of CBM BASIC that is not able to perform an x,y coordinate positioning.

Posted By

Gaia
on 2003-10-17
 Re: PLOT function from BASIC

Are you referring to the LOCATE command in BASIC? It surely has an entry point as any other commands.

Posted By

SVS
on 2003-10-17
 Re: PLOT function from BASIC

No, I don't. If I'm not wrong, LOCATE only works on Graphic mode. I referred to Text mode.

Posted By

JamesC
on 2003-10-17
 Re: PLOT function from BASIC

PLOT - (Kernal $FFF0) When called with the carry clear, sets the cursor position. The new cursor line number should be in .X, the new column should be in .Y; the screen window is returned to the default 40x25 screen. When called with the carry flag set, this routine returns the cursor position. (from the US Plus/4 PRG, page 315)

CHAR also locates the text cursor, and does so on both the text and graphic screens. CHAR uses standard text coordinates (0-39 and 0-24). However, if you use CHAR in split screen mode, the text will be printed on the graphic screen, even if the graphic area is covered by the text area (the 5 lines below the graphic area).

Posted By

SVS
on 2003-10-18
 Re: PLOT function from BASIC

By calling the PLOT Kernal routine, you can also *read* the current cursor position.
My discovery is that it can be well used by BASIC too, giving the results on $07F3 $07F4 (.x, .y).

Posted By

JamesC
on 2003-10-18
 Re: PLOT function from BASIC

Yes, I said we can also READ the location:
>When called with the carry flag set, this routine returns the cursor position. (from the US Plus/4 PRG, page 315)

However we can also PEEK(202) for the column and (205) for the row. This saves a BASIC programmer (like me) from having to learn machine language routines.

As I pointed out above, using PLOT destroys any text-screen windows you may have set (with ESC-T and ESC-B). By using CHAR and the PEEKs, the text window is preserved.

Posted By

SVS
on 2003-10-19
 Re: PLOT function from BASIC

Thank you James.
But a thing: CHAR resets the windows too.

About the locations I said, they are the standard input/output locations for a Basic SYS command. What I discovered is that by calling PLOT through a SYS DEC("FFF0") you will have at disposal the outputs *in the standard output locations* too (then you have not to learn RAM map).

Posted By

JamesC
on 2003-10-19
 Re: PLOT function from BASIC

SVS, doesn't BASIC automatically update these without having to call PLOT?

Posted By

SVS
on 2003-10-21
 Re: PLOT function from BASIC

sorry: when I said "standard output location" I did mean standard output for SYS command. This is nice because you don't need to know other specific addresses for each Kernal call.
And remember that PLOT is a bidirectional function (set/read).

Posted By

Lavina
on 2003-11-03
 Re: PLOT function from BASIC

hm, I always used char for positioning. I have not been in a need for position detection too often as a remember... happy

Posted By

Lavina
on 2003-11-03
 Re: PLOT function from BASIC

"As I remember". Sorry, I should really sleep more, my movement coordination is getting worse... happy happy

BTW, good find!

Posted By

SVS
on 2003-11-03
 Re: PLOT function from BASIC

The "news" of this function is to "read" the cursor position (also if inside a window) happy



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024