mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-22 00:32:44 +00:00
115 lines
2.0 KiB
Plaintext
115 lines
2.0 KiB
Plaintext
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
|