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

0 Members and 1 Guest are viewing this topic.

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
0.3.0, with a few changes:

  • Full compatibility on all TI-Nspire calculators without recompiling, i.e., only one library file, one compile for all calculators
  • SDL errors are shown through a text box
  • Resolutions smaller than 320x240 are supported
  • Odd coordinates now are correctly handled on TC models
  • Fixed mouse leaving trail on some occasions
  • Fixed sprites getting messed up with odd-width array-based images
  • SDL_nCreatePalette() now creates a color palette on both TC & CX 8 bpp mode
  • Again, a lot of cleaning up and rewriting

Here's the Zelda example running in 100x100:


This version should be quite useful for porting SDL programs.

Download here.
« Last Edit: May 12, 2012, 03:31:43 am by hoffa »

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #196 on: May 11, 2012, 01:56:06 pm »
This looks great :D
I hope a lot of people will code games for Nspires with this :)

Btw, if it is now v0.3.0, you might want to change the title of the first post Nevermind :P
« Last Edit: May 11, 2012, 01:56:49 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #197 on: May 11, 2012, 03:20:06 pm »
Very nice :D

Also, since it's a "universal binary", what the size difference with the version before ? Probably not much ? (which means it's easier anyway for the programmer/user)
« Last Edit: May 11, 2012, 03:21:14 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #198 on: May 11, 2012, 04:15:30 pm »
hmm....

BASIC commands that use this....mmmmm :)

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #199 on: May 12, 2012, 08:00:45 am »
Very nice :D

Also, since it's a "universal binary", what the size difference with the version before ? Probably not much ? (which means it's easier anyway for the programmer/user)
There's practically no difference.

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #200 on: May 13, 2012, 07:41:14 am »
I've been doing some porting lately to see how it works.

First of all I ported a small CHIP-8/SCHIP emulator:



(Joust up in this mothafaqa)

But because of the way the CHIP-8 system works, it flickers (no buffers) and requires fine configuring (how many opcodes before drawing etc.), can't bother to play around with it to get everything to run smoothly.

Then I tried a space shooter I found on the web, and seems to work well except there's no fscanf on the TI-Nspire, and as such I cannot load the mission files, which means I only see this: (I can move around and shoot and everything)

