1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6 $FORTH_CODE_WORD BORDER
15 $FORTH_END_CODE_WORD BORDER
18 $FORTH_CODE_WORD INKEY
35 $FORTH_END_CODE_WORD INKEY
50 $FORTH_END_CODE_WORD INP
64 $FORTH_END_CODE_WORD OUTP
67 $FORTH_CODE_WORD BLEEP
78 $FORTH_END_CODE_WORD BLEEP
81 $FORTH_CODE_WORD (SCR$2ATTR)
83 ;; WARNING! address must be valid!
84 ;; ( scr$addr -- attraddr )
94 $FORTH_END_CODE_WORD (SCR$2ATTR)
97 $FORTH_CODE_WORD (SCR$COORD8)
98 ;; k8: convert character coords to screen$ bitmap address
99 ;; WARNING! coords must be valid!
132 $FORTH_END_CODE_WORD (SCR$COORD8)
135 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
136 ;; convert pixel coords to screen$ bitmap address and shift
141 ;; A: pixel shift (0: leftmost; i.e. shift for 0x80)
144 ;; carry flag: set on error (and the result is for 0,0)
178 $FORTH_CODE_WORD (SCR$COORD)
179 ;; k8: convert pixel coords to screen$ bitmap address and mask
180 ;; WARNING! coords must be valid!
181 ;; ( x y -- addr mask )
192 ex de,hl ; DE is address
200 ; h is guaranteed to be 0 here
207 $FORTH_END_CODE_WORD (SCR$COORD)
210 $FORTH_CODE_WORD (SCR$DOWN)
211 ;; k8 -- down one pixel line
212 ;; WARNING! address must be valid!
213 ;; ( scr$addr -- scr$addr )
229 $FORTH_END_CODE_WORD (SCR$DOWN)
231 $FORTH_CODE_WORD (SCR$UP)
232 ;; k8 -- up one pixel line
233 ;; WARNING! address must be valid!
234 ;; ( scr$addr -- scr$addr )
249 $FORTH_END_CODE_WORD (SCR$UP)
252 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
253 ;; convert pixel coords to screen$ bitmap address and mask
261 ;; carry flag: set on error (and the result is for 0,0)
262 scrpixcoord_dehl_mask:
268 call scrpixcoord_de ; HL is address
278 ; D is always zero here
279 ; reset carry (just in case)
289 $FORTH_CODE_WORD POINT
295 call scrpixcoord_dehl_mask
310 ;; ;; ( x y -- flag )
330 $FORTH_END_CODE_WORD POINT
332 $FORTH_CODE_WORD PSET
337 call scrpixcoord_dehl_mask
342 $FORTH_END_CODE_WORD PSET
344 $FORTH_CODE_WORD PRESET
349 call scrpixcoord_dehl_mask
357 $FORTH_END_CODE_WORD PRESET
360 $FORTH_CODE_WORD PLOT
371 call scrpixcoord_dehl_mask
417 $FORTH_END_CODE_WORD PLOT
423 $FORTH_CONST PLOT-MODE plot_mode
426 $FORTH_CONST PMODE-NONE 0
427 $FORTH_CONST PMODE-OR 1
428 $FORTH_CONST PMODE-XOR 2
429 $FORTH_CONST PMODE-AND 3