Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 June, 2013, 03:33:11 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 ... 8 9 [10] 11 12 ... 23   Go Down
  Print  
Author Topic: nSDL 1.1.1 Anniversary Edition—The Ultimate TI-Nspire Graphics Library! -  (Read 15970 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
atiatinini
LV1 Newcomer (Next: 20)
*
Offline Offline

Gender: Male
Last Login: 19 November, 2012, 01:04:19
Date Registered: 02 March, 2012, 20:49:13
Location: Portugal
Posts: 19

Total Post Ratings: 0

View Profile
« Reply #135 on: 27 March, 2012, 22:20:23 »
0

Won't all of these relocation issues be fixed if we use an elf/bFLT/QEMU loader? Smiley
« Last Edit: 27 March, 2012, 22:25:17 by atiatinini » Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 17 June, 2013, 22:09:26
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 772

Total Post Ratings: +152

View Profile
« Reply #136 on: 27 March, 2012, 22:55:03 »
0

Maybe.

 atiatinini, hoffa, which version of YAGARTO/Newlib are you respectively using?
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
hoffa
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 01:44:51
Date Registered: 28 May, 2011, 20:26:32
Posts: 303


Topic starter
Total Post Ratings: +116

View Profile
« Reply #137 on: 27 March, 2012, 23:03:22 »
0

binutils: 2.21
gcc:      4.6.2
newlib:   1.19.0
gdb:      7.3.1

BTW, atiatini, meanwhile you could use the fast inverse square root function (used in Quake for example):

float inv_sqrt(float x) {
   union {
      float x;
      int i;
   } u = {x};
   u.i = 0x5f3759df - (u.i >> 1);
   return u.x * (1.5f - (0.5f * x * u.x * u.x));
}


It's quite "hackish", but just do 1/inv_sqrt() and you have an accurate and a very fast approximation of the square root.
« Last Edit: 27 March, 2012, 23:09:41 by hoffa » Logged
atiatinini
LV1 Newcomer (Next: 20)
*
Offline Offline

Gender: Male
Last Login: 19 November, 2012, 01:04:19
Date Registered: 02 March, 2012, 20:49:13
Location: Portugal
Posts: 19

Total Post Ratings: 0

View Profile
« Reply #138 on: 27 March, 2012, 23:14:44 »
0

Thanks, I'll use those "alternative methods" then. Smiley
Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 17 June, 2013, 22:09:26
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 772

Total Post Ratings: +152

View Profile
« Reply #139 on: 27 March, 2012, 23:27:54 »
0

I'd prefer that both of you contribute to find out the root cause of the issue.
atiatinini, if you are trying to port SDL programs, you'll probably encounter other conflicts more difficult to identify and work around.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
hoffa
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 01:44:51
Date Registered: 28 May, 2011, 20:26:32
Posts: 303


Topic starter
Total Post Ratings: +116

View Profile
« Reply #140 on: 27 March, 2012, 23:35:09 »
0

I'd prefer that both of you contribute to find out the root cause of the issue.
I'll have a more thorough look at it tomorrow (or whenever I have the time). I checked newlib's sqrt() implementation (I'm pretty sure that's the one used), and there doesn't seem to be any global variable stuff that could cause issues.
« Last Edit: 27 March, 2012, 23:38:48 by hoffa » Logged
atiatinini
LV1 Newcomer (Next: 20)
*
Offline Offline

Gender: Male
Last Login: 19 November, 2012, 01:04:19
Date Registered: 02 March, 2012, 20:49:13
Location: Portugal
Posts: 19

Total Post Ratings: 0

View Profile
« Reply #141 on: 27 March, 2012, 23:52:03 »
0

I'd prefer that both of you contribute to find out the root cause of the issue.
atiatinini, if you are trying to port SDL programs, you'll probably encounter other conflicts more difficult to identify and work around.
Yes, there are a few things that doesn't seem to work with Ndless, like srand(int) and rand();
Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 17 June, 2013, 22:09:26
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 772

Total Post Ratings: +152

View Profile
« Reply #142 on: 28 March, 2012, 10:08:03 »
0

The source code of Newlib's sqrt is this one:

http://sourceware.org/cgi-bin/cvsweb.cgi/src/newlib/libm/math/w_sqrt.c?annotate=1.1.1.1&cvsroot=src

_LIB_VERSION refers to the global variable __fdlib_version, I'm not sure why but it seems to require relocation, which cannot be provided by Ndless.
It actually doesn't work well without nSDL, it's just that the random access to memory falls to a valid address (but still not __fdlib_version).
I'm afraid we cannot trust any Newlib function without a full-featured relocator.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
hoffa
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 01:44:51
Date Registered: 28 May, 2011, 20:26:32
Posts: 303


Topic starter
Total Post Ratings: +116

View Profile
« Reply #143 on: 28 March, 2012, 15:26:01 »
0

The source code of Newlib's sqrt is this one:

http://sourceware.org/cgi-bin/cvsweb.cgi/src/newlib/libm/math/w_sqrt.c?annotate=1.1.1.1&cvsroot=src

_LIB_VERSION refers to the global variable __fdlib_version, I'm not sure why but it seems to require relocation, which cannot be provided by Ndless.
It actually doesn't work well without nSDL, it's just that the random access to memory falls to a valid address (but still not __fdlib_version).
I'm afraid we cannot trust any Newlib function without a full-featured relocator.
Can't Newlib "just" be recompiled with some nl_relocdata hacking meanwhile?
Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 17 June, 2013, 22:09:26
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 772

Total Post Ratings: +152

View Profile
« Reply #144 on: 28 March, 2012, 15:30:34 »
0

I suppose this would require some effort. And for example I don't understand why _LIB_VERSION would require nl_relocdata, so identifying what needs to be patched isn't clear to me.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
hoffa
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 01:44:51
Date Registered: 28 May, 2011, 20:26:32
Posts: 303


Topic starter
Total Post Ratings: +116

View Profile
« Reply #145 on: 28 March, 2012, 16:38:11 »
0

I'll try and port (wait, no, I will port) fdlibm (actually I think that's what newlib partly uses); it would be a nice add-on with the next nSDL release.

