SCRN function for Hires screen from BASIC
you call this from basic. it returns the state of a pixel
on the hires screen (1 for on, 0 for off)
BRUN it from BASIC (this sets up the ampersand command) and then
6040 X = 100:Y = 100
6050 & A = X,Y
6060 PRINT A
call it from BASIC. it uses the ampersand command & for interface
to BASIC. the above code will set BASIC variable A to the state
of the pixel at X,Y
;HIRES SCRN FUNCTIN
;FROM ROBOTIC ARM PROJECTS
;BOOK.
;SEPTEMBER 9 2003 IN SATAN HELLE
ORG $30A
FRMEVL EQU $DD7B
FRMNUM EQU $E752
LOW EQU $50
HIGH EQU $51
CHRGOT EQU $B1
POS EQU $F411
INDEX EQU $E5
MASK EQU $30
SETFAC EQU $EAF9
NEWSTT EQU $D7D2
AMPER EQU $3F6
PTRGET EQU $DFE3
FORPNT EQU $85
SYNCHR EQU $DEC0
BASE EQU $26
FLTACC EQU $EB93
SETFOR EQU $EB27
HIRCOR EQU $F6B9
COLD LDA #START
STA AMPER+1
RTS
START JSR PTRGET ; GET VAR
STA FORPNT
STY FORPNT+1
LDA #$D0 ;=
JSR SYNCHR ;CHECK FOR =
JSR HIRCOR ;READ COORDINATES
JSR POS ;CONVERT TO ADDRESS
LDY INDEX
LDA (BASE),Y ;GET HIRES BYTE
AND MASK ;CHECK PROPER BYTE
AND #$7F ;CLEAR COLOR BIT
BEQ PTONE
LDA #1 ;SHOW SET
PTONE JSR FLTACC ;FLOAT ACC
JSR SETFOR ;MOVE ACC TO VARIABLE
RTS ;BACK TO BASIC
to hplot a pixel from assembly: https://rich12345.tripod.com/prog/hplotassy.html
Problem with & under prodos
DSK image of Dos 3.3 Merlin with source code
there is the disk.
dos3.3 DSK image
load the dsk image in an emulator, BOOT
Type L to load
Type HIRESCRN
Type E
Look at the source code
Type CONTROL-Q
type ASM
type Q
type O
Type HIRESCRN
exit merlin
]BRUN HIRESCRN
]call -151
*0800 L
*3f4L
3f4: 4c 0b 08 JMP $080b
the ampersand vector is correctly initialized
in DOS3.3
I copied this object code into PRODOS disk
using copy II+
The HIRESCRN gets BRUN'ed. It correctly
sets up the ampersand vector at 3f4-3f6
When calling the code from basic:
&a=x,y
Prodos Basic System must be getting in
the way, as BASIC variable A always returns
with the value it started at, and does
not get modified by the code.