Skip to content

Commit 7387ff5

Browse files
authored
Merge pull request #211 from chrisws/sb_master
Sb master
2 parents d59a376 + 5578b1f commit 7387ff5

File tree

16 files changed

+376
-93
lines changed

16 files changed

+376
-93
lines changed

ChangeLog

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
1+
2024-04-14 (12.27)
2+
COMMON: Fix bug #149: Problem with big hex numbers in windows
3+
COMMON: Add new function TRANSPOSE()
4+
5+
2024-04-07 (12.27)
6+
ANDROID: Implemented "android.request"
7+
8+
2024-02-19 (12.27)
9+
COMMON: Fix TSAVE bug #205
10+
11+
2024-01-22 (12.27)
12+
COMMON: Fix linking issue on MSYS2
13+
14+
2024-01-14 (12.27)
15+
COMMON: Improvements for image.save()
16+
17+
2024-01-13 (12.27)
18+
COMMON: Serial port improvements.
19+
120
2024-01-06 (12.27)
221
COMMON: Allow modules to return objects with methods that take arguments
322

23+
2023-12-01 (12.27)
24+
CONSOLE: Bugfix for image.clip() and image.save()
25+
26+
2023-10-31 (12.27)
27+
COMMON: Fix: RTRIM changes input string
28+
429
2023-08-27 (12.27)
530
COMMON: Fix parameter number error when calling a unit sub/func
631
COMMON: Show a runtime error if a module calls exit()
732

33+
2023-08-05 (12.27)
34+
COMMON: Fix building on Cygwin
35+
36+
2023-07-23 (12.27)
37+
COMMON: Fix for RoundPrecisionBug
38+
39+
2023-07-18 (12.27)
40+
COMMON: Fix redim regression
41+
842
2023-06-18 (12.27)
943
COMMON: Fix redim regression
1044
PLUGINS: Added mechanism for cleaning up resources when the associated map falls out of scope
@@ -13,6 +47,10 @@
1347
CONSOLE: Fix image save
1448
ANDROID: Fix download error when there are duplicate scratch.bas files
1549

50+
2023-05-14 (12.27)
51+
COMMON: Fix bug: LINEQN tolerance
52+
COMMON: Fix floating-point number round-precision bug when converting a floating-point number to string.
53+
1654
2023-03-26 (12.26)
1755
ANDROID: Fix setenv error #187
1856
ANDROID: update web UI dependencies

src/platform/android/app/build.gradle

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ apply plugin: 'com.android.application'
22

