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

0 Members and 1 Guest are viewing this topic.

Offline Silver Shadow

  • Beta Tester
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +27/-7
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #465 on: February 23, 2011, 12:38:17 pm »
Have you added
C:/Users/christiancoors/Desktop/TI-nspire/ndless/trunk/bin
to your PATH variable?
Former Coder of Tomorrow


Offline Cuervo

  • LV2 Member (Next: 40)
  • **
  • Posts: 33
  • Rating: +2/-1
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #466 on: February 23, 2011, 01:01:52 pm »
Yes, I did

Code: [Select]
export PATH=$PATH:/Users/christiancoors/Desktop/TI-nspire/ndless/trunk/bin/
before.. (on Mac OS X there is no 'C'-drive..)


If I don't do that he tells me os.h is missing and with it it's being included. (but not finding stddef.h)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #467 on: February 23, 2011, 01:36:51 pm »
I think stddef.h is part of YAGARTO. Is Yagarto's bin folder also in your path?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Cuervo

  • LV2 Member (Next: 40)
  • **
  • Posts: 33
  • Rating: +2/-1
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #468 on: February 24, 2011, 11:15:48 am »
OK, I got very (!) far now, the only thing not working is I'm not getting a ndless_resources.tns..

Code: [Select]
nspire-gcc -Os -nostdlib -Wall -W -Wno-strict-aliasing -c syscalls_cas-2.0.1.c
nspire-gcc -Os -nostdlib -Wall -W -Wno-strict-aliasing -c syscalls_ncas-2.1.0.c
nspire-gcc -Os -nostdlib -Wall -W -Wno-strict-aliasing -c syscalls_cas-2.1.0.c
nspire-ld --light-startup -nostdlib install.o ploaderhook.o ints.o syscalls.o utils.o emu.o syscalls_ncas-1.7.o syscalls_cas-1.7.o syscalls_ncas-2.0.1.o syscalls_cas-2.0.1.o syscalls_ncas-2.1.0.o syscalls_cas-2.1.0.o -o ndless_core.elf
"/usr/local/arm-elf/bin/arm-elf-objcopy" -O binary ndless_core.elf ndless_core.bin
stage2_hexsize=`wc -c ndless_stage2.bin | cut -f1 -d' ' | xargs  printf '%04x'` \
&& test -n "$stage2_hexsize" \
&& echo -e -n "\x${stage2_hexsize:2:2}\x${stage2_hexsize:0:2}\x00\x00" > ../calcbin/ndless_resources.tns
make[1]: *** [ndless_resources.tns] Error 1
make: *** [subdirs] Error 1

I actually do not see, what the problem is..


EDIT:
Ok, if I manually enter the number, I get the file. Does not work on my nspire cas OS 2.1.0 or 2.0.1.. tried many times. Always crashes.

TIA
Cuervo
« Last Edit: February 24, 2011, 01:59:34 pm by Cuervo »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #469 on: February 25, 2011, 03:26:20 pm »
Hi Cuervo and welcome to the forums (I wonder if I missed anyone else, but welcome to others too). Hopefully now you should no longer need to compile Ndless as ExtendeD posted a binary of it here: http://ourl.ca/9367

Just make sure to send the right file to your calculator, though. There is one for OS 1.7, one for 2.0.1 and one for 2.1, and you must also send the resources file.

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 #470 on: February 25, 2011, 05:06:12 pm »
Just found a little bug: I notice that when Ndless tries to restore the FIQ vector (in arm/bootstrapper.S main_copy), it overwrites the Undefined Instruction jump instead:

A4000000  18 F0 9F E5 E4 66 26 10-18 F0 9F E5 18 F0 9F E5
A4000010  18 F0 9F E5 18 F0 9F E5-18 F0 9F E5 18 F0 9F E5
A4000020  30 60 26 10 28 48 04 11-4C 47 04 11 20 48 04 11
A4000030  18 48 04 11 00 00 00 00-C0 66 26 10 40 00 00 00
This one was well hidden! I've just fixed it. I wonder if this could be the source of the random crashes at installation time.
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 #471 on: February 25, 2011, 05:51:34 pm »
In the meantime, I think that the number keys may actually be easier to use. But do you think it would be possible to move the down arrow to 5? If you're using one hand, the key in the middle makes it hard to use the keys as a joypad.
So:
....8...
.4.5.6.

8 = up
4 = left
5 = down
6 = right

and then maybe make click "2".

Have any apps other than block dude been compiled with this configuration? (i.e., gbc4nspire or nes)

I haven't touched a single line of code since then, but I'm keeping track of your bug reports and suggestions, hopefully I'll try to integrate them soon.


What have you decided about the arrow and number keys?

