Skip to content

Commit 3e57e9b

Browse files
committed
Support for OS 4.5.4.48 and 5.3.0.564
- Improve idc/Readme a bit - Minor improvements in mkSyscalls.php - Fix typo in name of OS_cascx2-5.2.0.711.idc - Change nl_is_cx2 to look at HW regs instead, the version index isn't contiguous anymore - Add support to the OSs to installer-5.2 - Initialize "s" only once - Don't start the timer from on.paint, but on startup and then each second - Add a message on install failure
1 parent fe04e49 commit 3e57e9b

22 files changed

+5121
-128
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Ndless r2016 for TI-Nspire OS <= v5.2.0.771
1+
Ndless r2017 for TI-Nspire OS <= v5.3.0.564
22
===========================================
33

44
Installing Ndless on your calculator makes it possible to run assembly programs.
@@ -30,22 +30,22 @@ For more in-depth info, visit the wiki:
3030
Quick guide
3131
===========
3232

33-
OS 5.2.0.771 <img src="https://i.imgur.com/QB9eogm.png" align="right">
33+
OS 5.2.0.771 + 5.3.0.564 <img src="https://i.imgur.com/kozAxpP.png" align="right">
3434
--------
3535

36-
Prerequisites: OS 5.2.0.771 on CX II, CX II-T or CX II CAS
36+
Prerequisites: OS 5.2.0.771 or 5.3.0.564 on CX II, CX II-T or CX II CAS
3737

38-
* Transfer ndless_installer_5.2.0.tns into a folder named "ndless" (top-level)
38+
* Transfer ndless_installer_5.2.0-5.3.0.tns into a folder named "ndless" (top-level)
3939
* Transfer ndless_resources.tns into the same folder
4040
* Open the installer and wait
4141
* Have fun!
4242

43-
OS 4.5.3 <img src="https://i.imgur.com/4CDztSP.png" align="right">
43+
OS 4.5.3.14 + 4.5.4.48 <img src="https://i.imgur.com/uuO3ue9.png" align="right">
4444
--------
4545

46-
Prerequisites: OS 4.5.3.14 on CX or CX CAS
46+
Prerequisites: OS 4.5.3.14 or 4.5.4.48 on CX or CX CAS
4747

48-
* Transfer ndless_installer_4.5.3.tns into a folder named "ndless" (top-level)
48+
* Transfer ndless_installer_4.5.3-4.5.4.tns into a folder named "ndless" (top-level)
4949
* Transfer ndless_resources.tns into the same folder
5050
* Open the installer and wait
5151
* Have fun!
@@ -122,7 +122,7 @@ For CX and CX CAS please install 3.9.1.
122122
OS 3.6 <img src="http://www.mirari.fr/NwM1" align="right">
123123
------
124124

125-
Prerequisites: OS 3.6
125+
Prerequisites: OS 3.6
126126

127127
* Transfer ndless_installer.tns and ndless_resources.tns into a folder named "ndless" (top-level)
128128
* Open the installer

ndless/src/installer-5.2/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ GXXFLAGS := $(GCCFLAGS) -std=c++11 -fno-exceptions -fno-rtti
99
LFLAGS := -nostdlib
1010
DISTDIR := ../../calcbin
1111

12-
all: $(DISTDIR)/ndless_installer_5.2.0.tns $(DISTDIR)/ndless_installer_4.5.3.tns
12+
all: $(DISTDIR)/ndless_installer_5.2.0-5.3.0.tns $(DISTDIR)/ndless_installer_4.5.3-4.5.4.tns
1313

1414
%.o: %.c
1515
$(GCC) $(GCCFLAGS) -c $< -o $@
@@ -33,15 +33,15 @@ Problem1_mid.xml: ndless_installer.bin
3333
../tools/LuaBin/luabin ndless_installer.bin - installer > $@
3434

3535
# Those can't be built simultaneously due to using "Problem1.xml" as filename
36-
$(DISTDIR)/ndless_installer_5.2.0.tns: $(DISTDIR)/ndless_installer_4.5.3.tns
36+
$(DISTDIR)/ndless_installer_5.2.0-5.3.0.tns: $(DISTDIR)/ndless_installer_4.5.3-4.5.4.tns
3737

