Skip to content

Commit fdeae96

Browse files
committed
Merge pull request #45 from chrisws/0_11_20
0 12 6
2 parents 8df8098 + e5a842d commit fdeae96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+566
-424
lines changed

ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2016-05-14 (0.12.6)
2+
Fix to prevent const overwriting another const
3+
Updated MID and REPLACE for performance
4+
POINT(0) and POINT(1) values now reset with each program run
5+
POINT(-x, -y) now provides access to the base screen image. For better
6+
performance use the IMAGE.SAVE sub command
7+
8+
2016-05-07 (0.12.6)
9+
Reverted LASTX/LASTY. Data was already accessible via POINT command
10+
Reverted getPixel from SCREEN for performance. Can still access this by passed -ve x/y values
11+
Reverted using var V_FUNC handling for int sys vars due to eval issues
12+
113
2016-04-26 (0.12.6)
214
Fixes for unit case sensitivity
315

samples/distro-examples/apps/calc.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func showResult(result)
209209
rect out_x, out_y STEP w, h, COLOR bgnd FILLED
210210
rect out_x - 1, out_y - 1 STEP w + 1, h + 1, COLOR 2
211211

212-
local out_str = chr(27) + "[15 C" + result
212+
local out_str = result
213213
local out_str_w = textwidth(result)
214214
local x = (out_x + w) - out_str_w - textwidth("0")
215215

samples/distro-examples/examples/Circles_and_arcs.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
color 0,15
1+
color 1,2:cls
22
circle ymax/4,ymax/4,ymax/8
33
circle ymax/2,ymax/4,ymax/8 FILLED
44
circle ymax/4,ymax/2,ymax/8,.75

samples/distro-examples/examples/Predefined_Variables.bas

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
? cat(1);"Predefined Variables";cat(0)
2-
? "OS VER =0x"; HEX$(osver)
3-
? "SB VER =0x"; HEX$(sbver)
2+
? "SB VER ="; sbver
43
? "PI ="; pi
54
? "XMAX ="; xmax
65
? "YMAX ="; ymax

samples/distro-examples/games/UFO.bas

0 Bytes
Binary file not shown.

samples/distro-examples/games/sokoban.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ sub play_game(byref game)
514514

515515
game.game_over = false
516516
while game.game_over = false
517-
pause true: k = inkey
517+
k = inkey(1)
518518
if len(k) = 2 then
519519
ch = asc(right(k,1))
520520
select case ch

samples/distro-examples/graphics/3dtorus.bas

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@
66
' Jelly 2004
77
' Http://rel.betterwebber.com
88

9-
const Xmax = 640
10-
const Ymax = 480
119
const Xmid = Xmax/2
1210
const Ymid = Ymax/2
1311
const Lens = 256
14-
const PI = 3.141593
1512
const rings = 14
1613
const bands = 15
1714
const ringradius = 100

samples/distro-examples/graphics/Charts.bas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
' CHART examples
33

44
const VN=10
5+
const LINECHART=1
6+
const BARCHART=2
57
dim v(1 to VN)
6-
78
randomize timer
89

910
cls

samples/distro-examples/graphics/Simple_3D.bas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ for i=1 to 15
3333
calcPt
3434
line sx,sy
3535
next
36+
showpage
3637
end
3738

3839
'

samples/distro-examples/tests/array.bas

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,16 @@ if (sim(0) <> 50) then
6969
throw "dim sim not tasty"
7070
fi
7171

72+
rem ==6866== Source and destination overlap in memcpy(0xfc3f090, 0xfc3f096, 13)
73+
rem ==6866== at 0x4C32513: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
74+
rem ==6866== by 0x48D4A3: memcpy (string3.h:53)
75+
rem ==6866== by 0x48D4A3: comp_text_line_let (scan.c:1874)
76+
77+
dim dots(1)
78+
dots(0).y = 100
79+
dots(0).dy = 1
80+
dots(0).y += dots(0).dy
81+
if (dots(0).y != 101) then
82+
throw "not 101 !!!"
83+
endif
7284

samples/distro-examples/tests/call_tau.bas

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ foyer.name= "my name is PI"
3030

3131
? "end"
3232

33-
tau.addRoom(foyer,x)
34-
33+
for i = 0 to 1000
34+
tau.addRoom(foyer,x)
35+
jj = tau.calcRoomSize(foyer,x)
36+
next i
3537

3638
sub addRoom(the_thing, d)
3739
print the_thing.name, d

samples/distro-examples/tests/output/trycatch.out

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ open failed FS(2): NO SUCH FILE OR DIRECTORY
44
after try
55
catch by error name
66
outer after try
7-
8-
9-
* RTE-ERROR AT ../../../samples/distro-examples/tests/trycatch.bas:200 *
10-
Description:
11-
Division by zero
12-
137
Stack:
148
TRY: 199
159
TRY: 198
@@ -20,4 +14,9 @@ Stack:
2014
IF: 193
2115
IF: 192
2216
SUB: 216
17+
18+
19+
* RTE-ERROR AT ../../../samples/distro-examples/tests/trycatch.bas:200 *
20+
Description:
21+
Division by zero
2322

