Author Topic: Ndless 2.0 for TI-Nspire Clickpad/Touchpad  (Read 162898 times)

0 Members and 1 Guest are viewing this topic.

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #90 on: December 22, 2010, 12:27:26 pm »
Oh, right. But why did it fail even on nspire_emu?
Ndless.me with the finest TI-Nspire programs

Offline Goplat

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 289
  • Rating: +82/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #91 on: December 22, 2010, 06:15:36 pm »
Figured it out - it's a bug in nspire_emu :( The thumb instruction "neg" ought to set the carry and overflow flags, but it doesn't. This messes up gcc's way of implementing the ! operator in thumb:

Code: [Select]
neg r1, r0 @ r1 = -r0, carry set if r0 == 0
adc r0, r1 @ r0 is now 1 if it was 0 before, 0 otherwise

Here is a patch that hopefully fixes it:

Code: [Select]
Index: cpu.c
===================================================================
--- cpu.c (revision 58)
+++ cpu.c (working copy)
@@ -861,7 +861,7 @@
  case 0x6: /* SBC */ res = *dst = add(*dst, ~src, arm.cpsr_c, true); break;
  case 0x7: /* ROR */ res = *dst = shift(3, *dst, src & 0xFF, true); break;
  case 0x8: /* TST */ res = *dst & src; break;
- case 0x9: /* NEG */ res = *dst = -src; break;
+ case 0x9: /* NEG */ res = *dst = add(0, ~src, 1, true); break;
  case 0xA: /* CMP */ res = add(*dst, ~src, 1, true); break;
  case 0xB: /* CMN */ res = add(*dst, src, 0, true); break;
  case 0xC: /* ORR */ res = *dst |= src; break;
Numquam te deseram; numquam te deficiam; numquam circa curram et te desolabo
Numquam te plorare faciam; numquam valedicam; numquam mendacium dicam et te vulnerabo

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #92 on: December 22, 2010, 07:37:54 pm »
Ok, this makes thinkgs much clearer :) This issue was driving me mad, since I trusted both GCC and nspire_emu.
Ndless.me with the finest TI-Nspire programs

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #93 on: December 22, 2010, 07:45:04 pm »
I have just commited full support for the Touchpad key layout. Thanks bsl for the constants which helped me a lot, and Goplat for the original key map.

Programs need to be rebuilt with this version to handle properly the layout. Some programs which depends on Clickpad-specific keys will need slight changes (such as BlockDude which uses the Home key).

I'm interested to know how it works on real hardware, and if this update fixes the random reboot issue on Touchpad (it probably doesn't). The particles demo and BlockDude are good choices for a test.

Unfortunately gbc4nspire would need some reverse-engineering work to update it...

More details for developers:

Touchpad support is transparent, but makes the program slightly bigger (and slightly slower).
isKeyPressed will always return FALSE when scanning keys which does not exist on a model.
If needed, the variable BOOL is_touchpad can be used to determine the model.
« Last Edit: December 22, 2010, 07:49:12 pm by ExtendeD »
Ndless.me with the finest TI-Nspire programs

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #94 on: December 22, 2010, 08:30:51 pm »
Programs need to be rebuilt with this version to handle properly the layout. Some programs which depends on Clickpad-specific keys will need slight changes (such as BlockDude which uses the Home key).

Better fix this! :P

Also, I should have some free time tomorrow, so I'll test the touchpad a bit with this new version!
« Last Edit: December 22, 2010, 08:34:19 pm by apcalc »


Offline Goplat

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 289
  • Rating: +82/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #95 on: December 22, 2010, 09:13:27 pm »
ExtendeD: With a fresh compile, the "swi 80003b" call in crt0.o's cache_keypad_type is getting linked into ndless_resources.tns, and the installer's swi handler doesn't handle that.

apcalc: Does this mean your touchpad is working again? Good to see the problem wasn't permanent.
Numquam te deseram; numquam te deficiam; numquam circa curram et te desolabo
Numquam te plorare faciam; numquam valedicam; numquam mendacium dicam et te vulnerabo

Offline bsl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 157
  • Rating: +14/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #96 on: December 22, 2010, 11:30:26 pm »
apcalc: If you get the Touchpad problem again,  try pinching your fingers across the  contacts
- this might discharge any charge buildup, that causes the Touchpad not to work properly which was
running under abnormal conditions.
The Datamath website shows extensive integrated circuitry in the keypads.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #97 on: December 23, 2010, 12:46:17 am »
Wow nice updates guys!
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #98 on: December 23, 2010, 12:54:07 am »
Quote
1) Make sure to disconnect the calculator from the computer before running ndless_installer. What is your average success rate with this condition? It should be around 2/3.

So, now we won't need it connected through USB to install? Sweet! I have been considering making a little dongle for my nspire, so it's "connected" to something. I found out it can be connected to any device, including DSLR Cameras :P

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #99 on: December 23, 2010, 05:58:27 am »
Many of you will be much interested by Goplat's update of nspire_emu, which include compatibility of file transfers with OS 2.x.

willrandship: Not anymore since Ndless v1.7.

Goplat: Thanks, I have just fixed it, I am not sure how I didn't see it during my tests.
Ndless.me with the finest TI-Nspire programs

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #100 on: December 23, 2010, 06:26:30 am »
I tried the "Keys"....
arrowkeys still don't work
and for particles I have to use w+q

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #101 on: December 23, 2010, 06:55:02 am »
Quote
arrowkeys still don't work
With which program do you have problems?

Would you have better luck with this build?
« Last Edit: December 23, 2010, 06:56:03 am by ExtendeD »
Ndless.me with the finest TI-Nspire programs

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #102 on: December 23, 2010, 06:56:20 am »
Would you have better luck with this build?

I couldn't use that build in a touchpad (if that's the same one I used, since the version name is the same)

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #103 on: December 23, 2010, 07:20:02 am »
Blockdude
and I already use version 348
I compared the "common.h"s they are identical.

Would you have better luck with this build?

I couldn't use that build in a touchpad (if that's the same one I used, since the version name is the same)
Ndless as such works fine for me with this version
« Last Edit: December 23, 2010, 07:21:57 am by shrear »

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #104 on: December 23, 2010, 07:26:46 am »
I couldn't use that build in a touchpad (if that's the same one I used, since the version name is the same)

It isn't. Your problem was a wrong OS version if I remember.

Blockdude
and I already use version 348
I compared the "common.h"s they are identical.

I suspect a build issue, so I'm sharing my binaries. Did you fully rebuild Ndless with "make clean all" at the root?
Also did you rebuild BlockDude?
Ndless.me with the finest TI-Nspire programs