38-
$(DISTDIR)/ndless_installer_%.tns: Problem1_top.xml Problem1_mid.xml Problem1_bot_%.xml
38+
$(DISTDIR)/ndless_installer_%.tns: Problem1_top.xml Problem1_mid.xml Problem1_bot.xml
3939
mkdir -p $(DISTDIR)
40-
cat Problem1_top.xml Problem1_mid.xml Problem1_bot_$*.xml > Problem1.xml
40+
cat Problem1_top.xml Problem1_mid.xml Problem1_bot.xml > Problem1.xml
4141
../../../ndless-sdk/tools/luna/luna Problem1.xml $@
4242
rm Problem1.xml
4343

44-
test: $(DISTDIR)/ndless_installer_5.2.0.tns
44+
test: $(DISTDIR)/ndless_installer_5.2.0-5.3.0.tns
4545
firebird-send $^ ndless
4646

4747
clean:

ndless/src/installer-5.2/Problem1_bot_4.5.3.xml renamed to ndless/src/installer-5.2/Problem1_bot.xml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
1+
function on.paint(gc)
12
gc:setFont(&quot;sansserif&quot;, &quot;b&quot;, 15)
2-
drawXCenteredString(gc, &quot;Ndless for OS 4.5.3.14&quot;, 30)
3+
drawXCenteredString(gc, &quot;Ndless for OS:&quot;, 10)
4+
gc:setFont(&quot;sansserif&quot;, &quot;b&quot;, 12)
5+
drawXCenteredString(gc, &quot;4.5.3.14&quot;, 40)
6+
7+
drawXCenteredString(gc, &quot;4.5.4.48&quot;, 60)
8+
drawXCenteredString(gc, &quot;5.2.0.771&quot;, 90)
9+
drawXCenteredString(gc, &quot;5.3.0.564&quot;, 110)
310

411
gc:setFont(&quot;sansserif&quot;, &quot;r&quot;, 10)
512

613
if ndless then
7-
gc:drawString(&quot;Ndless is already installed!&quot;, 5, 60, &quot;top&quot;)
14+
gc:drawString(&quot;Ndless is already installed!&quot;, 5, 150, &quot;top&quot;)
815
return
916
end
1017

11-
gc:setColorRGB(0, 0, 0)
12-
gc:fillRect(0, 100, platform.window:width(), 2)
13-
14-
gc:setFont(&quot;sansserif&quot;, &quot;r&quot;, 9)
15-
gc:drawString(&quot;(this line is just deco)&quot;, 198 + 0, 53 + 30, &quot;top&quot;)
18+
gc:drawString(&quot;Installing ndless...&quot;, 5, 150, &quot;top&quot;)
1619

17-
s = ""
18-
s = string.rep(installer, 768)
20+
if attempt &gt; 2 then
21+
gc:drawString(&quot;Several attempts failed,&quot;, 5, 170, &quot;top&quot;)
22+
gc:drawString(&quot;missing ndless_resources.tns?&quot;, 5, 185, &quot;top&quot;)
23+
end
24+
end
1925

20-
timer.start(0.2)
26+
s = ""
27+
s = string.rep(installer, 768)
28+
if not ndless then
29+
timer.start(0.3)
2130
end
2231

2332
function on.timer()
@@ -32,8 +41,8 @@
3241
shape = physics.CircleShape(body, 1, physics.Vect(0, 0))
3342
space:addShape(shape)
3443

35-
a = ""
36-
x = string.pack("u32", 0x13000000)
44+
local a = ""
45+
local x = string.pack("u32", 0x13000000)
3746

3847
function preSolveCb()
3948
space:removeCollisionHandler(0, 0)
@@ -45,6 +54,10 @@
4554
end
4655
space:addCollisionHandler(0, 0, {preSolve = preSolveCb})
4756
space:step(1)
57+
58+
attempt = attempt + 1
59+
platform.window:invalidate()
60+
timer.start(1)
4861
end
4962
</sc:script>
5063
</wdgt>

ndless/src/installer-5.2/Problem1_bot_5.2.0.xml

Lines changed: 0 additions & 52 deletions
This file was deleted.

ndless/src/installer-5.2/Problem1_top.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
</sc:md>
1818
<sc:script version="33817092" id="0">
1919
platform.apiLevel = &quot;2.7&quot;
20+
attempt = 0
2021

2122
local function drawXCenteredString(gc, str, y)
2223
gc:drawString(str, (platform.window:width() - gc:getStringWidth(str)) / 2, y, &quot;top&quot;)
2324
end
2425

25-
function on.paint(gc)