33
android {
44
// app can use the API features included in this API level and lower.
5-
compileSdkVersion 33
5+
compileSdk 34
66

77
// can override some attributes in main/AndroidManifest.xml
88
defaultConfig {
99
applicationId 'net.sourceforge.smallbasic'
10-
minSdkVersion 16
11-
targetSdkVersion 33
12-
versionCode 59
13-
versionName '12.26'
14-
resConfigs 'en'
10+
minSdkVersion 19
11+
targetSdkVersion 34
12+
versionCode 60
13+
versionName '12.27'
14+
resourceConfigurations += ['en']
1515
}
1616

1717
signingConfigs {
@@ -26,19 +26,13 @@ android {
2626
}
2727

2828
buildTypes {
29-
debug {
30-
buildConfigField "boolean", "DEBUG_VIEW", "true"
31-
buildConfigField "java.util.Date", "BUILD_TIME", "new java.util.Date(" + System.currentTimeMillis() + "L)"
32-
}
3329
release {
3430
ndk {
35-
debugSymbolLevel = 'FULL'
31+
debugSymbolLevel = 'FULL'
3632
}
37-
buildConfigField "boolean", "DEBUG_VIEW", "false"
38-
buildConfigField "java.util.Date", "BUILD_TIME", "new java.util.Date(" + System.currentTimeMillis() + "L)"
3933
shrinkResources true
4034
minifyEnabled true
41-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
4236
signingConfig signingConfigs.release
4337
}
4438
}
@@ -59,6 +53,7 @@ android {
5953
}
6054

6155
dependencies {
62-
implementation 'androidx.core:core:1.10.0'
56+
implementation 'androidx.core:core:1.12.0'
57+
implementation files('libs/ioio-release.aar')
6358
testImplementation 'junit:junit:4.13.2'
6459
}
Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
1-
# To enable ProGuard in your project, edit project.properties
2-
# to define the proguard.config property as described in that file.
31
#
4-
# Add project specific ProGuard rules here.
5-
# By default, the flags in this file are appended to flags specified
6-
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7-
# You can edit the include path and order by changing the ProGuard
8-
# include property in project.properties.
2+
# For more details, see https://developer.android.com/build/shrink-code
93
#
10-
# For more details, see
11-
# http://developer.android.com/guide/developing/tools/proguard.html
12-
13-
# Add any project specific keep options here:
14-
15-
# If your project uses WebView with JS, uncomment the following
16-
# and specify the fully qualified class name to the JavaScript interface
17-
# class:
18-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19-
# public *;
20-
#}
21-
22-
-keep public class * {
23-
public *;
24-
}
25-
26-
-keepclasseswithmembernames class * {
27-
native <methods>;
28-
}
294

5+
-keep public class net.sourceforge.smallbasic.** { public *; }
6+
-keep public class ioio.** { *; }
7+
-keepclasseswithmembernames class * { native <methods>; }
308
-printmapping build/outputs/mapping/release/mapping.txt
319
-keepattributes LineNumberTable,SourceFile

src/platform/android/app/src/main/assets/main.bas

Lines changed: 83 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ sub do_about()
152152
print "This program is free software; you can use it ";
153153
print "redistribute it and/or modify it under the terms of the ";
154154
print "GNU General Public License version 2 as published by ";
155-
print "the Free Software Foundation." + chr(10)
155+
print "the Free Software Foundation."
156156
print
157157
color colText
158158
server_info()
@@ -162,6 +162,77 @@ end
162162

163163
sub do_setup()
164164
local frm
165+
local fontId = int(env("fontId"))
166+
local loadModules = int(env("loadModules"))
167+
168+
color colText, colBkGnd
169+
cls
170+
at 0, char_h * 6
171+
print "Inconsolata:"
172+
print " Copyright 2006 The Inconsolata Project"
173+
print " http://scripts.sil.org/OFL"
174+
print "Envy Code R:"
175+
print " http://damieng.com/envy-code-r"
176+
print "Ubuntu:"
177+
print " https://ubuntu.com/legal/font-licence"
178+
at 0, char_h * 1
179+
local w = char_w * 14.5
180+
local h = char_h * 4.5
181+
local x = char_w / 2
182+
local y = char_h / 2
183+
rect x, y, w * 2, h + y * 2.5
184+
dim frm.inputs(4)
185+
frm.inputs(0).type = "label"
186+
frm.inputs(0).label = "Select display font:"
187+
frm.inputs(0).x = char_w
188+
frm.inputs(1).type = "list"
189+
frm.inputs(1).value = "Inconsolata|Envy Code R|UbuntuMono"
190+
frm.inputs(1).selectedIndex = iff(fontId in [0,1,2], fontId, 0)
191+
frm.inputs(1).x = char_w * 1.5
192+
frm.inputs(1).y = char_h * 2.2
193+
frm.inputs(1).height = char_h * 3 + 4
194+
frm.inputs(1).width = char_w * 12
195+
frm.inputs(2).type = "button"
196+
frm.inputs(2).backgroundColor = colBkGnd
197+
frm.inputs(2).color = colText
198+
frm.inputs(2).label = "OK"
199+
frm.inputs(2).value = "OK"
200+
frm.inputs(2).x = -(char_w * 2.5)
201+
frm.inputs(2).y = -char_h
202+
frm.inputs(3).type = "button"
203+
frm.inputs(3).backgroundColor = colBkGnd
204+
frm.inputs(3).color = colText
205+
frm.inputs(3).label = "Cancel"
206+
frm.inputs(3).value = "cancel"
207+
frm.inputs(3).x = -(char_w * .75)
208+
209+
frm = form(frm)
210+
while 1
211+
frm.doEvents()
212+
if (frm.value == "OK") then
213+
exit loop
214+
elseif (frm.value == "cancel") then
215+
goto exitFunc
216+
endif
217+
wend
218+
fontId = frm.inputs(1).selectedIndex
219+
220+
cls
221+
at 0, char_h * 1
222+
rect x, y, w * 2, h + y * 2.5
223+
frm.inputs(0).label = "Extension modules:"
224+
frm.inputs(1).value = "Ignore|Load"
225+
frm.inputs(1).selectedIndex = iff(loadModules == 1, 1, 0)
226+
frm = form(frm)
227+
while 1
228+
frm.doEvents()
229+
if (frm.value == "OK") then
230+
exit loop
231+
elseif (frm.value == "cancel") then
232+
goto exitFunc
233+
endif
234+
wend
235+
loadModules = frm.inputs(1).selectedIndex
165236

166237
color colText, colBkGnd
167238
cls
@@ -188,45 +259,30 @@ sub do_setup()
188259
env("serverToken=" + token)
189260
endif
190261

191-
color colText, colBkGnd
192-
cls
193-
print "Web service port number: " + env("serverSocket")
194-
print
195-
print boldOn + "Select display font."
196-
print boldOff
197-
print "Envy Code R:"
198-
print " http://damieng.com/envy-code-r"
199-
print "Inconsolata:"
200-
print " Copyright 2006 The Inconsolata Project"
201-
print " http://scripts.sil.org/OFL"
202-
print "Ubuntu:"
203-
print " https://ubuntu.com/legal/font-licence"
204-
print
205-
dim frm.inputs(1)
206-
frm.inputs(0).type="list"
207-
frm.inputs(0).value="Inconsolata|Envy Code R|UbuntuMono"
208-
frm.inputs(0).selectedIndex=env("fontId")
209-
frm.inputs(0).height=TXTH("Q")*3+4
210-
frm.inputs(0).width=TXTW("Q")*12
211-
frm = form(frm)
212-
frm.doEvents()
213-
env("fontId=" + frm.inputs(0).selectedIndex)
262+
env("fontId=" + fontId)
263+
env("loadModules=" + loadModules)
214264

215265
local msg = "You must restart SmallBASIC for this change to take effect."
216266
wnd.alert(msg, "Restart required")
267+
268+
label exitFunc
217269
clear_screen()
218270
end
219271

220272
sub server_info()
221273
local serverSocket = env("serverSocket")
222274
local ipAddr = env("IP_ADDR")
275+
local loadModules = int(env("loadModules"))
223276

224277
if (len(serverSocket) > 0 && int(serverSocket) > 1023 && int(serverSocket) < 65536 && len(ipAddr)) then
225278
serverSocket = ipAddr + ":" + serverSocket
226279
print boldOff + "Web Service: " + boldOn + serverSocket
227280
print boldOff + "Access token: " + boldOn + env("serverToken")
228-
print boldOff
281+
print boldOff;
229282
fi
283+
284+
print "Extension modules: " + boldOn + iff(loadModules == 2, "Active", iff(loadModules == 1, "Enabled", "Disabled"))
285+
print boldOff
230286
end
231287

232288
func fileCmpFunc0(l, r)
@@ -667,9 +723,9 @@ sub main
667723
frm.inputs << bn_files
668724
frm.inputs << bn_online
669725
frm.inputs << bn_scratch
670-
if (!is_sdl) then
726+
' if (!is_sdl) then
671727
frm.inputs << bn_setup
672-
endif
728+
' endif
673729
frm.inputs << bn_about
674730
listFiles frm, path, sortDir, basList
675731
frm = form(frm)

0 commit comments

Comments
 (0)