Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
14faf63
SDL: added kill-word command
chrisws Jan 19, 2019
2d5cde7
SDL: added kill-word command
chrisws Jan 19, 2019
bfd6d87
SDL: added kill-word command
chrisws Jan 19, 2019
e2e6daa
UI: added select-word editor command
chrisws Jan 19, 2019
42e4674
UI: added select-word editor command
chrisws Jan 19, 2019
c24115b
UI: added select-word editor command
chrisws Jan 20, 2019
6f0cd64
UI: added select-word editor command
chrisws Jan 20, 2019
ef3fa77
ANDROID: fix setup screen colour display
chrisws Jan 21, 2019
912aea9
SDL: editor ctrl+g = escape
chrisws Jan 27, 2019
9f76049
SDL: revert editor ctrl+g = escape
chrisws Jan 29, 2019
3d44b93
BUILD: check for xxd
chrisws Feb 1, 2019
2994204
UI: Edit enter now continues prior line comment
chrisws Feb 1, 2019
9733a8b
UI: Edit enter now continues prior line comment
chrisws Feb 1, 2019
cbcee6c
UI: optimize images
chrisws Feb 1, 2019
11c446d
COMMON: fix reference func issue
chrisws Feb 2, 2019
8bac3e0
UI: bump stb_textedit version
chrisws Feb 9, 2019
4affbce
UI: make ALT+F4 return to editor when active
chrisws Feb 9, 2019
8c07670
UI: avoid flicker from with ALT+F4 -e edit startup
chrisws Feb 9, 2019
861e553
ANDROID: fix crash passing negative duration to SOUND command
chrisws Feb 14, 2019
35789c3
ANDROID: sound command now supports non-background play
chrisws Feb 16, 2019
91181a4
ANDROID: fix crash passing negative duration to SOUND command
chrisws Feb 16, 2019
d0cc6c7
ANDROID: bump android version
chrisws Feb 17, 2019
28fe89f
UI: bump lodepng version
chrisws Feb 22, 2019
3e5a1b8
ANDROID: fix crash entering c,v in edit control mode
chrisws Feb 22, 2019
5dcd012
COMMON: fix test
chrisws Feb 27, 2019
5ff45e1
ANDROID: Fix POINT returning transposed red + blue
chrisws Feb 28, 2019
8ab824d
ANDROID: In editor, hide status when scrolled
chrisws Mar 2, 2019
9cf555b
ANDROID: bump android version
chrisws Mar 2, 2019
4c66fb3
ANDROID: bump version
chrisws Mar 3, 2019
c65a3a7
COMMAND: code cleanup
chrisws Mar 10, 2019
b6a0cf4
COMMON: implemented FOR char in str
chrisws Apr 19, 2019
a8bcddc
FLTK: port to fltk 1.x
chrisws Apr 20, 2019
7896575
FLTK: add changelog and readme notes
chrisws Jun 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
2019-06-22 (0.12.15)
FLTK: reactivated the FLTK port using FLTK v1.4

2019-03-02 (0.12.15)
COMMON: Implemented - FOR character IN string

2019-03-02 (0.12.15)
ANDROID: In editor, hide status when scrolled

2019-02-26 (0.12.15)
ANDROID: Fix POINT returning transposed red + blue

2019-02-23 (0.12.15)
ANDROID: Fix crash entering c,v in edit control mode

2019-02-14 (0.12.15)
ANDROID: fix crash passing negative duration to SOUND command

2019-02-11 (0.12.15)
UI: ALT+F4 from edit/run now returns to edit
UI: avoid flicker from with ALT+F4 -e edit startup

2019-02-02 (0.12.15)
UI: Edit enter now continues prior line comment

2019-01-21 (0.12.15.1)
ANDROID: fix setup screen colour display
ANDROID: show link to android page in about

2019-01-19 (0.12.15)
UI: added kill-word editor command (alt+d)
UI: added select-word editor command (alt+w)
UI: find command primed from editor selection

2018-12-28 (0.12.15)
Fix crash when using GOTO with a non-existent label
Fix crash in editor when double tapping empty document
Expand Down
5 changes: 4 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ test:
leak-test:
(cd src/platform/console && make leak-test)

fuzz-test:
(cd src/platform/console && make fuzz-test)

cppcheck:
(cppcheck --quiet --enable=all src/common src/ui src/platform/android/jni src/platform/sdl)
(cppcheck --quiet --enable=all src/common src/ui src/platform/android/jni src/platform/sdl src/platform/fltk)

