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 - compu

Pages: 1 ... 7 8 [9] 10 11 ... 19
121
TI-Nspire / Re: OSLauncher 3.1
« on: March 13, 2012, 01:35:53 pm »
Moreover, it is a matter of days before Ndless is blocked so I really don't get the point of releasing it now ???
Well, I won't update to OS 3.2 untill there will (maybe) be a new ndless version; The use of Ndless is much higher than the use of Lua and I don't want to be limited by TI.

122
TI-Nspire / Re: OSLauncher 3.1
« on: March 10, 2012, 03:31:34 pm »
Yes, I know about that - but I have no idea why, it must have something to do with interrupts I think.

123
TI-Nspire / Re: OSLauncher 3.1
« on: March 10, 2012, 12:48:50 pm »
Well, I should have done some more testing... ::)

Here is a completely untested CX version that I quickly made :)

124
TI-Nspire / Re: OSLauncher 3.1
« on: March 09, 2012, 01:46:03 am »
I was actually surprised to see it was getting ported since we were trying to keep good relations with TI, but I guess that considering what they are doing, I don't see why we should really care that much. Plus it's nice if we can run multiple OS versions at once on one calc.
Exactly. TI won't change their position so I don't see a reason why it shouldn't be updated. And TI announced that they will block Ndless before this version of OSLauncher was released.

But in its current state, it's unlikely to be able to run the CAS OS on the non-CAS CX model, because this doesn't work anymore (for now) for the Clickpad & Touchpad series.
Yes, for now, but I still have hope to get it to work :P

125
TI-Nspire / OSLauncher 3.1
« on: March 08, 2012, 12:00:33 pm »
OSLauncher is deprecated; Use nLaunch or nLaunch CX instead.

I decided to port OSLauncher to OS 3.1 some weeks ago, because it would only require one line of code change. However, memory allocation failed because a decompressed OS 3.1 doesn't fit into RAM.
ATM OSLauncher decompresses directly from a file to allocated memory, and then copies the decompressed OS to the OS base address (0x10000000). This requires a lot of memory (around 11MB for OS 3.1 CAS).
So I decided to change the way OSLauncher decompresses the OS; It loads the compressed OS into RAM and directly overwrites the old OS at 0x1000000. Using this method requires a port of zlib because syscalls won't be available with disabled interrupts.

Basically my code works, I can launch DummyOS and it works fine, but OS 3.1 CAS reboots. I have calculated some checksums to see if there are any errors at decompressing, but the decompressed OS is okay.


BTW, CX compatibility isn't far away, but DummyOS won't compile anymore which I would need for testing purposes.
Spoiler For Error:
$ make clean all
rm -f *.o *.elf
rm -f ./phoenix.raw.tns
nspire-gcc -Os -g3 -Wall -W -Wwrite-strings -marm -c dummyos.c
nspire-ld --no-startup -T ldscript dummyos.o -o phoenix.raw.elf
z:/Nspire/ndless/bin/../system/osstub.o: In function `exit.clone.0':
osstub.c:(.text+0x28): undefined reference to `__crt0_savedsp'
osstub.c:(.text+0x2c): undefined reference to `__crt0exit'
collect2: ld returned 1 exit status
make: *** [phoenix.raw.tns] Error 1
I think it stopped working after updating SVN.

If anyone is interested in helping me, here is my code (+ executable).

126
Lua / Re: Controlling external hardware through Lua
« on: February 19, 2012, 10:37:21 am »
No, they use different registers.

127
Calculator C / Re: nRaze progresss
« on: February 17, 2012, 04:52:59 pm »
And how do you want to convert Actionscript to C?
1. Not possible (you said something about Alchemy somewhere, but Alchemy compiles C into Actionscript)
2. If it would be possible, a lot of porting work would be required to make it run on the Nspire.

Have you ever programmed in C?
You have many huge project ideas, but I haven't seen anything programmed by you yet.

128
Computer Usage and Setup Help / Re: lol $29.99 Intel Core i7 computer?
« on: February 04, 2012, 07:09:47 am »
I would definitely try buying one if they would ship to Germany... :(

130
News / Re: OSLauncher, LUA to TNS converter and TI document player
« on: January 24, 2012, 11:31:10 am »
Would it be possible to...

allocate memory for zipped file -> copy zipped file into RAM -> disable interrupts -> unzip to 0x10000000 -> launch OS?

(I managed to integrate the required parts of zlib into OSLauncher and tried the unmodified source with DummyOS)

131
Calculator C / Find syscalls
« on: January 23, 2012, 03:30:17 pm »
I would really like to know, how do you find syscalls in the Nspire OS/boot2?
I have seen long lists of functions with addresses and names, but how do you get them?

132
News / Re: OSLauncher, LUA to TNS converter and TI document player
« on: January 23, 2012, 03:06:35 pm »
Unfortunately, my OS is already TNOC'd and I use only ~250KB for other files. That sucks D:

133
News / Re: OSLauncher, LUA to TNS converter and TI document player
« on: January 23, 2012, 02:33:12 pm »
I have ported it to OS 3.1, but it says that it can't allocate memory (I try to launch 3.1 CAS), but it worked with 2.0.1 CAS. So.... is OS 3.1 just to big (5.3MB)? :(

134
OSLauncher does not permanently install the CAS OS, it merely hot-launches it (and often fails to, for some reason nobody has bothered to investigate). The Press To Test (PTT) mode triggers a reboot and therefore undoes the effect of OSLauncher anyway, so you wouldn't have to do anything yourself, for your calculator to be usable in standardized tests :)

I have done some tests with OSLauncher and I found out that it freezes when you touch the touchpad while launching or start OSLauncher with the touchpad-click instead of enter.
When an OS is launched with the enter-key, I have never experienced any problems. Maybe this helps you to find the bug ???

135
Computer Projects and Ideas / Re: Spyrodecimal - esolang
« on: January 12, 2012, 02:22:47 pm »
Here is my try at a small interpreted language :)

It has one variable for operations (like your memory, I call it register), 256 labels and 2048 bytes of memory where you can read and write from.

Spoiler For Commands:
d      Enable/disable debug mode
n      Print new line
i      Get char from keyboard
p      Print char
I      Get number from keyboard
P      Print number
k        Immediately get char from keyboard (doesn't wait for enter) without local echo
t      Generate random number
lX      Create label X
jX      Jump to label X
sX      Store register to X, where X must be one printable character, e.g. 12 wouldn't work. This means, you can't access all 2048 bytes through this command, you will have to use SX and RX
rX      Restore X to register
SX      Store register to the address stored in X (like a pointer)
RX      Restore value at the address stored in X to register
1      Increment register
2      Decrement register
+X      register = register + value at X
-X      register = register - value at X
*X      register = register * value at X
/X      register = register / value at X
x      Clear register
=X      Store X (=88) in register
?XY      If-Clause
      X --> =      register == Y
      X --> !      register != Y
      X --> >      register >  Y
      X --> <      register <  Y
;      Ends If-Clause (and btw, at the moment nested Ifs don't work at all)

Code:
Code: [Select]
#include <iostream>
#include <conio.h>
#include <string.h>
#include <string>
#include <windows.h>
#include <time.h>

using namespace std;

int main(void)
{
int memory[2048];
int label[256];
int reg;
int deep;
bool ignore = false;
bool debug = false;
char tmp;
srand((unsigned)time(NULL));
while(true)
{
string program;
cout << endl << ">>>";
cin >> program;
memset(memory,0,2048*sizeof(int));
memset(label,0,256*sizeof(int));
reg = 0;
deep = 0;
for (int i=0; i < program.length(); i++)
{
if(program[i] == 'l')
{
label[program[i+1]] = i+1;
if(debug) cout << "Label " << program[i+1] << " at " << i+1 << endl;
}
}
for (int i=0; i < program.length(); i++)
{
if(ignore && program[i] != ';') continue;
else ignore = false;
if(debug) cout << "op=" << program[i] << ", pos=" << i << ", reg=" << reg << " (" << (char)reg << ")" << endl;
switch(program[i])
{
case 'd':
debug = !debug;
if(debug) cout << "\tdebug=" << debug << endl;
break;
case 'n':
cout << endl;
break;
case 'i':
if(debug) cout << "\tinput ";
cin >> tmp;
reg = tmp;
break;
case 'p':
if(debug) cout << "\tprint " << (char)reg << endl;
else cout << (char)reg;
break;
case 'I':
if(debug) cout << "\tinput ";
cin >> reg;
break;
case 'P':
if(debug) cout << "\tprint " << reg << endl;
else cout << reg;
break;
case 'k':
reg = getch();
break;
case 't':
reg = rand();
if(debug) cout << "\trand=" << (int)reg << endl;
break;
case 'j':
if(debug) cout << "\tlabel=" << program[i+1] << ", pos=" << label[program[i+1]] << endl;
i = label[program[i+1]];
break;
case 's':
memory[program[i+1]] = reg;
i++;
if(debug) cout << "\tmemory(" << program[i] << ")=" << reg << endl;
break;
case 'r':
reg = memory[program[i+1]];
i++;
if(debug) cout << "\tmemory(" << program[i] << ")=" << reg << endl;
break;
case 'S':
memory[memory[program[i+1]]] = reg;
i++;
break;
case 'R':
//cout << program[i+1] << "," << memory[program[i+1]] << "," << memory[memory[program[i+1]]] << endl;
reg = memory[memory[program[i+1]]];
i++;
break;
case '1':
reg++;
break;
case '2':
reg--;
break;
case '+':
if(debug) cout << "\treg=" << reg << ", memory(" << program[i+1] << ")=" << memory[program[i+1]] << ", add=" << reg + memory[program[i+1]] << endl;
reg = reg + memory[program[i+1]];
i++;
break;
case '-':
if(debug) cout << "\treg=" << reg << ", memory(" << program[i+1] << ")=" << memory[program[i+1]] << ", subtract=" << reg - memory[program[i+1]] << endl;
reg = reg - memory[program[i+1]];
i++;
break;
case '/':
if(debug) cout << "\treg=" << reg << ", memory(" << program[i+1] << ")=" << memory[program[i+1]] << ", divide=" << reg / memory[program[i+1]] << endl;
reg = reg / memory[program[i+1]];
i++;
break;
case '*':
if(debug) cout << "\treg=" << reg << ", memory(" << program[i+1] << ")=" << memory[program[i+1]] << ", multiply=" << reg * memory[program[i+1]] << endl;
reg = reg * memory[program[i+1]];
i++;
break;
case 'x':
reg = 0;
break;
case '=':
reg = program[i+1];
i++;
break;
case '?':
if(program[i+1] == '=')
{
if(reg == memory[program[i+2]]) ignore = false;
else ignore = true;
}
else if(program[i+1] == '!')
{
if(reg != memory[program[i+2]]) ignore = false;
else ignore = true;
}
else if(program[i+1] == '>')
{
if(reg > memory[program[i+2]]) ignore = false;
else ignore = true;
}
else if(program[i+1] == '<')
{
if(reg < memory[program[i+2]]) ignore = false;
else ignore = true;
}
if(debug) cout << "\tif reg " << program[i+1] << " memory(" << program[i+2] << ") --> " << ignore << endl;
i += 2;
break;
default:
break;
}
}
}
}

A simple and documented Guess the number:
Spoiler For Code:
t                            // Create random number
sa                            // Save it in a
lA                            // Label A
   rc                         // Get c (number of guesses)
   1                         // Increment c
   sc                         // Store c
   =Np=up=mp=bp=ep=rp=?p          // Print "Number?"
   I                         // Input number
   sb                         // Store it in b
   ?>a                      // register > a?
      =Sp=mp=ap=lpp=ep=rpn       // Print "Smaller"
      rb                      // Restore b
      jA                      // Repeat
   ;                         // If-End
   ?<a                      // register < a?
      =Bp=ip=gpp=ep=rpn          // Print "Bigger"
      rb                      // Restore b
      jA                      // Repeat
   ;                         // If-End
   ?=a                      // register == a?
      =Cp=op=rpp=ep=cp=tp=!p       // Print "Correct!"
      n                      // new line
      =Tp=rp=ip=ep=sp=:p          // Print "Tries:"
      rc                      // Get c (number of guesses)
      P                      // Print number of guesses
   ;                         // If-End


Resulting program:
tsalArc1sc=Np=up=mp=bp=ep=rp=?pIsb?>a=Sp=mp=ap=lpp=ep=rpnrbjA;?<a=Bp=ip=gpp=ep=rpnrbjA;?=a=Cp=op=rpp=ep=cp=tp=!pn=Tp=rp=ip=ep=sp=:prcP;

And a brainfuck interpreter ;D (won't work with nested loops)
Spoiler For Code:
=d // 100
sA // A = instruction pointer, points to 100

=! // 33
sB
*B // 33 * 33 = 1089
sB // memory pointer, points to 1089

=A // 65
sC
=N // 78
-C // 78 - 65 = 13, CR
sC // C holds CR

lA // Program read loop
k // Read char
p // Local echo
?!C // Char = CR?
   SA // Store in instruction pointer target
   rA
   1 // Increment insctruction pointer
   sA
   jA // loop end
; // End of program read loop

n

=d
sA // Reset instruction pointer
lB // Main loop start

=> // Brainfuck: Increments Pointer.
sE // Opcode buffer
RA // Get instruction
?=E
   rB
   1
   sB
;

=< // Brainfuck: Decrements Pointer.
sE
RA
?=E
   rB
   2
   sB
;

=+ // Brainfuck: Increments Pointer Target.
sE
RA
?=E
   RB
   1
   SB
;

=- // Brainfuck: Decrements Pointer Target.
sE
RA
?=E
   RB
   2
   SB
;

=. // Brainfuck: Prints Pointer Target.
sE
RA
?=E
   RB
   p
;

=, // Brainfuck: Reads char.
sE
RA
?=E
   k
   p // Local echo
   SB
;

=[ // Brainfuck: Jumps after "]" if pointer target is 0
sE
RA
?=E
   RB // Get pointer target
   ?=D // = 0?
      lC // Increment instruction pointer until ] appears
      =] // Load ]
      sa
      rA
      1
      sA
      RA
      ?!a
         jC
      ;
   ;
;

=] // Brainfuck: Jumps back to "[" if pointer target nonzero
sE
RA
?=E
   RB
   ?!D // != 0?
      lD // Decrement instruction pointer until [ appears
      =[
      sa
      rA
      2
      sA
      RA
      ?!a
         jD
      ;
   ;
;

rA
1 // Increment instruction pointer
sA
RA
?!D // D should be 0
   jB
;


Resulting program:
=dsA=!sB*BsB=AsC=N-CsClAkp?!CSArA1sAjA;n=dsAlB=>sERA?=ErB1sB;=<sERA?=ErB2sB;=+sERA?=ERB1SB;=-sERA?=ERB2SB;=.sERA?=ERBp;=,sERA?=EkpSB;=[sERA?=ERB?=DlC=]sarA1sARA?!ajC;;;=]sERA?=ERB?!DlD=[sarA2sARA?!ajD;;;rA1sARA?!DjB;

Brainfuck "Hello World":
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-]<.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>-]<+.[-]++++++++++.

Pages: 1 ... 7 8 [9] 10 11 ... 19