Author Topic: nSDL 1.1.1 Anniversary Edition—The Ultimate TI-Nspire Graphics Library  (Read 140589 times)

0 Members and 1 Guest are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: SDL for the TI-Nspire
« Reply #75 on: March 04, 2012, 07:22:11 pm »
Yeah, and gpsp uses SDL so this would be a good first step to porting it :)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #76 on: March 05, 2012, 05:48:17 pm »
Alrighty now SDL_GetTicks() should work on the non-CX models (thanks calc84maniac), and once I get the same done for CX's, it'll be as far as I'll go as far as timers are concerned (that makes a lot of as'). Implementing SDL_AddTimer() and whatnot requires some sort of threads or pseudo-threads, plus they're rarely used. Also the event system does actually work as it should, it was just me who used SDL_PollEvent() wrong.

So basically the things that still need to be written/fixed are the timer things for CX (should be pretty straightforward once I have the courage to read the CX timer documentation), BMP blitting and some issues with non-CX surfaces. If everything goes well those two last things are the real problems I still need to tackle. BMP blitting might not work because of some other thing that does not work as it should (something I have not yet noticed), and the issues on non-CX models seem to be caused by surfaces created with SDL_CreateRGBSurface() (in fact it fails if I try to blit a surface created with that function). Also ExtendeD might soon update Ncubate which should be great; GDB would speed up the debugging process quite a bit. :)
« Last Edit: March 05, 2012, 06:08:39 pm by hoffa »

Offline njaddison

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 176
  • Rating: +24/-27
    • View Profile
Re: SDL for the TI-Nspire
« Reply #77 on: March 05, 2012, 06:11:28 pm »
Hoffa, how did you get the boot 1 for the cx? I don't have a cx, but I've been wanting to use one with nspire_emu. I just have a regular nspire, but it would be nice to have an nspire cx on the nspire_emu.

BTW, does is gpsp a gameboy advance emulator for the sony psp? Because if it is, how would someone port it to the nspire? There is no way to convert the psp EBOOT.PBP file to a .tns file. And besides, even if it did, it probably wouldn't work because gpsp is an unsigned app for the psp, and can only run on custom firmware.
« Last Edit: March 05, 2012, 06:15:45 pm by njaddison »
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/5f42ec78e054645d.png" alt="NerdTests.com says I'm a Highly Dorky Nerd God.  Click here to take the Nerd Test, get geeky images and jokes, and talk to others on the nerd forum!">
</a>


Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: SDL for the TI-Nspire
« Reply #78 on: March 05, 2012, 06:20:05 pm »
There's a version of GPSP for the GP2X, which is the most likely thing to port from.

Also Hoffa, how are you handling the fact that the timer is 16-bit? I think the SDL_GetTicks() is supposed to return a 32-bit value.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Mighty Moose

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 141
  • Rating: +4/-0
    • View Profile
Re: SDL for the TI-Nspire
« Reply #79 on: March 05, 2012, 06:30:20 pm »
On a similar note, there's one for the iPod video (which uses an arm(7?) processor) called iGPSP, but the GP2X version may be more portable  (Plus, iirc, iGPSP has a number of issues and it's not updated very often :().

Just thought I'd throw that out there.
« Last Edit: March 05, 2012, 06:33:54 pm by Mighty Moose »
Cheers!
I beta test, so...yeah.  PM me if you want me to test anything :D.

Almost only counts in horseshoes and handgrenades.

Cogito ergo sum.