covcheck:
(make clean -s && \
Expand Down
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for ever

Initial setup on linux
```
$ sudo apt-get install git autotools-dev automake gcc g++ libsdl2-dev libfreetype6-dev libfontconfig1-dev
$ sudo apt-get install git autotools-dev automake gcc g++ libsdl2-dev libfreetype6-dev libfontconfig1-dev xxd
$ git clone https://github.com/smallbasic/SmallBASIC.git
$ cd SmallBASIC
$ sh autogen.sh
Expand Down Expand Up @@ -117,6 +117,25 @@ Useful adb commands for debugging:
adb shell dumpsys cpuinfo
adb shell top -m 10

### Building the FLTK version

1. Install and build FLTK 1.4

```
$ cd ~/github
$ git clone https://github.com/fltk/fltk.git
$ sudo make install

```

2. Build

```
$ cd ~/github/SmallBASIC
$ ./configure --enable-fltk
$ make -s
```

### .indent.pro settings
```
-brf -nbap -br -brs -cdb -cdw -ce -cli0 -fca -i2 -l110 -lc110 -lp
Expand Down
79 changes: 71 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl
dnl Configure script for SmallBASIC
dnl
dnl Copyright(C) 2001-2018 Chris Warren-Smith.
dnl Copyright(C) 2001-2019 Chris Warren-Smith.
dnl
dnl This program is distributed under the terms of the GPL v2.0
dnl Download the GNU Public License (GPL) from www.gnu.org
Expand Down Expand Up @@ -39,6 +39,11 @@ AC_ARG_ENABLE(web,
[ac_build_web="yes"],
[ac_build_web="no"])

AC_ARG_ENABLE(fltk,
AS_HELP_STRING([--enable-fltk],[build fltk version(default=no)]),
[ac_build_fltk="yes"],
[ac_build_fltk="no"])

AC_ARG_ENABLE(dist,
AS_HELP_STRING([--enable-dist],[prepare to run make dist(default=no)]),
[ac_build_dist="yes"],
Expand Down Expand Up @@ -156,6 +161,11 @@ function buildSDL() {
AC_MSG_ERROR([libfreetype6-dev not installed: configure failed.])
fi

AC_CHECK_PROG(have_xxd, xxd, [yes], [no])
if test "${have_xxd}" = "no" ; then
AC_MSG_ERROR([xxd command not installed: configure failed.])
fi

case "${host_os}" in
*mingw* | cygwin*)
dnl avoid using MSCRT versions of printf for long double
Expand Down Expand Up @@ -206,15 +216,13 @@ function buildSDL() {
dnl preconfigured values for SDL build
AC_DEFINE(_SDL, 1, [Defined when building SDL version])
AC_DEFINE(_UnixOS, 1, [Building under Unix like systems.])
AC_DEFINE(IMPL_DEV_DELAY, 1, [Driver implements dev_delay()])
AC_DEFINE(IMPL_LOG_WRITE, 1, [Driver implements lwrite()])
AC_DEFINE(IMPL_DEV_READ, 1, [Implement dev_read()])
AC_DEFINE(IMPL_DEV_DELAY, 1, [Driver implements dev_delay()])
AC_DEFINE(IMPL_LOG_WRITE, 1, [Driver implements lwrite()])

BUILD_SUBDIRS="src/common src/platform/sdl"
AC_SUBST(BUILD_SUBDIRS)
(cd src/platform/android/app/src/main/assets && xxd -i main.bas > ../../../../../../../src/platform/sdl/main_bas.h)
(cd documentation && g++ -o build_kwp build_kwp.cpp && ./build_kwp > ../src/ui/kwp.h)
}

function buildAndroid() {
Expand All @@ -233,8 +241,6 @@ function buildAndroid() {

TEST_DIR="src/platform/android"
AC_SUBST(TEST_DIR)

(cd documentation && g++ -o build_kwp build_kwp.cpp && ./build_kwp > ../src/ui/kwp.h)
}

function buildConsole() {
Expand Down Expand Up @@ -294,8 +300,6 @@ function buildConsole() {
fi

AC_SUBST(BUILD_SUBDIRS)

(cd documentation && g++ -o build_kwp build_kwp.cpp && ./build_kwp > ../src/ui/kwp.h)
}

function buildWeb() {
Expand All @@ -321,16 +325,74 @@ function buildWeb() {
AC_SUBST(BUILD_SUBDIRS)
}

function buildFLTK() {
TARGET="Building FLTK version."

dnl Checks for FLTK 1.x
AC_CHECK_PROG(have_fltk, fltk-config, [yes], [no])

AC_CHECK_PROG(have_xxd, xxd, [yes], [no])
if test "${have_xxd}" = "no" ; then
AC_MSG_ERROR([xxd command not installed: configure failed.])
fi

dnl avoid using MSCRT versions of printf for long double
case "${host_os}" in
*mingw* | cygwin*)
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -D__USE_MINGW_ANSI_STDIO"
esac

FLTK_CXXFLAGS="${PACKAGE_CFLAGS} `fltk-config --cxxflags`"
FLTK_CXXFLAGS="${FLTK_CXXFLAGS} -fno-exceptions -fno-rtti -std=c++11 -Wno-unknown-pragmas"
PACKAGE_LIBS="${PACKAGE_LIBS} `fltk-config --ldstaticflags --use-images`"

dnl do not depend on cygwin.dll under cygwin build
case "${host_os}" in
*mingw* | cygwin*)
FLTK_CXXFLAGS="${FLTK_CXXFLAGS} -mms-bitfields"
PACKAGE_LIBS="-Wl,-Bstatic ${PACKAGE_LIBS} -lwsock32 -lws2_32 -static-libgcc -static-libstdc++"
AC_DEFINE(_Win32, 1, [Windows build])
;;

*)
(cd images && xxd -i sb-desktop-128x128.png > ../src/platform/fltk/icon.h)
xxd
esac

defaultConditionals

dnl preconfigured values for FLTK build
AC_DEFINE(_UnixOS, 1, [Building under Unix like systems.])
AC_DEFINE(_FLTK, 1, [Defined for FLTK build.])
AC_DEFINE(IMPL_DEV_READ, 1, [Implement dev_read()])
AC_DEFINE(IMPL_DEV_DELAY, 1, [Driver implements dev_delay()])
AC_DEFINE(IMPL_LOG_WRITE, 1, [Driver implements lwrite()])

BUILD_SUBDIRS="src/common src/platform/fltk"
AC_SUBST(BUILD_SUBDIRS)
AC_SUBST(FLTK_CXXFLAGS)

desktopentrydir='$(datarootdir)'/applications
AC_SUBST(desktopentrydir)

dnl generate kwp.h
(cd src/platform/fltk && g++ -o build_kwp build_kwp.cxx && ./build_kwp)
}

if test x$ac_build_sdl = xyes; then
buildSDL
elif test x$ac_build_android = xyes; then
buildAndroid
elif test x$ac_build_web = xyes; then
buildWeb
elif test x$ac_build_fltk = xyes; then
buildFLTK
else
buildConsole
fi

(cd documentation && g++ -o build_kwp build_kwp.cpp && ./build_kwp > ../src/ui/kwp.h)

checkPCRE
checkTermios
checkDebugMode
Expand Down Expand Up @@ -363,6 +425,7 @@ src/platform/android/Makefile
src/platform/console/Makefile
src/platform/sdl/Makefile
src/platform/web/Makefile
src/platform/fltk/Makefile
])
AC_OUTPUT

