Author Topic: Ndless suggestions thread  (Read 25299 times)

0 Members and 1 Guest are viewing this topic.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Ndless suggestions thread
« on: August 13, 2011, 11:41:09 pm »
What are some things you would like to see in the next version of ndless? I'm thinking more along the lines of functions and stuff, not major changes like a permanent installation.

Here's my first one:
Code: (Functions for overclocking and returning CPU to original speed) [Select]
void set_cpu_150_mhz() {
  *(volatile unsigned*) 0x900B0000 = 0x00000002;
  *(volatile unsigned*) 0x900B000C = 4;
}
void set_cpu_90_mhz() {
  *(volatile unsigned*) 0x900B0000 = 0x00141002;
  *(volatile unsigned*) 0x900B000C = 4;
}

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Ndless suggestions thread
« Reply #1 on: August 13, 2011, 11:45:33 pm »
Original CPU speed isn't 90MHz on all OSes. It's probably possible to return the previous value from the function, though.

Edit: I guess it could go something like
Code: [Select]
#define SPEED_150MHZ 0x00000002
#define SPEED_90MHZ 0x00141002

unsigned set_cpu_speed(unsigned speed) {
  unsigned lastSpeed = *(volatile unsigned*) 0x900B0000;
  *(volatile unsigned*) 0x900B0000 = speed;
  *(volatile unsigned*) 0x900B000C = 4;
  return lastSpeed;
}

And then you'd use it like:
Code: [Select]
unsigned speedBackup = set_cpu_speed(SPEED_150MHZ);

//Code goes here

set_cpu_speed(speedBackup);
« Last Edit: August 14, 2011, 12:13:09 am by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless suggestions thread
« Reply #2 on: August 14, 2011, 11:01:45 am »
I like this thread :)

Thanks for this patch, here it is on the Ndless's SVN: http://hackspire.unsads.com/wiki/index.php/Libndls#CPU
Shouldn't CPU_SPEED_90MHZ be 0x00145002, as on OS < 2.1 according to this?
And is this one correct: #define CPU_SPEED_120MHZ 0x000A1002 ?
Ndless.me with the finest TI-Nspire programs

Offline SolusIpse

  • LV2 Member (Next: 40)
  • **
  • Posts: 35
  • Rating: +1/-0
    • View Profile
Re: Ndless suggestions thread
« Reply #3 on: August 14, 2011, 12:08:13 pm »
Quote from: hackspire
since v3.0. speed is one of CPU_SPEED_150MHZ, CPU_SPEED_120MHZ, CPU_SPEED_90MHZ. Returns the previous speed. You must restore the original speed before the program exits.

I wonder if this means Ndless 3.0 is almost ready?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ndless suggestions thread
« Reply #4 on: August 14, 2011, 12:15:44 pm »
I hope so, although I understand it might be hard to achieve with everything TI did to block it.

If it comes out soon this will make a lot of people happy for school restart, though. We are already getting a bunch of new members lately O.O

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless suggestions thread
« Reply #5 on: August 14, 2011, 12:55:19 pm »
SolusIpse: it just means they probably won't be any release before v3.0.
Ndless.me with the finest TI-Nspire programs

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Ndless suggestions thread
« Reply #6 on: August 14, 2011, 01:31:33 pm »
I just got that code from bwang's raycaster, I guess that was designed for os 1.1. I suppose we could have a single function oc_cpu(bool), where true overclocks, while saving the original speed in a static variable, and false resets the cpu to its original state.

Also, how about functions for accessing the timers (and RTC)?
« Last Edit: August 14, 2011, 01:34:15 pm by t0xic_kitt3n »

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Ndless suggestions thread
« Reply #7 on: August 14, 2011, 01:36:35 pm »
Quote
I suppose we could have a single function oc_cpu(bool), where true overclocks, while saving the original speed in a static variable, and false resets the cpu to its original state.
Well, there's more than one overclocking clock frequency, so "bool" wouldn't do :)

Quote
Also, how about functions for accessing the timers?
Yeah, it's a good idea to expand the HAL of Ndless.
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 suggestions thread
« Reply #8 on: August 14, 2011, 01:38:33 pm »
t0xic_kitt3n: are you able to try the set_cpu_speed() function on Ndless's Subversion repository?

I will gladly integate any contribution provided as source code patches, but I unfortunately can't invest time on enhancing libndls myself.
Ndless.me with the finest TI-Nspire programs

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Ndless suggestions thread
« Reply #9 on: August 14, 2011, 01:41:58 pm »
Quote
I suppose we could have a single function oc_cpu(bool), where true overclocks, while saving the original speed in a static variable, and false resets the cpu to its original state.
Well, there's more than one overclocking clock frequency, so "bool" wouldn't do :)
But I don't really see a need for a program to switch between more that two frequencies - 150mhz for maximum performance, and the default speed for otherwise.

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
Re: Ndless suggestions thread
« Reply #10 on: August 15, 2011, 10:29:04 pm »
I would like nspire CX OS 3.0.2 support
This used to contain a signature.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Ndless suggestions thread
« Reply #11 on: August 15, 2011, 10:31:53 pm »
That is already being worked on, this thread is more for functions to go in libndls.
Also we could add this random number function.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Ndless suggestions thread
« Reply #12 on: February 10, 2012, 09:32:28 am »
Hey ExtendeD, what about being able to open the Scratchpad while in a game/program? I'd love that :)

Also, would it be possible to speed up the game like in some computer emulators?

Thanks.

Offline ExtendeD

  • Project Author
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless suggestions thread
« Reply #13 on: February 10, 2012, 01:42:38 pm »
Hey ExtendeD, what about being able to open the Scratchpad while in a game/program? I'd love that :)

Integrating Ndless with the OS tasks management would be rather difficult.
But being able to suspend the current program execution and restore it would be possible. Maybe I could expose an API for this?

Also, would it be possible to speed up the game like in some computer emulators?

Programs must implement CPU speed tuning themselves for this, or you can use Nover.
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 suggestions thread
« Reply #14 on: February 14, 2012, 12:37:06 pm »
But being able to suspend the current program execution and restore it would be possible. Maybe I could expose an API for this?

That would be great, I'd love it.