Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - critor

Pages: 1 ... 115 116 [117] 118 119 ... 137
1741
Other Calculators / Re: Turn on the light on the Nspire
« on: December 18, 2010, 07:30:15 am »
I'm curious what would happen if you run your program during PPT (if Ndless works in PPT), I would test it myself but I have a touchpad cas... so no Ndless.

I think you cannot run Ndless while in PTT, because you cannot access the /phoenix/documents folder.

But if we find a way, yes it would be very interesting.

Here's a video showing the program working (when it works, which is quite rare for now):

1742
Other Calculators / Re: Turn on the light on the Nspire
« on: December 17, 2010, 11:04:16 pm »
I might be completly wrong, but I think that the calculator reboots beacause something related to PTT is triggered. (the calculator reboots both when entering and exiting PTT)

But my calculators aren't in PTT mode.
But maybe the reboots did activated some "lock led state" code related to PTT, without entering PTT... Would mean I would be in some king of "incomplete" PTT.

But I cannot reset that "special" mode without exiting PTT.. And I cannot exit PTT because I'm not in PTT... So, let's put the calculator in PTT!
(don't do it, unless you have a second TI-Nspire to unlock it)

I've taken 2 TI-Nspire ClickPad.
I've put them in PTT mode, and then I've exited that mode.
(thinking it could reset the "lock led" or whatever it is)

On one calculator:
* Immediate reboot when starting program.
* After that, same behavior as described above: memory content is not changed.

On the other calculator:
* It works! I press 'G', 'R', 'Y' keys, and the LED is turned on in green, red or yellow.
* I even managed to launch the program severall times.


It seems to confirme my hypothesis.
Now the question is: "how could I prevent rebooting while reading/writing the LED mode?"...

1743
Other Calculators / Turn on the light on the Nspire
« on: December 17, 2010, 10:44:05 pm »
Hi!


I'd like to make a Ndless program able to control the LED present on the following models:
* TI-Nspire ClickPad
* TI-Nspire TouchPad
* TI-Nspire CAS TouchPad
(the TI-Nspire CAS ClickPad doesn't have that LED but has the circuit -> you might make a hole and solder it)

There are many uses for that LED.
It could be used in games as a won/lost or hit/missed indicator.
You might use it to indicate your mood of the day: red for "mad: don't speak to me today", yellow for "I'm in love", for example...
We might use it to communicate short answers: yes/no, little number...
We could also use it to communicate fully by using some king of Morse code.


The LED is documented on HackSpire and it looks quite easy:

Quote
90110000 - LED

    * 90110B00 (R/W): Control register
          o Bit 0: Set this bit to enable green light blink data. If green blink data iteration is not on, the green light state is read from bit 0 of green blink data.
          o Bit 1: Set this bit and bit 6 to enable green blink data iteration.
          o Bit 2: Set this bit to force green light off. Overrides bit 4.
          o Bit 3: Set this bit to force red light off. Overrides bits 5 and 13.
          o Bit 4: Set this bit to force green light on.
          o Bit 5: Set this bit to force red light on.
          o Bit 6: See this bit and bit 1 to enable green blink data iteration. Reset before modifying green blink data or delay.
          o Bit 9: Set this bit to enable red light blink data. If red blink data iteration is not on, the red light state is read from bit 0 of red blink data.
          o Bit 10: Set this bit and bit 12 to enable red blink data iteration.
          o Bit 12: Set this bit and bit 10 to enable red blink data iteration. Reset before modifying red blink data or delay.
          o Bit 13: Forces red light on if bit 4 is 0, or red light off if bit 4 is 1. (?)
    * 90110B04 (R/W): Green blink data. 32 bits of on and off state, represented by 1 and 0. Iteration is done from bit 31 to bit 0 repeatedly.
    * 90110B08 (R/W): Green blink delay (negative). OS sets this to -2048.
    * 90110B0C (R/W): Red blink data. 32 bits of on and off state, represented by 1 and 0. Iteration is done from bit 31 to bit 0 repeatedly.
    * 90110B10 (R/W): Red blink delay (negative). OS sets this to -2048.

Note: If red and green lights are on at the same time, the color becomes yellow.


I've made a simple program.

Code: [Select]
#include <os.h>
#include "console.h"
#include "screen.h"
#include "charmap.h"
#define LED_MODE_ADDR 0x90110B00

int getMem(int addr)
{ return *(volatile unsigned*) addr;
}

void setMem(int addr, int val)
{ *(volatile unsigned*) addr = val;
}

int main(int argc, char* argv[])
{ int mode_orig = getMem(LED_MODE_ADDR);
int mode_base = mode_orig&~0b01011001111111; //turn OFF + disable blink / iteration / force on-off
clrScr();
int mode_curr=mode_base;
int mode_last=mode_orig;
while(!isKeyPressed(KEY_NSPIRE_ESC))
{ mode_curr=mode_base;
if(isKeyPressed(KEY_NSPIRE_R) || isKeyPressed(KEY_NSPIRE_J) || isKeyPressed(KEY_NSPIRE_Y))
mode_curr |= 0b100000; // force RED on
if(isKeyPressed(KEY_NSPIRE_V) || isKeyPressed(KEY_NSPIRE_G) || isKeyPressed(KEY_NSPIRE_J) || isKeyPressed(KEY_NSPIRE_Y))
mode_curr |= 0b010000; // force GREEN on
if(mode_curr!=mode_last)
{ setMem(LED_MODE_ADDR,mode_curr);
mode_last = mode_curr;

disp("Written LED mode: ",0);
dispi(mode_curr,0);
displn("",0);

disp("Current LED mode: ",0);
dispi(getMem(LED_MODE_ADDR),0);
displn("",0);
}
}
setMem(LED_MODE_ADDR,mode_orig); // reset
return 0;
}

You need to press some keys to turn on the red or green colors.


And I'm getting very strange behaviours.

I've tested on 3 TI-Nspire ClickPad and 1 Ti-Nspire TouchPad.
On 2 of them, it worked the 1st time, but that's all... It never worked again!!! ::)
On the 2 others, it never worked.

The LED just remains off...

Strangely, I've experienced many reboots, either when entering the program, either after exiting the program...
Very strange as I don't use any other pointer than the 0x90110B00 address. And it did reboot before I added the debug display.


Here's a sample log of the debug informations displayed on the screen (when it doesn't reboot):

Quote
Written LED mode: 0 // 1st loop
Current LED mode: 5699
Written LED mode: 32 // press 'R' key
Current LED mode: 5699
Written LED mode: 0 // release 'R' key
Current LED mode: 5699

You see?
I'm checking the LED mode just after writing it.
And it's allways 5699!
My values aren't written, or are modified immediatly...

How is this possible? I thought interrupts were disabled while running a Ndless program...


The fact that it worked 2 times (with dozens of tries) this evening, proves that this address is read/write, as stated on HackSpire.

But there seems to be some kind of checking/protection, whose reliability is strong, but not 100%.


Can you help me?
Do you have any idea what is going on?
Do you see some stupid things in my code?

Thanks.


Please find attached the last binary.

If you want to modify & recompile, you just have to get "screen.*", "console.*" and "charmap.h" files in the mViewer archive, and use them with the code above.
http://ti.bank.free.fr/index.php?mod=archives&ac=voir&id=2014



1744
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 17, 2010, 08:43:22 am »
I've managed to compile zlib 1.2.5 library for the TI-Nspire, a light version customized for my needs.

I've removed everything related to compression, file reading, and file writing.
It is only intended to decompress data in buffers.

This is going to be needed for PNG support.


When compiling C code for the TI-Nspire, you have to remove all references to unsupported stdlib functions.
There were such problems in the removed files, but the included files are totally unaltered.


This is totally untested for now, but in case it can be usefull to someone, I've attached it.
Note: as you can guess, the produced binary "dummy.tns" souldn't do anything at all.

1745
News / Re: Casio fx-9860G video player
« on: December 17, 2010, 08:31:43 am »
But I'm not even sure the Prizm is going to have a SD slot...

1746
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 16, 2010, 10:18:29 pm »
Nice. By the way, can those pictures be integrated in games?

By taking my code and recompiling, yes.
As I'm "waiting" for the screen most of the time, the CPU is available if something has to be done while the image is displayed.

I don't know if it is possible without including my source and compiling: for example, I don't know if it is possible for a Ndless program to launch another Ndless program, and go on once the program has ended.

1747
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 16, 2010, 09:40:57 pm »
Here is mviewer2 beta build 2.


Clearing code (when zooming out) has been optimized in order to clear only a box (although you'll probably won't notice any speed improvement, as I have to wait for the screen...).

I've added the parsing image progress in the top right hand corner, as you've asked for.


Remaining minor bugs:
* strange zoom in some situations
* the contrast delay is causing problems when in 31 gray levels mode
* when going back to the 16 gray levels mode, display mode is not reset to RGB: you may end in BGR mode and so get a slightly darker image, until the next time you press 'C'


You may get a new release before the end of the week.


Todo list:
* develop a "safest" way of waiting for the screen
* test 31 gray levels mode, by changing the screen base pointer, instead of switching between RGB and BGR.
* test modes with more than 31 gray levels
* change internal data from 16-bits to indexed 8-bits
* include PNG support
* include JPEG support
* include GIF support
* iinclude PDF support

1748
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 15, 2010, 11:07:56 pm »
Nice, I'll have to try this eventually. :)

By the way what does RGB/BGR? I only think of red-green-blue, but the Nspire is grayscale so I am a bit confused... ???

The screen does not support colors, but the LCD controller does.
So the LCD controller takes standard colors values in RGB OR BGR format.

1749
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 15, 2010, 10:46:02 pm »
Here is my latest build of mviewer2.
It's not an alpha version any more: i've promoted it to a beta now! :)


* All graphic functions are now supporting both the standard 4-bits mode (16 grayscale), and the super 16-bits mode (31 grayscale).

* The 31 grayscale mode delay has been set to 40 (40ms very approximatively). This seems to produce the best display on both tested Nspire (a basic and a CAS ClickPad), because the screen must be done refreshing the previous "action".

* No data copy any more to refresh the screen. I'm using 2 identical buffers: onscreen and offscreen. I update the screen when needed just by setting the SCREEN_BASE_ADDR to the start of the offscreen buffer. The 2 buffers roles are switched this way: onscreen is becoming offscreen, and offscreen is becoming onscreen.

* New emergency key to immediatly turn the screen off, if you were about to be caught viewing something forbidden.

* The '"non-centered zoom" bug has been fixed. There is another minor zoom bug.


The 31 grayscale mode doesn't allways give you a better image. It depends upon the image. Images with areas including very similar adjacent grey levels are going to be wonderfull. You'll have the impression of not being able to count the grey levels in those areas any more.

In 31 grayscale mode, if you look carefully you'll guess which are the new 15 levels. Their display is not perfect. This seems to be related to the way the screen refreshes itself.


Here are the keys not mentionned in the readme from the stable link:
- 'C': switch between 16 grayscale mode and 31 grayscale mode
- 'Home' and 'Menu': increase or decrease the 31 grayscale mode delay (if you've got a "bad" display with the default delay - might be removed in the future, depending upon the tests results)
- 'Ctrl': turn the screen on/off




Future tests:
------------

The 31 grayscale mode is obtained by switching the color encoding from RGB to BGR alternatively.
The 2 different gray levels are stored in the R and B bits and then mixed on the screen, producing a new gray level.
There is another way to produce the new grey levels.
It is to have 2 screen buffers containing the different grey levels, and to change the SCREEN_BASE_ADDRESS alternatively between the starts of those buffers.
I wonder if this method would produce better/worse results...

By combining both methods, we could get (in theory) something like 48/64/... grayscale levels. I wonder how it would look like.
64 levels will be hard (propably impossible), because the total refreshing cycle would need something like 120ms. And the human eye is able to detect a 120ms delay.
With a 80ms delay, 48 levels is "limit" but might give something interesting.


Future features:
----------------
* If the tests are good (but don't be too optimistic), more grayscale levels.
* Going back to 8-bit data to spare some more memory.
* Supporting other image files: PNG/JPG/GIF.

1750
Other Calculators / Re: Nspire CAS+: how worth is it?
« on: December 15, 2010, 02:19:57 pm »
sorry guys, but wat's a CAS+ ??? here in France, we've got only regular Nspires and Nspire CAS, but no Nspire CAS+ 8|

The Nspire CAS+ prototype has been widely tested in France in 2006-2007 school year.
We've regularly mentionned it since on www.TI-Bank.fr .

And as you were told here, the CAS is far better than the CAS+.

1751
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 15, 2010, 12:11:32 am »
It's similar.

I'm flashing between 2 consecutive gray values among the 16 standard ones, in order to get 15 intermediate grey values.

I just hide the 2nde value for each pixel in the blue color bits, and then alternatively swith between RGB and BGR color modes.
So nothing is copied or calculated.

1752
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 14, 2010, 11:51:04 pm »
critor, while sending new images to my calc today to use with this, I came across one that didn't work. :(

This was made in Paint.NET.


It works on my calculator.

May be you didn't get the latest binary on TI-Bank.


Anyway, here's my latest build for those who want to test for me.


By default, the image is displayed with 16 grayscale levels.

The 'C' key (like Color or Critor) lets you hot-switch between the 16 and 31 grayscale modes while viewing an image.

The 31 grayscale mode is usefull for images with similar adjacent colors:
This one: http://www.omnimaga.org/index.php?action=dlattach;topic=5712.0;attach=5043;image
Or this one: http://www.omnimaga.org/index.php?action=dlattach;topic=5712.0;attach=4971 (just zoom in on the thumb, and press 'C')


While in  31 grayscale mode, the 'menu' and 'home' keys let you increase/decrease the RGB/BGR invertion delay. (delay is briefly shown on top of the screen)

The quality of the display in 31 grayscale mode seems to be very dependant on that delay.
Please tell me which delay gives you the best display. It might depend upon the image too...

I fear you will all give me different delays... :p

(if there wasn't that problem, I would probably have set the 31 grayscale mode as a default)

1753
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 14, 2010, 09:18:35 pm »
Yes, you're right.

1754
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 14, 2010, 07:03:59 pm »
I was wondering, in the future, would it be possible to add support for other image file types?


Yes it would be possible.
We just need the code to decompress those images data to a raw bitmap.

JPEG/PNG/GIF support should be possible.
I think PNG is the easiest format and should be supported first.
JPEG decompression is much harder...
And GIF files can have multiple layers of various dimensions, layers which can cross the canvas border.

1755
Other Calculators / Re: mViewer - Nspire BMP viewer
« on: December 14, 2010, 06:34:51 pm »
What?!?  Does that same link on TI-Bank work for the latest version?

It's just worked for the 1st time a hour ago.
This special version is not pubic for now.
It needs some more testing/debugging.
The internal buffered data was changed from a 4-bits to 16-bits.


But when I release it, the same link is going to work. And you'going to be informed first! :p

And it should even be faster. the screen refresh code is now only copying the screen content 1 time instead of 2, although it still uses buffering.


Guess what... the Nspire is wonderfull!!!
(why did we have to wait 4 years for that?... silly TI!!!)

Pages: 1 ... 115 116 [117] 118 119 ... 137