Next print location on the screen [message #83293] |
Mon, 10 June 2013 21:28 |
cfj
Messages: 7 Registered: June 2013
Karma: 0
|
Junior Member |
|
|
Message-ID: <2@omovax.UUCP>
Date: Wed, 19-Dec-84 18:48:51 EST
Article-I.D.: omovax.2
Posted: Wed Dec 19 18:48:51 1984
Date-Received: Sun, 30-Dec-84 00:10:44 EST
Distribution: net
Organization: Intel Corp., Hillsboro, OR
Lines: 16
Does anyone know, which memory locations control where the next
position that characters will be printed at on the C-64 ?
I believe 211 (decimal) controls which column but I haven't been
able to find out what controls which line.
I'm trying to write a function which will print anywhere on the screen
without using the cursor controls or poking directly to the screen.
Thanks,
Charles Johnson
Hillsboro, OR
P.S. I have a copy of the programmer's manual, but their descriptions
of the memory map is not that great.
|
|
|
Re: Next print location on the screen [message #83297 is a reply to message #83293] |
Mon, 10 June 2013 21:28 |
calway
Messages: 25 Registered: May 2013
Karma: 0
|
Junior Member |
|
|
Message-ID: <425@ecsvax.UUCP>
Date: Sun, 30-Dec-84 16:52:37 EST
Article-I.D.: ecsvax.425
Posted: Sun Dec 30 16:52:37 1984
Date-Received: Tue, 1-Jan-85 00:16:46 EST
References: <2@omovax.UUCP>
Organization: The News and Observer
Lines: 17
x
The PLOT routine in the kernal ($FFF0 or65520) will position the cursor for you. Load the Y register with the column number, 0-39, and the X resister with the row number, 0-24, clear the carry flag and JSR to FFF0.
If you want to do that from BASIC, you can poke the Y value into 782 and the X value into 781. I don't know how to clear the carry flag except to SYS to a short routine that contains these numbers:
24,76,240,255
This will jump to FFFO for you and then return to BASIC.
--
James Calloway
The News and Observer
Box 191
Raleigh, N.C. 27602
(919) 829-4570
{akgua,decvax}!mcnc!ecsvax!calway
|
|
|
Re: Next print location on the screen [message #85960 is a reply to message #83293] |
Mon, 17 June 2013 17:35 |
grant
Messages: 8 Registered: May 2013
Karma: 0
|
Junior Member |
|
|
Message-ID: <18900003@hp-pcd.UUCP>
Date: Sat, 12-Jan-85 15:21:00 EST
Article-I.D.: hp-pcd.18900003
Posted: Sat Jan 12 15:21:00 1985
Date-Received: Sat, 5-Jan-85 03:58:14 EST
References: <2@omovax.UUCP>
Organization: Hewlett-Packard - Corvallis, OR
Lines: 20
Nf-ID: #R:omovax:-200:hpcvrd:18900003:000:976
Nf-From: hpcvrd!grant Jan 2 12:21:00 1985
{}
you can set/clear the carry for a BASIC SYS call by writing an
appropriate value (0 for clear, 1 for set, I think) into the PSW
location (similar to the X, Y, and A locations). I think its address
is 784, but I don't have my documentation here. When you do a SYS,
the X, Y, A registers and the PSW are all loaded from their respective
locations before the user routine is called. When the routine is
finished, the registers and PSW are saved back into their locations
before BASIC resumes. This means that BASIC can both send and receive
parameters to/from the ML.
For example, if you set the carry before calling PLOT, the cursur's
row and column will be returned to you.
One warning: PLOT may give funny results if the cursor is on. It
may move to a new spot while the screen is reversed, leaving an
inverse character and possibly a funny color under its old position.
(It is possible that I am confusing PLOT with just trying to turn the
cursor on in BASIC.)
|
|
|
Re: Next print location on the screen [message #85961 is a reply to message #83293] |
Mon, 17 June 2013 17:35 |
joels
Messages: 20 Registered: May 2013
Karma: 0
|
Junior Member |
|
|
Message-ID: <78@tektools.UUCP>
Date: Wed, 2-Jan-85 11:21:45 EST
Article-I.D.: tektools.78
Posted: Wed Jan 2 11:21:45 1985
Date-Received: Sun, 6-Jan-85 00:06:38 EST
References: <2@omovax.UUCP> <425@ecsvax.UUCP>
Organization: Tektronix, Beaverton OR
Lines: 19
> x
> The PLOT routine in the kernal ($FFF0 or65520) will position the cursor for you. Load the Y register with the column number, 0-39, and the X resister with the row number, 0-24, clear the carry flag and JSR to FFF0.
>
> If you want to do that from BASIC, you can poke the Y value into 782 and the X value into 781. I don't know how to clear the carry flag except to SYS to a short routine that contains these numbers:
> 24,76,240,255
>
> This will jump to FFFO for you and then return to BASIC.
Location 783 is the initial P reg for SYS calls. To clear carry (and all other
flags) poke a 0 here. Location 780 passes the A reg. All 4 locations can be
peeked after retrurn from the SYS to see the contents of the registers after
the ML subroutine has executed.
Joel Swank
Software Center Tools Support
50-487
Tektronix
Beaverton OR 97077
(503) 627-4403
|
|
|
Re: Next print location on the screen [message #85966 is a reply to message #83293] |
Mon, 17 June 2013 17:35 |
calway
Messages: 25 Registered: May 2013
Karma: 0
|
Junior Member |
|
|
Message-ID: <461@ecsvax.UUCP>
Date: Sat, 5-Jan-85 14:51:48 EST
Article-I.D.: ecsvax.461
Posted: Sat Jan 5 14:51:48 1985
Date-Received: Mon, 7-Jan-85 02:14:36 EST
References: <2@omovax.UUCP>, <18900003@hp-pcd.UUCP>
Organization: The News and Observer
Lines: 17
x
Good point. If the cursor is on while you call the PLOT routine, it sometimes gets caught by the interrupt, causing some screen locations visited by the cursor
to switch to reverse video.
You will need a short ML routine that turns off the interrupt, corrects the cursor if necessary, calls PLOT and then turns the interrupt back on.
I have something like that lying around. If I can find it, I will post it.
Thanks for the tip on the status register (location 784). My Programmer's Reference Guide lists it as "SP" which I took to mean stack pointer. Should have known.
--
James Calloway
The News and Observer
Box 191
Raleigh, N.C. 27602
(919) 829-4570
{akgua,decvax}!mcnc!ecsvax!calway
|
|
|
Re: Next print location on the screen [message #85969 is a reply to message #83293] |
Mon, 17 June 2013 17:35 |
calway
Messages: 25 Registered: May 2013
Karma: 0
|
Junior Member |
|
|
Message-ID: <465@ecsvax.UUCP>
Date: Sun, 6-Jan-85 16:23:20 EST
Article-I.D.: ecsvax.465
Posted: Sun Jan 6 16:23:20 1985
Date-Received: Tue, 8-Jan-85 02:58:43 EST
References: <2@omovax.UUCP>, <18900003@hp-pcd.UUCP>, <461@ecsvax.UUCP>
Organization: The News and Observer
Lines: 51
x
Below is a ML routine that will move the cursor without leaving parts of the
screen in reverse video. The only instance I have found in which it does not work is on line 24, the last line (starting with 0). I'm not sure why.
The routine assumes you already have loaded the X register with the row number
(0-24) and the Y register with the column number (0-39).
SEI
LDA $CF
BNE fixcrsr
CLC
goplot JSR FFF0
CLI
RTS
fixcrsr LDA #$01
STA $CD
ckagain CLI
NOP
NOP
NOP
NOP
NOP
SEI
LDA $CF
BNE ckagain
CLC
BCC goplot
This can be used with BASIC. Select an address that is safe from BASIC and POKE
the following numbers into memory:
120,165,207,208,6,24,
32,240,255,88,96,169,
1,133,205,88,234,234,234,
234,234,120,165,207,208,
245,24,144,233
From BASIC you can POKE the column number into 782 and the row number into 781.
Then SYS to the address you chose for the routine. It will move the cursor and
return to BASIC.
--
James Calloway
The News and Observer
Box 191
Raleigh, N.C. 27602
(919) 829-4570
{akgua,decvax}!mcnc!ecsvax!calway
|
|
|