EDIT:

I compiled the fdlibm sqrt routine codes with _IEEE_LIBM and __LITTLE_ENDIAN defined, and it works nicely:



The "inside *" messages are there to prove that it is indeed using the new functions and those of the math lib magically included by GCC.
Maybe the same trick could be blindly used on newlib's libm code (which should be pretty much the same).

PS: It seems that GCC includes libm even without -lm, how do I force it not to use any libraries? Using -nostdlib with ld-nspire just makes it vomit all kinds of __aeabi_* errors.

EDIT2: I did a few changes and compiled fdlibm; it should implement all functions in <math.h> and it also contains the macros (were added from newlib's <math.h> manually). If it works well it could be a more or less lightweight replacement to newlib's libm.a. Library's attached.

* libm.zip (160.56 KB - downloaded 19 times.)
« Last Edit: 28 March, 2012, 20:36:56 by hoffa » Logged
hoffa
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 01:44:51
Date Registered: 28 May, 2011, 20:26:32
Posts: 303


Topic starter
Total Post Ratings: +116

View Profile
« Reply #146 on: 29 March, 2012, 22:48:29 »
0

I managed to get the mouse to work, at least to some degree. Some very weird bug shuts down the program at seemingly random moments, as you can see:

<a href="http://www.youtube.com/watch?v=CgPxly7vODM" target="_blank">http://www.youtube.com/watch?v=CgPxly7vODM</a>

EDIT: After numerous tests it seems that it crashes (or whatever happens) if the mouse goes to the y-coordinate 9. I see no logical explanation for this bug.
« Last Edit: 29 March, 2012, 23:12:33 by hoffa » Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 17 June, 2013, 22:09:26
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 772

Total Post Ratings: +152

View Profile
« Reply #147 on: 31 March, 2012, 10:15:52 »
0

I've looked closer if anything could be done for the relocation issue. Global variables containing data which need to be relocated are stored in the 'data.rel' section of the ELF file, but this doesn't mean we can blindly relocate anything in this section, since there may also be fields not to be relocated. The relocation info cannot be emitted to the binary file and the current Ndless relocator cannot do much about it.

I'd like to see if tangrs's relocator ( http://www.omnimaga.org/index.php?topic=13117.0 ) would fix all these issues.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
hoffa
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 01:44:51
Date Registered: 28 May, 2011, 20:26:32
Posts: 303


Topic starter
Total Post Ratings: +116

View Profile
« Reply #148 on: 03 April, 2012, 14:00:18 »
+1

Just to give you a quick heads up, the next version--0.2.0--and rather major step, will have numerous changes. Among those will be mouse support, 8 BPP support for CX (thanks to atiatini for the idea; makes it possible to port 8 BPP programs for the CX), many font-related changes (if you're the observing type you can notice one thing on the screenshot below) and a lot of under-the-hood modifications (performance, stability, etc.). Also a few surprises. Quick screenshot to show 16 BPP and palettized 8 BPP on CX (actually it's just an excuse to give the thread some color):

« Last Edit: 03 April, 2012, 14:04:02 by hoffa » Logged
Lionel Debroux
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Yesterday at 22:15:45
Date Registered: 17 December, 2009, 09:37:25
Location: France
Posts: 1916

Total Post Ratings: +215

View Profile WWW
« Reply #149 on: 03 April, 2012, 14:19:52 »
0

Looks good, as usual Smiley

Quote
8 BPP support for CX (thanks to atiatini for the idea; makes it possible to port 8 BPP programs for the CX),
FWIW, while their screen sucks beyond usability, the Clickpad & Touchpad models do support 8 bpp, as shown by nDOOM Smiley

Quote
many font-related changes (if you're the observing type you can notice one thing on the screenshot below)
Transparency ?
Logged

Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.
Pages: 1 ... 8 9 [10] 11 12 ... 23   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.287 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.