ndless/src/installer-5.2/stage0.S

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.text
22
_start: .global _start
33
.org 0 @ Actually not, but this is PIC
4-
.rep 1024
4+
.rep 1152
55
b begin
66
.endr
77

@@ -112,6 +112,41 @@ nextos:
112112
.word 0x1043AF3C @ fread
113113
.word 0x1043A5B8 @ fclose
114114

115+
.word 0x10417DA0 @ 5.3.0.564 CAS CX II
116+
.word 0x1048CB78 @ stat
117+
.word 0x1047E988 @ malloc
118+
.word 0x104847DC @ fopen
119+
.word 0x10484980 @ fread
120+
.word 0x1048425C @ fclose
121+
122+
.word 0x10417460 @ 5.3.0.564 non-CAS CX II-T
123+
.word 0x1048C238 @ stat
124+
.word 0x1047E048 @ malloc
125+
.word 0x10483E9C @ fopen
126+
.word 0x10484040 @ fread
127+
.word 0x1048391C @ fclose
128+
129+
.word 0x10416CC0 @ 5.3.0.564 non-CAS CX II
130+
.word 0x1048BA98 @ stat
131+
.word 0x1047D8A8 @ malloc
132+
.word 0x104836FC @ fopen
133+
.word 0x104838A0 @ fread
134+
.word 0x1048317C @ fclose
135+
136+
.word 0x103B4130 @ 4.5.4.48 CAS CX
137+
.word 0x10444168 @ stat
138+
.word 0x104365B8 @ malloc
139+
.word 0x1043BEA8 @ fopen
140+
.word 0x1043C04C @ fread
141+
.word 0x1043B6C8 @ fclose
142+
143+
.word 0x103B3A10 @ 4.5.4.48 non-CAS CX
144+
.word 0x10443A00 @ stat
145+
.word 0x10435E98 @ malloc
146+
.word 0x1043B788 @ fopen
147+
.word 0x1043B92C @ fread
148+
.word 0x1043AFA8 @ fclose
149+
115150
endos:
116151
.word 0x0
117152

ndless/src/resources/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GENZEHN = genzehn
88

99
GCCFLAGS = -Wall -Wextra -W -marm
1010
LDFLAGS = -Wl,-e,main,--gc-sections
11-
ZEHNFLAGS = --name "ndless_resources" --include-bss --uses-lcd-blit true --version 2016
11+
ZEHNFLAGS = --name "ndless_resources" --include-bss --uses-lcd-blit true --version 2017
1212

1313
ifeq ($(DEBUG),FALSE)
1414
GCCFLAGS += -Os

ndless/src/resources/install.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ static unsigned const ploader_hook_addrs[NDLESS_MAX_OSID+1] =
4444
0x1000AD90, 0x1000AD8C,
4545
0x1000ADAC, 0x1000ADB4,
4646
0x1000ADAC, 0x1000ADE4,
47-
0x1002612C, 0x10026144, 0x10026164};
47+
0x1002612C, 0x10026144, 0x10026164,
48+
0x1000B034, 0x1000B074,
49+
0x10028168, 0x100282A4, 0x100282F8};
4850

4951
// initialized at load time. Kept in resident program memory, use nl_is_3rd_party_loader to read it.
5052
static BOOL loaded_by_3rd_party_loader = FALSE;
@@ -66,6 +68,8 @@ static unsigned const end_of_init_addrs[NDLESS_MAX_OSID+1] =
6668
0x10012E54, 0x10012E00,
6769
0x10012E8C, 0x10012E44,
6870
0x0, 0x0,
71+
0x0, 0x0, 0x0,
72+
0x0, 0x0,
6973
0x0, 0x0, 0x0};
7074

7175
// OS-specific
@@ -83,7 +87,9 @@ static unsigned const error_msg_patch_addrs[NDLESS_MAX_OSID+1] =
8387
0x10125670, 0x10125508,
8488
0x10125B58, 0x10125A7C,
8589
0x10126084, 0x10125FB4,
86-
0x1015CC6C, 0x1015CE10, 0x1015CDFC};
90+
0x1015CC6C, 0x1015CE10, 0x1015CDFC,
91+
0x1012656C, 0x101264F4,
92+
0x101600AC, 0x10160354, 0x1016038C};
8793