(That's a screenshot from the two player mode)

Haven't had any major issues or troubles porting the programs currently.
« Last Edit: May 13, 2012, 07:54:36 am by hoffa »

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #201 on: May 13, 2012, 08:10:30 am »
Nice!

GCC has __builtin_fscanf() as far as I know.

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #202 on: May 13, 2012, 08:23:22 am »
Please correct me if I'm wrong:

We can easily port only:
- games whose source code is available
- games which relies on the SDL library
- games which doesn't use assembly (between an MS-DOS and a Linux version of the same game, we should choose to work on the Linux version)
- games written in C (no C++)


Meaning that until we've got a C++ toolchain for Ndless, most of the greatest SDL games/emulators can't be ported?...
« Last Edit: May 13, 2012, 08:24:01 am by critor »
TI-Planet co-admin.

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #203 on: May 13, 2012, 08:43:51 am »
We can easily port only:
- games whose source code is available
- games which relies on the SDL library
- games which doesn't use assembly (between an MS-DOS and a Linux version of the same game, we should choose to work on the Linux version)
- games written in C (no C++)
Also resolution should be taken into account, as nSDL handles resolution <= 320x240. Oh and global variables can be a source of frustration on bigger programs as there's no stable loader currently. Thankfully GP32/GP2X and some other machines have many games, use SDL, have a 320x240 resolution and many (most?) of the games are written in C. Oh and of course all the DOS clones/ports in SDL (C-Dogs, OpenTyrian and whatnot) and generic flexible SDL games.

EDIT:

I hardcoded (using a simple script) the map data in the program and compiled it. Magic happened:

I've attached the game here in my post. I'd appreciate it if someone with a CX could try it (just dump the whole folder in the Examples folder on the TI-Nspire) and tell me how it runs. Even better would be to upload a video about it. If you have a Touchpad/Clickpad you can try it too, but the games' colors are quite dark; I couldn't see much (that made me think of a function that inverts the palette...hmm).

The controls are CTRL, tab, arrow keys (player 1) and 8/2/4/6, enter (player 2). Yes there's 2 player mode also.
« Last Edit: May 13, 2012, 09:12:13 am by hoffa »

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #204 on: May 13, 2012, 01:46:27 pm »
Awesome ! :D

I just tried it on my CX-CAS and took a video of my lame playing-while-recording skills :P

:


(Anyway, this was filmed under bad (camera, lightning etc) conditions, so if anyone wants to do a better recording, please do so :D)
« Last Edit: May 13, 2012, 02:29:20 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #205 on: May 13, 2012, 02:23:35 pm »
Please correct me if I'm wrong:

We can easily port only:
- games whose source code is available
- games which relies on the SDL library
- games which doesn't use assembly (between an MS-DOS and a Linux version of the same game, we should choose to work on the Linux version)
- games written in C (no C++)

Meaning that until we've got a C++ toolchain for Ndless, most of the greatest SDL games/emulators can't be ported?...
To address some points:

- Yup, but that goes without saying. There is no way we can do any binary translation; otherwise, iOS apps could then be ported to Android. (OK, bad example, but you know what I mean)
- Yeah, pretty much. But SDL will still let people create new games too :)
- Somewhat - assembly can be ported too. SDL emulators in particular can use this. More or less, C -> ASM for any emulator work because C would be (somewhat) slow.
- There's a bFLT loader that is supposedly done, which supports C++ programming. (See here.) I do not know of its status, and whether or not it has merged with the official ndless tree, or if it's stable or not. (I think the author, tangrs, is busy with his finals, so... ExtendeD and tangrs can clarify its status.)

There's one little thing that I'd like to see implemented before it gets off: replacing library IDs with Java-style names. (For instance, "com.alberthrocks.myawesomelibrary") There's a max of 256 libraries that can be had, which in the future may not be enough. (I've indicated that idea here.) Unfortunately I don't have enough experience to try this, so... :P
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #206 on: May 13, 2012, 02:29:17 pm »
Quote
I do not know of its status, and whether or not it has merged with the official ndless tree
It has not yet.

Quote
There's one little thing that I'd like to see implemented before it gets off: replacing library IDs with Java-style names.
If it cannot be done with standard bFLT (and I'm not aware it can be done), it's unlikely to be something we want to do: hacked up formats require non-standard toolchains, which are a maintenance burden in the long term ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #207 on: May 13, 2012, 03:10:04 pm »
Quote
I do not know of its status, and whether or not it has merged with the official ndless tree
It has not yet.
Ahh... if only I had time to work on this :/ (I have college-like finals, aka CollegeBoard AP tests this week.)

If it cannot be done with standard bFLT (and I'm not aware it can be done), it's unlikely to be something we want to do: hacked up formats require non-standard toolchains, which are a maintenance burden in the long term ;)
True :) Well... I guess we could reserve a few numbers for ndless' core and particular important libraries, and then use some kind of ID manager for the rest. I just hope implementing all of this won't get too messy...
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

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: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #208 on: May 14, 2012, 07:04:54 pm »
That is great. I love the progress on this. Hopefully converting SDL games won't be too hard in the future. :)

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 0.3.0—A fast & robust TI-Nspire graphics library
« Reply #209 on: May 15, 2012, 01:11:47 pm »
As the porting went rather well, I'm now working on an improved public version (named Dodgin' Diamond 2X) of the aforementioned game, Dodgin' Diamond 2. As usual, a screenshot, of the game's menu:

« Last Edit: May 15, 2012, 05:03:48 pm by hoffa »