Expand Down
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ smallbasic (0.12.15) unstable; urgency=low
smallbasic (0.12.14) unstable; urgency=low
* Various see web site

-- Chris Warren-Smith <cwarrensmith@gmail.com> Sat, 15 Sept 2018 09:45:25 +1000
-- Chris Warren-Smith <cwarrensmith@gmail.com> Sat, 15 Sep 2018 09:45:25 +1000

smallbasic (0.12.13) unstable; urgency=low
* Various see web site
Expand Down
Binary file modified images/mainmenu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sb-desktop-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sb-desktop-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sb-desktop-64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sb16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sb32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 2 additions & 11 deletions samples/distro-examples/tests/output/ref.out
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
cat= cat
dog= dog
3= 3
1= 1
a=b a=b
a<>b a<>b
{"name":"kitchen"}
{"name":"hall"}
{"fridge":"empty","name":"Kitchen"}
{"name":"toilet","occupied":1}
{"fridge":"empty","name":"Kitchen"}
{"name":"hall"}
toilet
10
20
62 changes: 22 additions & 40 deletions samples/distro-examples/tests/ref.bas
Original file line number Diff line number Diff line change
@@ -1,44 +1,26 @@
' reference variable tests

a = "cat"
b = @a

print "cat=", b
rem reference variables not supported
a = "dog"
b = @a
a = "cat"
print "cat=", a
print "dog=", b
print "3=", len(b)
print "1=", not empty(b)
print "a=b", iFF(a==b, "a=b", "a<>b")

b = "goodbye a"
print "a<>b", iFF(a==b, "a=b", "a<>b")

dim rooms
sub addRoom(byref room)
rooms << byref room
rem complex pseudo class method references
func C
func f(j)
return j
end
local r = {}
r.f = @f
return r
end

dim kitchen,hall,toilet
kitchen.name= "kitchen"
hall.name = "hall"
toilet.name ="toilet"

addRoom(kitchen)
addRoom(hall)

print rooms(0)
print rooms(1)

kitchen.name = "Kitchen"
kitchen.fridge = "empty"
print rooms(0)

insert rooms, 0, @toilet
toilet.occupied = true

print rooms(0)
print rooms(1)
print rooms(2)

roomref = byref rooms(0)
print roomref.name
func Q
local r = {}
r.c = C()
return r
end
c.m = Q()
j = [10,20]
for n in c.m.c.f(j)
print n
next n
8 changes: 8 additions & 0 deletions samples/distro-examples/tests/strings.bas
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,11 @@ s= "a\c\e"
if mid(s, 2, 1) != "\\" then throw s
if mid(s, 4, 1) != "\\" then throw s

REM FOR character IN string
s1 = "cats"
s2 = ""
for c in s1
s2 += c
next c
if (s1 <> s2) then throw s2

Loading