-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.asm
More file actions
64 lines (64 loc) · 822 Bytes
/
graph.asm
File metadata and controls
64 lines (64 loc) · 822 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
#Function graphing
#Have it iterate along the 16 screen and create 16 sprites of points for each point (This is quad 1)
#Register setup: 00: row counter 11: General calculation 01: Memory buffer/general buffer
#Could use ram or accumulator as argument transfer method.
#INC 00 ;testing
#Initialize PPU
LDA FF
MAP FA
LDA 01
MAP FF
LDA 40
MAP FB
LDA E0
MAP F9
LDA 04
MAP FF
lop:
MVA 00
SAR 04
JPG deinit
MVA 00
JUP func
aftfunc:
MVR 01
SAR 04
JPG lopcyc
LDA 0F
MVR 03
MVA 01
SUB 03
MVA 00
SAL 04
IOR 03
#Output it to screen
MVA 03
MAP FE
LDA 05
MAP FF
LDA 01
MAP FF
lopcyc:
INC 00
JUP lop
deinit:
HLT
func:
#f(x)=((x/2-5)^3+5(x/2-5)^2)/3
SAR 01
MVR 03
LDA 05
SUB 03
MVA 03
MVR 02
MLT 03
MLT 03
MLT 02
LDA 05
MLT 02
MVA 02
ADD 03
LDA 03
DIV 03
MVA 03
JUP aftfunc