samples/distro-examples/tests/tau.bas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Unit Tau
22
Import TauChild
33

44
Export expvar, foof, foop
5-
export addRoom
5+
export addRoom,calcRoomSize
66
export print_expvar, ta, build_ta, cerr
77

88
expvar = "Tau's exported variable"
@@ -37,7 +37,10 @@ sub cerr
3737
end
3838

3939
sub addRoom(the_thing,d)
40+
end
4041

42+
func calcRoomSize(the_thing,d)
43+
calcRoomSize = 1
4144
end
4245

4346
rem initialization

samples/distro-examples/tests/trycatch.bas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,15 @@ if 1 == 1 then
198198
try
199199
try
200200
a = 1 / 0
201-
catch
201+
catch "X"
202202
end try
203-
catch
203+
catch "X"
204204
end try
205-
catch
205+
catch "X"
206206
end try
207-
catch
207+
catch "X"
208208
end try
209-
catch
209+
catch "X"
210210
end try
211211
fi
212212
fi

src/common/blib.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
* LET v[(x)] = any
2424
* CONST v[(x)] = any
2525
*/
26-
void cmd_let(int allowConst) {
26+
void cmd_let(int is_const) {
2727
var_t *v_left = code_getvarptr();
2828

2929
if (!prog_error) {
30-
if (v_left->const_flag && !allowConst) {
30+
if (v_left->const_flag) {
3131
err_const();
3232
return;
3333
}
@@ -46,7 +46,7 @@ void cmd_let(int allowConst) {
4646
eval(&v_right);
4747
if (!prog_error) {
4848
v_set(v_left, &v_right);
49-
v_left->const_flag = allowConst;
49+
v_left->const_flag = is_const;
5050
}
5151
v_free(&v_right);
5252
}
@@ -84,6 +84,7 @@ void cmd_dim(int preserve) {
8484
code_skipnext();
8585
zaf = 0;
8686
do {
87+
v_init(&arg);
8788
eval(&arg);
8889
if (prog_error) {
8990
return;
@@ -1474,9 +1475,8 @@ void cmd_endif() {
14741475
stknode_t node;
14751476

14761477
code_pop(&node, kwIF);
1477-
while (node.type != kwIF) {
1478+
while (node.type != kwIF && !prog_error) {
14781479
code_pop(&node, kwIF);
1479-
IF_ERR_BREAK;
14801480
}
14811481

14821482
if (!prog_error) {
@@ -1755,7 +1755,6 @@ void cmd_next() {
17551755
jump_ip = node.x.vfor.jump_ip;
17561756

17571757
var_p = node.x.vfor.var_ptr;
1758-
// v_init(&var_to);
17591758
var_step.const_flag = 0;
17601759
var_step.type = V_INT;
17611760
var_step.v.i = 1;
@@ -1766,6 +1765,7 @@ void cmd_next() {
17661765
//
17671766

17681767
prog_ip = node.x.vfor.to_expr_ip;
1768+
v_init(&var_to);
17691769
eval(&var_to);
17701770

17711771
if (!prog_error && (var_to.type == V_INT || var_to.type == V_NUM)) {

src/common/blib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void cmd_deriv(void);
9292
void cmd_diffeq(void);
9393

9494
// not basic, but speed is needed
95-
void graph_reset(void); // graphics module - reset
95+
void graph_reset(void);
9696
void cmd_pset(void);
9797
void cmd_line(void);
9898
void cmd_rect(void);

src/common/blib_db.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,6 @@ void cmd_floadln() {
564564
int eof, eol, bufLen, bufIndex;
565565
dword unreadBytes;
566566

567-
err_reset();
568567
if (code_peek() == kwTYPE_SEP) {
569568
// "filename" is an already open file number
570569
flags = 0;
@@ -646,7 +645,7 @@ void cmd_floadln() {
646645
unreadBytes -= bufLen;
647646

648647
dev_fread(handle, (byte *)buf, bufLen);
649-
if (err_has_error()) {
648+
if (prog_error) {
650649
eof = 1;
651650
break;
652651
}
@@ -666,7 +665,7 @@ void cmd_floadln() {
666665
}
667666
} // read line
668667

669-
if (err_has_error()) {
668+
if (prog_error) {
670669
// clear & exit
671670
v_free(array_p);
672671
v_init(array_p);
@@ -716,7 +715,6 @@ void cmd_fsaveln() {
716715
int flags = DEV_FILE_OUTPUT;
717716
int handle, i;
718717

719-
err_reset();
720718
if (code_peek() == kwTYPE_SEP) {
721719
// "filename" is an already open file number
722720
flags = 0;

0 commit comments

Comments
 (0)