Author Topic: Program Resets nSpire CAS  (Read 6016 times)

0 Members and 1 Guest are viewing this topic.

Offline yoshi13

  • LV2 Member (Next: 40)
  • **
  • Posts: 36
  • Rating: +0/-0
    • View Profile
Program Resets nSpire CAS
« on: May 15, 2010, 01:52:11 am »
Hey, after finally getting the demo to compile I wrote up a Paint program for the nSpire.
However after selecting it from the menu it causes the calculator to reset automatically.

Has anyone else had this happen??

Also can the nSpire handle a 2d array of 320*240?? or is that what is causing the problem?

P.S. Can you record the nSpire's screen to make into a gif??
« Last Edit: May 15, 2010, 01:53:42 am by yoshi13 »
What happens when no one is listening on #omnimaga:
http://netham45.org/irc/EfNet/view.php?log=omnimaga.20100513

Never use /beep 9999 1000 on irc..

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Program Resets nSpire CAS
« Reply #1 on: May 15, 2010, 02:47:18 am »
No. The Nspire cannot handle a 320 x 240 array if it is declared as int array[320][240]. Writing anything to it will crash the calculator. You will need to use malloc().
Are you using the array as a screen buffer? I have a modified utils.c and utils.h in the Ncaster package that supports writing to a separate buffer.
You can record the screen using the standard screen capture tools.

Offline yoshi13

  • LV2 Member (Next: 40)
  • **
  • Posts: 36
  • Rating: +0/-0
    • View Profile
Re: Program Resets nSpire CAS
« Reply #2 on: May 15, 2010, 03:11:43 am »
Do I use malloc() by
Code: [Select]
int location[320][240]; malloc(sizeof(location * 320 * 240)); or by something like
Code: [Select]
malloc(location[320][240]

This is my second day using C and I haven't used C++ in a while so I am a bit fuzzy on everything.

I am using the array to store the color of the the pixel while the cursor is set at that location so I can restore it after the cursor is moved to the next pixel.

P.S. Do you have the addresses of the other keys, especially The clickpad and the clickpad button, I have no idea where to start when looking for key addresses

I was just reading up on some stuff... am i supposed to use something like this for every variable I declare
Code: [Select]
int i malloc(sizeof(i)); int location[320][240] malloc(sizeof(location*320*240)); [/color]

P.S. I know it would use less memory if I just checked the location of the pixel saved it to an int then moved across and changed back the last visited pixel to the right color, however I was later going to use the 240*320 array to save the drawing .
« Last Edit: May 15, 2010, 03:23:07 am by yoshi13 »
What happens when no one is listening on #omnimaga:
http://netham45.org/irc/EfNet/view.php?log=omnimaga.20100513

Never use /beep 9999 1000 on irc..

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Program Resets nSpire CAS
« Reply #3 on: May 15, 2010, 03:51:21 am »
Look at the Ncaster source for a modified version of the non-CAS os.h (in headers) which contains some keycodes. You can add to it by looking at this page: http://hackspire.unsads.com/wiki/index.php/Memory-mapped_I/O_ports#900E0000_-_Keypad
You allocate the buffer using something along the lines of
Code: [Select]
char* scrbuf = (char*) malloc(SCREEN_BYTES_SIZE);
Then you can use getPixelBuf() and setPixelBuf() (in the Ncaster utils.h and utils.c files) to read and write pixels to this buffer.

Offline yoshi13

  • LV2 Member (Next: 40)
  • **
  • Posts: 36
  • Rating: +0/-0
    • View Profile
Re: Program Resets nSpire CAS
« Reply #4 on: May 16, 2010, 01:33:56 am »
I am finally getting somewhere with the program after getting Windows to compile programs (saving about 10 minutes a test). But how do you capture the screen? when I go into programs and click capture the computer just says Processing Request for ages.
What happens when no one is listening on #omnimaga:
http://netham45.org/irc/EfNet/view.php?log=omnimaga.20100513

Never use /beep 9999 1000 on irc..

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: Program Resets nSpire CAS
« Reply #5 on: May 16, 2010, 01:38:35 am »
I am not sure if it is possible, actually, I never really checked, though x.x, since when I use my Nspire I always use a digital video camera

Otherwise, there's Goplat's TI-Nspire emulator on United-TI (and in our downloads section)

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Program Resets nSpire CAS
« Reply #6 on: May 16, 2010, 09:56:24 pm »
You can't do screen capture from the calculator. Use the emulator.

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: Program Resets nSpire CAS
« Reply #7 on: May 16, 2010, 10:12:06 pm »
That sucks, another downgrade from the older calcs TI made x.x

Oh well an emulator or digital cam can solve this I guess

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Program Resets nSpire CAS
« Reply #8 on: July 06, 2010, 01:34:04 am »
For completeness: the Nspire link protocol supports screenshots, but we don't yet know how to use it from ASM programs.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.