Calcs:
TI-84+, OS 2.43, Boot Code 1.02, 128k RAM
TI-84+SE VSC, OS 2.43, Boot Code 1.00, 128k RAM  (I'm spoiled :P)
TI-81, OS 1.6K (only borrowed)
Casio fx-CG10 (Prizm), OS 01.04.0200
TI-Nspire Clickpad, OS 1.4
TI-Nspire Clickpad, OS 3.1.0.392
TI-Nspire CAS Clickpad, OS 1.6.10110 (!?) now OS 3.1.0.392

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #80 on: March 05, 2012, 06:34:21 pm »
Hoffa, how did you get the boot 1 for the cx? I don't have a cx, but I've been wanting to use one with nspire_emu. I just have a regular nspire, but it would be nice to have an nspire cx on the nspire_emu.
I got it off someone else. Drop me a PM and I'll send it to you tomorrow.

Also Hoffa, how are you handling the fact that the timer is 16-bit? I think the SDL_GetTicks() is supposed to return a 32-bit value.
Well currently I just convert the timer value to milliseconds and return it. I should indeed return the number of milliseconds since SDL was initialized, and simulating a 32-bit timer is rather painstaking with a 16-bit timer unless I somehow periodically check for overlaps and add that to the overall value. I might do it sometime later, but currently it would unnecessarily complexify the code, it would be too much hassle for something that isn't that big of an issue. Currently the timer precision is only at 10 Hz (i.e. 0.1s precision), but that gives ~1.8 hours without a timer reset. I doubt anyone uses the same program on a calculator that long anyway, so I guess I'll increase the timer to 20 Hz (or more) tomorrow.
« Last Edit: March 05, 2012, 06:37:10 pm by hoffa »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: SDL for the TI-Nspire
« Reply #81 on: March 05, 2012, 06:36:59 pm »
Maybe have it run at 1024Hz and whenever SDL_GetTicks() is called, have it add the current counter value to a saved 32-bit ticks value and then reset the counter. This would only act strange if the program goes 64 seconds without ever calling SDL_GetTicks(), and that's not very likely.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #82 on: March 05, 2012, 06:41:06 pm »
Hmm, yeah, it's usually used to measure intervals so it might be a good idea to do that. I'll maybe lower it a bit just to be safe (as in 512 Hz? It would give a precision of ~0.002s and double the better-get-the-tick-value-or-else time).
« Last Edit: March 05, 2012, 06:48:21 pm by hoffa »

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: SDL for the TI-Nspire
« Reply #83 on: March 05, 2012, 06:50:51 pm »
I'M liking the progress on this so far Hoffa. Glad development is continuing even if TI constantly blocks Ndless since 2010.

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: SDL for the TI-Nspire
« Reply #84 on: March 06, 2012, 07:49:04 am »
Hoffa, how did you get the boot 1 for the cx? I don't have a cx, but I've been wanting to use one with nspire_emu. I just have a regular nspire, but it would be nice to have an nspire cx on the nspire_emu.
I got it off someone else. Drop me a PM and I'll send it to you tomorrow.

Thought it was kinda illegal to distribute roms.
But anyway, it can be done with a real CX using polydumper available on tiplanet.org
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #85 on: March 06, 2012, 10:32:32 am »
I dealt with the 16-bit/32-bit timer issue on the non-CX models by using the RTC on the calculator and add a multiple of 2^16 to the tick count variable if necessary. That way it works like a 32-bit timer, and SDL_GetTicks() works as it really should. Plus, it's set to 1024 Hz as calc84maniac suggested, which gives quite a lot of accuracy (accuracy as in ticks/s; I'm using the approximation that 1 kHz ~= 1.024 kHz though, so there's a tiny percentage of error on very long runs).

Thought it was kinda illegal to distribute roms.
But anyway, it can be done with a real CX using polydumper available on tiplanet.org
It is, and many things in life are. But in all honesty, for such trivial matters I don't really care. Although I don't want to break the forum rules, hence I'm dealing with that in private.
« Last Edit: March 06, 2012, 10:33:35 am by hoffa »

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #86 on: March 10, 2012, 03:07:29 pm »
After a long time, I finally have some results on the CX when it comes to blitting BMP images. The debugging has been very laborious without proper tools, but it seems to work now. I still need to go through the code as it currently uses a slow blitter, and there's some optimized version available, but I'm skipping the part that chooses the blitter as it's what's causing problems.
Enjoy: (and notice the silly debugging messages)



When I get the checking to work, I need to look at the non-CX model which has similar issues with blitting.
« Last Edit: March 10, 2012, 03:20:02 pm by hoffa »

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: SDL for the TI-Nspire
« Reply #87 on: March 10, 2012, 03:36:52 pm »
Hey, great :)

I created a news yesterday evening at http://tiplanet.org/forum/viewtopic.php?f=43&t=8888 :)
« Last Edit: March 11, 2012, 01:35:10 am by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: SDL for the TI-Nspire
« Reply #88 on: March 10, 2012, 05:13:09 pm »
Well, that's pretty awesome :D

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #89 on: March 11, 2012, 09:01:02 am »
Some more great news, not sure if this even requires an explanation: