A2osX/BIN/FORTH.S.GFX.txt
2021-06-05 17:48:54 +02:00

100 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
*--------------------------------------
GFX.Open >PUSHW L.DEV.GFX
>PUSHBI 0
>SYSCALL Open
bcs .9
>STA.G hDevGFX
bra GFX.TEXT
.9 rts
*--------------------------------------
GFX.Close >LDA.G hDevGFX
beq .9
>SYSCALL Close
.9 rts
*--------------------------------------
GFX.TEXT ldy #S.PS.hStdIn
lda (pPS),y
bit #1
bne GFX.IOCTL
GFX.TEXT.RTS clc
rts
*--------------------------------------
GFX.GR ldy #S.PS.hStdIn
lda (pPS),y
bit #1
beq GFX.TEXT.RTS
>LDA.G hDevGFX
beq GFX.TEXT.RTS
GFX.IOCTL >PUSHA
>PUSHBI IOCTL.CONTROL
>PUSHWI 0
>SYSCALL IOCTL
rts
*--------------------------------------
* (Y X C)
*--------------------------------------
GFX.PLOT ldx #S.CB.CMD.SETPIXEL
jsr GFX.WriteX
lda pStack
clc
adc #8
sta pStack
clc
rts
*--------------------------------------
* (Y2 X2 Y1 X1 C)
*--------------------------------------
GFX.RECT ldx #S.CB.CMD.FILLRECT
jsr GFX.WriteX
lda pStack
clc
adc #12
sta pStack
clc
rts
*--------------------------------------
GFX.WriteX ldy #1
lda (pStack)
sta (pStack),y
lda #S.CB.M.C16
sta (pStack)
>PUSHBI S.CB.OP.SET
txa
>PUSHA
>PUSHB.G hDevGFX
>PUSHBI IOCTL.WRITE
lda pStack
clc
adc #2
tay
lda pStack+1
adc #0
>PUSHYA
>SYSCALL IOCTL
clc DHGR.DRV bug ?
rts
*--------------------------------------
*--------------------------------------
*--------------------------------------
MAN
SAVE usr/src/bin/forth.s.gfx
LOAD usr/src/bin/forth.s
ASM