-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdraw.asm
More file actions
64 lines (53 loc) · 795 Bytes
/
Copy pathdraw.asm
File metadata and controls
64 lines (53 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FPS_CONFIG = $FFFD
CANVAS = $1000
CANVAS_WIDTH = 64
CANVAS_HEIGHT = 64
KEYBOARD = $2000
MOUSE_BTN = $2080
MOUSE_X = $2081
MOUSE_Y = $2082
LINE = $00
org $8000
init:
lda #<update
sta $FFFE
lda #>update
sta $FFFE+1
lda #30
sta FPS_CONFIG
rts
update:
ldx MOUSE_BTN
beq .not_pressed
jsr line_reset
ldy MOUSE_Y
.loop:
dey
bmi .out
jsr line_next
jmp .loop
.out
ldy MOUSE_X
lda #$00
cpx #$01
bne .skip_set_white
lda #$FF
.skip_set_white:
sta (LINE),Y
.not_pressed:
rts
line_next:
clc
lda #64
adc LINE
sta LINE
lda #00
adc LINE+1
sta LINE+1
rts
line_reset:
lda #<CANVAS
sta LINE
lda #>CANVAS
sta LINE+1
rts