I think mapping arrow keys to number keys at the Ndless level (which has been introduced in the last builds if I've understood well) is a bad idea.

I can understand this "hack" has been introduced to make old Ndless 1.7 games work without modifying the source...
But let's look at the future and not at the past: there are many reasons a program would like to test for number keys (numerical input, menu choice...).

I think it's up to the program itself to test for number keys and to decide to handle them either as numbers either as arrows.
About this, I have an idea that might make everything work great: how about add a line in Ndless program headers so as to specify for which version they were compiled for. If this line is absent, consider it to be an Ndless 1.7 program, and make Ndless decide which buttons to use, but if the line says that the program was made for Ndless 2.0, let the program decide its own course of action in regard of the keys.
What do you think?

I have implemented codeslicer's suggestion for the v2.0 release. Block Dude and maybe nDoom need to be rebuilt to use the new mapping if apcalc and Mrakoplaz want to, sorry for the inconvenience.

In any case programs written for Ndless 1.1 needs to be rebuilt with this version to be compatible with the Touchpad, and programs will have to be rebuilt once the full Touchpad support is added to Ndless, since the key mapping is actually inlined into the program's codes. With the current implementation the options are the following:
- either the program keeps the current default mapping, and will be rebuilt (and perhaps slightly adapted) once the Touchpad arrows scanning is available in Ndless
- either the program needs both arrow keys and numeric keys as input, and layout the keyboard as it wants, without using the  KEY_NSPIRE_LEFT constants and the like.

Are we all OK with this?
Ndless.me with the finest TI-Nspire programs

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #472 on: February 26, 2011, 02:40:47 am »
As I wrote in another topic, for fully abstracting the Clickpad/Touchpad difference wrt. direction and click, and for proper handling of arrow keys and numeric keys used at the same time in a given program, we may want to kill the KEY_NSPIRE_* and usage of isKeyPressed() for those five keys, and move the way to check those keys to a new function.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Cuervo

  • LV2 Member (Next: 40)
  • **
  • Posts: 33
  • Rating: +2/-1
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #473 on: February 26, 2011, 07:57:01 am »
Hi Cuervo and welcome to the forums (I wonder if I missed anyone else, but welcome to others too). Hopefully now you should no longer need to compile Ndless as ExtendeD posted a binary of it here: http://ourl.ca/9367

Just make sure to send the right file to your calculator, though. There is one for OS 1.7, one for 2.0.1 and one for 2.1, and you must also send the resources file.

Ok.. thanks!

That version actually DOES work while the one compiled by me does not. I have no idea why.
Anyway, it's great!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #474 on: February 26, 2011, 02:04:03 pm »
Ok great to hear. This one might work better since he fixed some errors and is supposedly more stable. It doesn't seem to run nDoom as well for me, though, but I think Mraklopaz has to recompile it.

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 #475 on: March 04, 2011, 10:16:22 am »
Touchpad scan has been added with the help of Goplat. Since I don't own a TI-Nspire Touchpad and could only rely on emulated tests, I am really interested by any feedback from Touchpad users. For this you need to:

  • Update your Ndless SVN working directory and rebuild everything
  • Rebuild your program or game with this version to check that isKeyPressed([arrow]) works well and there are no regressions. Don't forget to use the new version of Ndless on the calc.
  • Check how isKeyPressed(KEY_NSPIRE_CLICK) reacts since I cannot test it on nspire_emu
  • Run tests/ndless_tpad.tns adapted from Goplat's sample, that shows low-level scan
  • Use the Touchpad API in your own program! The gaming experience could really be enhanced.

Here is a description of the current implementation, that may be adapted if it doesn't behave well on real hardware:
The area is divided in 9 rectangles (left, upper-left, up, upper-right and so one) of identical width and height. Touching the rectangle in the middle make it click. I'm not sure if I should use a non-default proximity sensitivity for this one to be consistent with the OS behavior. I have never used a Touchpad so please tell me how it feels.
« Last Edit: March 04, 2011, 12:55:45 pm by ExtendeD »
Ndless.me with the finest TI-Nspire programs

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #476 on: March 04, 2011, 11:14:43 am »
The touchpad isn't divided into 9 rectangles? Also, you say "Touching the rectangle in the middle makes it click." I assume you also have to press the button down for a keypress to register?

Edit:
Also, nice work :)
« Last Edit: March 04, 2011, 11:15:29 am by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #477 on: March 04, 2011, 12:51:53 pm »
nice that the touchpad is now included, but sadly I get an erro when trying to build this version :(  :banghead:

Code: [Select]
make all in arm...
make[1]: Entering directory /d/Nspire/Ndless/arm
nspire-as -Os -nostdlib -Wall -Wno-strict-aliasing -D OS_VERSION_INT=17 -c bootstrapper.S
c:/program files (x86)/yagarto/lib/gcc/../../arm-none-eabi/sys-include/stdint.h: Assembler message:
41: Error: bad instruction 'typedef signed char int8_t'
c:/program files (x86)/yagarto/lib/gcc/../../arm-none-eabi/sys-include/stdint.h: Assembler message:
42: Error: bad instruction 'typedef unsigned char uint8_t'
...
...lots of similar errors
...

Anyone an idea where to search for the source of this... ?

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Ndless 2.0 for TI-Nspire Clickpad/Touchpad
« Reply #478 on: March 04, 2011, 12:54:59 pm »
This looks like some C code getting included bare-naked into an ASM file ?
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

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 #479 on: March 04, 2011, 01:01:53 pm »
calc84maniac: sorry, yes its 9.
Which button do you mean? (I have never seen a real Touchpad)

shrear, Lionel: you're right, I should have "make clean all". It's fixed.
Ndless.me with the finest TI-Nspire programs