Added missing ASM sample
This commit is contained in:
parent
45b1173d9f
commit
6d2c8c5d95
158
Documentation.md
158
Documentation.md
|
@ -1243,5 +1243,161 @@ Here is the source code to the BASICDEMO program, included in the WeeGUI disk im
|
||||||
10020 HOME
|
10020 HOME
|
||||||
|
|
||||||
|
|
||||||
Here's the source code to the assembly language demo, which shows off the speed of WeeGUI's rendering. This code is also synchronized to the vertical blank, for the smoothest possible animation.
|
Here's the source code to the assembly language demo, which shows off the speed of WeeGUI's rendering. This code is also synchronized to the vertical blank, for the smoothest possible animation
|
||||||
|
|
||||||
|
```
|
||||||
|
.include "WeeGUI_MLI.s"
|
||||||
|
|
||||||
|
|
||||||
|
.org $6000
|
||||||
|
|
||||||
|
INBUF = $0200
|
||||||
|
DOSCMD = $be03
|
||||||
|
KBD = $c000
|
||||||
|
KBDSTRB = $c010
|
||||||
|
|
||||||
|
|
||||||
|
main:
|
||||||
|
|
||||||
|
; BRUN the GUI library
|
||||||
|
ldx #0
|
||||||
|
ldy #0
|
||||||
|
@0: lda brunCmdLine,x
|
||||||
|
beq @1
|
||||||
|
sta INBUF,y
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
bra @0
|
||||||
|
@1: jsr DOSCMD
|
||||||
|
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; Show off rendering speed with some snazzy rectangle painting
|
||||||
|
;
|
||||||
|
; Stack:
|
||||||
|
; Curr X
|
||||||
|
; Curr Y
|
||||||
|
; Curr Width
|
||||||
|
; Curr Height
|
||||||
|
|
||||||
|
ldx #WGClearScreen
|
||||||
|
jsr WeeGUI
|
||||||
|
|
||||||
|
animateRects:
|
||||||
|
lda #38 ; Initialize
|
||||||
|
pha
|
||||||
|
lda #11
|
||||||
|
pha
|
||||||
|
lda #2
|
||||||
|
pha
|
||||||
|
lda #2
|
||||||
|
pha
|
||||||
|
|
||||||
|
animateRectsEvenLoop:
|
||||||
|
@0: lda $C019 ; Sync to VBL
|
||||||
|
bmi @0
|
||||||
|
|
||||||
|
ldx #WGClearScreen
|
||||||
|
jsr WeeGUI
|
||||||
|
|
||||||
|
tsx
|
||||||
|
inx
|
||||||
|
lda $0100,x ; Load Height, then modify
|
||||||
|
sta PARAM3
|
||||||
|
inc
|
||||||
|
inc
|
||||||
|
sta $0100,x
|
||||||
|
cmp #25
|
||||||
|
bcs animateRects
|
||||||
|
|
||||||
|
inx ; Load Width, then modify
|
||||||
|
lda $0100,x
|
||||||
|
sta PARAM2
|
||||||
|
inc
|
||||||
|
inc
|
||||||
|
inc
|
||||||
|
inc
|
||||||
|
inc
|
||||||
|
inc
|
||||||
|
sta $0100,x
|
||||||
|
|
||||||
|
inx ; Load Y, then modify
|
||||||
|
lda $0100,x
|
||||||
|
sta PARAM1
|
||||||
|
dec
|
||||||
|
sta $0100,x
|
||||||
|
|
||||||
|
inx ; Load X, then modify
|
||||||
|
lda $0100,x
|
||||||
|
sta PARAM0
|
||||||
|
dec
|
||||||
|
dec
|
||||||
|
dec
|
||||||
|
sta $0100,x
|
||||||
|
|
||||||
|
ldy #64
|
||||||
|
ldx #WGFillRect
|
||||||
|
jsr WeeGUI
|
||||||
|
ldx #WGStrokeRect
|
||||||
|
jsr WeeGUI
|
||||||
|
|
||||||
|
jsr delayShort
|
||||||
|
jsr delayShort
|
||||||
|
jsr delayShort
|
||||||
|
jsr checkKbd
|
||||||
|
|
||||||
|
bra animateRectsEvenLoop
|
||||||
|
|
||||||
|
|
||||||
|
delayShort: ; ~1/30 sec
|
||||||
|
pha
|
||||||
|
phx
|
||||||
|
phy
|
||||||
|
|
||||||
|
ldy #$06 ; Loop a bit
|
||||||
|
delayShortOuter:
|
||||||
|
ldx #$ff
|
||||||
|
delayShortInner:
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
dex
|
||||||
|
bne delayShortInner
|
||||||
|
dey
|
||||||
|
bne delayShortOuter
|
||||||
|
|
||||||
|
ply
|
||||||
|
plx
|
||||||
|
pla
|
||||||
|
rts
|
||||||
|
|
||||||
|
checkKbd:
|
||||||
|
lda KBD
|
||||||
|
bpl checkKbdDone
|
||||||
|
sta KBDSTRB
|
||||||
|
|
||||||
|
cmp #241 ; 'q' with high bit set
|
||||||
|
bne checkKbdDone
|
||||||
|
|
||||||
|
ldx #WGExit
|
||||||
|
jsr WeeGUI
|
||||||
|
pla ; Pull our own frame off the stack...
|
||||||
|
pla
|
||||||
|
pla
|
||||||
|
pla
|
||||||
|
pla ; ...four local variables + return address...
|
||||||
|
pla
|
||||||
|
rts ; ...so we can quit to ProDOS from here
|
||||||
|
|
||||||
|
checkKbdDone:
|
||||||
|
rts
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
brunCmdLine:
|
||||||
|
.byte "BRUN weegui",$8d,0
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
Loading…
Reference in New Issue