A2osX/SBIN/GUI.S.txt
2015-03-23 08:28:03 +01:00

115 lines
2.0 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.

PR#3
PREFIX /A2OSX.BUILD
NEW
INC 1
AUTO 6
.LIST OFF
.OP 65C02
.OR $2000
.TF SBIN/GUI
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
*--------------------------------------
* Main entry point
*--------------------------------------
* Code signature and INIT table
*--------------------------------------
* CLD $D8
* JMP (*,x) $7C
* #JMPTABLE
* /JMPTABLE
*--------------------------------------
CS.START cld
jmp (.1,x)
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.DEVNAME.GFX .DA DEVNAME.GFX
.DA 0
.DA CS.END-CS.START Code Length To Relocate
.DA DS.END-DS.START Data Segment to Allocate
*--------------------------------------
CS.INIT >LDYA L.DEVNAME.GFX
>SYSCALL SYS.GetDevByNameYA
bcc .10
rts
.10 sta hDevGFX
>SYSCALL SYS.GetDevByIDA
>STYA ZPQuickPtr1
ldy #S.DEV.hCS
lda (ZPQuickPtr1),y
>SYSCALL SYS.GetMemPtrA
>STYA DevJMP
stz C
stz X
stz X+1
.1 stz Y
>DEBUG
.2
>PUSHBI C Color
>PUSHBI 2 Mode:1=B/W,2=16 colors,...,128=XOR
>PUSHB Y
>PUSHW X
jsr SetPixel
inc Y
lda Y
cmp #192
bne .2
inc C
lda C
cmp #16
bne .3
stz C
.3 lda X
clc
adc #4
sta X
bcc .4
inc X+1
.4 lda X
sec
sbc #560
lda X+1
sbc /560
bcc .1
clc
.9 rts
*--------------------------------------
CS.RUN clc
rts
*--------------------------------------
CS.DOEVENT clc
rts
*--------------------------------------
CS.QUIT clc
rts
*--------------------------------------
SetPixel ldx #DEVMGR.GFX.SETPIXEL
jmp (DevJMP)
*--------------------------------------
CS.END
DEVNAME.GFX >PSTRING "GFX"
DEVNAME.MOU0 >PSTRING "MOU0"
DS.START
hDevGFX .BS 1
DevJMP .BS 2
X .BS 2
Y .BS 1
C .BS 1
DS.END
MAN
SAVE SBIN/GUI.S
ASM