8894
// OS-specific (only set if the installer document needs to be closed)
8995
// close_document
@@ -100,7 +106,9 @@ static unsigned const close_document_addrs[NDLESS_MAX_OSID+1] =
100106
0x1000b240, 0x1000b23c,
101107
0x0, 0x0,
102108
0x1000B278, 0x1000B2B0,
103-
0x100265D4, 0x10026614, 0x1002660C};
109+
0x100265D4, 0x10026614, 0x1002660C,
110+
0x1000B4E4, 0x1000B524,
111+
0x10028610, 0x10028770, 0x100287A0};
104112

105113
void ins_uninstall(void) {
106114
ut_calc_reboot();
@@ -214,7 +222,9 @@ const unsigned ins_successmsg_hook_addrs[NDLESS_MAX_OSID+1] =
214222
0x100310FC, 0x100310A4,
215223
0x100311C4, 0x10031164,
216224
0x100311C0, 0x10031198,
217-
0x1004AD6C, 0x1004ADF4, 0x1004ADB4};
225+
0x1004AD6C, 0x1004ADF4, 0x1004ADB4,
226+
0x1003167C, 0x10031660,
227+
0x1004CE70, 0x1004D018, 0x1004D00C};
218228

219229
// OS-specific
220230
// number of the HOME icon
@@ -231,6 +241,8 @@ const unsigned ins_successmsg_icon[NDLESS_MAX_OSID+1] =
231241
0x172, 0x172,
232242
0x172, 0x172,
233243
0x172, 0x172,
244+
0x14F, 0x14F, 0x14F,
245+
0x18C, 0x18C,
234246
0x14F, 0x14F, 0x14F};
235247

236248
void ins_install_successmsg_hook(void) {

ndless/src/resources/lcd_compat.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ static uint32_t lcd_mirror_ptr[NDLESS_MAX_OSID+1] = {0, 0, 0, 0, 0, 0,
2424
0x113496E4, 0x113B16E4,
2525
0x1134D6E4, 0x113B16E4,
2626
0x1134D6E4, 0x113B16E4,
27+
0x0, 0x0, 0x0,
28+
0x1134D6E4, 0x113B56E4,
2729
0x0, 0x0, 0x0};
2830

2931
static uint32_t *real_lcdc = (uint32_t*) 0xE0000000;
@@ -152,12 +154,14 @@ static uint32_t spi_send_ptr[NDLESS_MAX_OSID+1] = {0, 0, 0, 0, 0, 0,
152154
0x10023D08, 0x10023C98,
153155
0x10023D2C, 0x10023CC8,
154156
0x10023D2C, 0x10023CF8,
155-
0x100106F4, 0x100106F4, 0x100106F4};
157+
0x100106F4, 0x100106F4, 0x100106F4,
158+
0x100241B4, 0x10024188,
159+
0x10010734, 0x10010734, 0x10010734};
156160

157161
static void spi_send(uint8_t cmd, const uint8_t *data, unsigned int data_count)
158162
{
159163
// Different method signatures
160-
if(ut_os_version_index < 34)
164+
if(!nl_is_cx2())
161165
{
162166
void (*os_spi_send)(uint16_t, const uint8_t *, int) = (typeof(os_spi_send))spi_send_ptr[ut_os_version_index];
163167
os_spi_send(cmd, data, data_count);

ndless/src/resources/luaext.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ static unsigned const interp_startup_addrs[NDLESS_MAX_OSID+1] =
8484
0x10141830, 0x10141A50,
8585
0x101420E0, 0x1014241C,
8686
0x10142838, 0x10142B7C,
87-
0x10178748, 0x101788F4, 0x10178E38};
87+
0x10178748, 0x101788F4, 0x10178E38,
88+
0x10142D40, 0x101430F4,
89+
0x1017BBCC, 0x1017BE74, 0x1017C40C};
8890

8991
// At the beginning of lua_close
9092
// OS-specific
@@ -101,7 +103,9 @@ static unsigned const interp_shutdown_addrs[NDLESS_MAX_OSID+1] =
101103
0x10871420, 0x10871A6C,
102104
0x10872178, 0x108728E4,
103105
0x10872BB4, 0x10873370,
104-
0x108A6D1C, 0x108A73EC, 0x108A8104};
106+
0x108A6D1C, 0x108A73EC, 0x108A8104,
107+
0x10873B2C, 0x108742E4,
108+
0x108AE9D8, 0x108AF1B4, 0x108AFEF4};
105109

106110
void lua_install_hooks(void) {
107111
if(interp_startup_addrs[ut_os_version_index] != 0)

0 commit comments

Comments
 (0)