Browse code

Fixed issue with null vectors

neauoire authored on 18/08/2021 02:30:34
Showing 6 changed files
... ...
@@ -319,7 +319,7 @@ int
319 319
 uxn_eval(Uxn *u, Uint16 vec)
320 320
 {
321 321
 	Uint8 instr;
322
-	if(u->dev[0].dat[0xf]) 
322
+	if(!vec || u->dev[0].dat[0xf]) 
323 323
 		return 0;
324 324
 	u->ram.ptr = vec;
325 325
 	if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
... ...
@@ -228,7 +228,7 @@ int
228 228
 uxn_eval(Uxn *u, Uint16 vec)
229 229
 {
230 230
 	Uint8 instr;
231
-	if(u->dev[0].dat[0xf]) 
231
+	if(!vec || u->dev[0].dat[0xf]) 
232 232
 		return 0;
233 233
 	u->ram.ptr = vec;
234 234
 	if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
... ...
@@ -1,7 +1,5 @@
1 1
 ( dev/audio )
2 2
 
3
-%4** { #20 SFT2 }
4
-%8** { #30 SFT2 }
5 3
 %MOD { DUP2 DIV MUL SUB }
6 4
 
7 5
 ( devices )
... ...
@@ -55,7 +53,7 @@ BRK
55 53
 
56 54
 @on-frame ( -> )
57 55
 
58
-	( incr ) .timer LDZ #01 ADD .timer STZ 
56
+	( incr ) .timer LDZ INC .timer STZ 
59 57
 	( skip ) .timer LDZ #10 EQU #01 JCN [ BRK ]
60 58
 
61 59
 	( get note )
... ...
@@ -1,7 +1,6 @@
1 1
 ( GUI Shapes )
2 2
 
3 3
 %RTN { JMP2r }
4
-%++  { #0001 ADD2 }
5 4
 %--  { #0001 SUB2 }
6 5
 %8++  { #0008 ADD2 }
7 6
 %2** { #10 SFT2 }
... ...
@@ -79,7 +78,7 @@ RTN
79 78
 		( save ) OVR2 .Screen/y DEO2
80 79
 		( draw ) .rect/x1 LDZ2 .Screen/x DEO2 .color LDZ DUP .Screen/pixel DEO
81 80
 		( draw ) .rect/x2 LDZ2 .Screen/x DEO2 .Screen/pixel DEO
82
-		( incr ) SWP2 ++ SWP2
81
+		( incr ) SWP2 INC2 SWP2
83 82
 		OVR2 OVR2 LTS2 ,&ver JCN
84 83
 	POP2 POP2
85 84
 	.rect/x1 LDZ2 .rect/x2 LDZ2
... ...
@@ -87,8 +86,8 @@ RTN
87 86
 		( save ) OVR2 .Screen/x DEO2
88 87
 		( draw ) .rect/y1 LDZ2 .Screen/y DEO2 .color LDZ DUP .Screen/pixel DEO
89 88
 		( draw ) .rect/y2 LDZ2 .Screen/y DEO2 .Screen/pixel DEO
90
-		( incr ) SWP2 ++ SWP2
91
-		OVR2 OVR2 ++ LTS2 ,&hor JCN
89
+		( incr ) SWP2 INC2 SWP2
90
+		OVR2 OVR2 INC2 LTS2 ,&hor JCN
92 91
 	POP2 POP2
93 92
 
94 93
 RTN
... ...
@@ -103,10 +102,10 @@ RTN
103 102
 		&hor
104 103
 			( save ) OVR2 .Screen/x DEO2
105 104
 			( draw ) .color LDZ .Screen/pixel DEO
106
-			( incr ) SWP2 ++ SWP2
105
+			( incr ) SWP2 INC2 SWP2
107 106
 			OVR2 OVR2 LTS2 ,&hor JCN
108 107
 		POP2 POP2 STH2r STH2r
109
-		( incr ) SWP2 ++ SWP2
108
+		( incr ) SWP2 INC2 SWP2
110 109
 		OVR2 OVR2 LTS2 ,&ver JCN
111 110
 	POP2 POP2 POP2 POP2
112 111
 
... ...
@@ -119,7 +118,7 @@ RTN
119 118
 	.circle/r LDZ2 2** .circle/d STZ2
120 119
 	( draw ) ;&seg JSR2
121 120
 	&loop
122
-		( incr ) .circle/x LDZ2 ++ .circle/x STZ2
121
+		( incr ) .circle/x LDZ2 INC2 .circle/x STZ2
123 122
 		.circle/d LDZ2 #0001 LTS2 ,&else JCN
124 123
 			( decr ) .circle/y LDZ2 -- .circle/y STZ2
125 124
 			.circle/x LDZ2 .circle/y LDZ2 SUB2 4** .circle/d LDZ2 ADD2 .circle/d STZ2
... ...
@@ -167,7 +166,7 @@ RTN
167 166
 	&loop
168 167
 		( save ) OVR2 .Screen/x DEO2
169 168
 		( draw ) STHkr .Screen/pixel DEO
170
-		( incr ) SWP2 #0002 ++ SWP2
169
+		( incr ) SWP2 #0002 INC2 SWP2
171 170
 		LTH2k ,&loop JCN
172 171
 	POP2 POP2 POPr
173 172
 
... ...
@@ -179,7 +178,7 @@ RTN
179 178
 	&loop
180 179
 		( save ) OVR2 .Screen/y DEO2
181 180
 		( draw ) STHkr .Screen/pixel DEO
182
-		( incr ) SWP2 #0002 ++ SWP2
181
+		( incr ) SWP2 #0002 INC2 SWP2
183 182
 		LTH2k ,&loop JCN
184 183
 	POP2 POP2 POPr
185 184
 
... ...
@@ -44,7 +44,7 @@ int
44 44
 uxn_eval(Uxn *u, Uint16 vec)
45 45
 {
46 46
 	Uint8 instr;
47
-	if(u->dev[0].dat[0xf]) 
47
+	if(!vec || u->dev[0].dat[0xf]) 
48 48
 		return 0;
49 49
 	u->ram.ptr = vec;
50 50
 	if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
... ...
@@ -125,7 +125,7 @@ int
125 125
 uxn_eval(Uxn *u, Uint16 vec)
126 126
 {
127 127
 	Uint8 instr;
128
-	if(u->dev[0].dat[0xf])
128
+	if(!vec || u->dev[0].dat[0xf])
129 129
 		return 0;
130 130
 	u->ram.ptr = vec;
131 131
 	if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;