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

Pages: 1 ... 13 14 [15] 16 17 ... 22
211
nSDL / Re: SDL for the TI-Nspire
« on: February 16, 2012, 01:05:57 pm »
I'm now able to fill the screen (which by itself isn't too amazing, but it does prove that the underlying stuff works) and update it (and update any part of the screen for that matter, although with a solid-colored surface it's hard to tell if it works as it should). This is where I'll leave it for a week, going to the French alps tomorrow; gotta pack my skiing gear.


212
nSDL / Re: SDL for the TI-Nspire
« on: February 15, 2012, 10:50:55 am »
Oh wow, thanks. I'm quite surprised as I tried the same code as you except without the &-operator; I thought prefixing a function name with the ampersand was optional, both should return the address of the said function AFAIK.

EDIT:
This is great news as I'm now able to initialize the barebone video driver:


213
nSDL / Re: SDL for the TI-Nspire
« on: February 12, 2012, 06:56:42 am »
Thanks, but it unfortunately did not fix it. What exactly does size refer to--what size does it refer to (in bytes I presume)? I'll experiment around a bit, but if there is no solution yet I will kindly wait for any future developments.

EDIT:
What do you mean relocating NULL? bootstrap is not NULL, nor is the quotient equal to zero.

214
nSDL / Re: SDL for the TI-Nspire
« on: February 11, 2012, 01:20:19 pm »
Could somebody quickly check my code, it doesn't seem to print the value of f. Either I'm using nl_relocdata wrong, or then I'm too tired and am missing something silly.

http://pastebin.com/N2iiUhd1

That's more or less how SDL behaves at one point, and it's reallocating the function pointer that causes issues. The strings print out fine, calling the function doesn't work though.

EDIT: I've tried everything I can think of. Am I really missing something here or is there no way to use nl_relocdata on a pointer to a function? (I doubt it, even in the wiki it is mentioned)

215
nSDL / Re: SDL for the TI-Nspire
« on: February 11, 2012, 11:08:35 am »
I will rely on nl_relocdata as long as possible then; the advantages of keeping the ELF loader away outweigh the advantages of integrating it. But we'll see how it turns out after a few lines of code.

216
nSDL / Re: SDL for the TI-Nspire
« on: February 11, 2012, 10:57:24 am »
I see. But how come then that you were able to see the strings?

It does work now, but I'm afraid it will make the porting process a rather "hacky" and dirty one, with #if directives everywhere (breaking the clean code and flexibility) as SDL does rely quite a lot on structs. The code is not that simple in SDL as in the example, so the result might be spaghetti code. For now I'll try to see how it goes with nl_relocdata, if the code becomes an ugly mess I'll tell you. Thanks anyway for pointing out that fix, it'll be useful.

What are the drawbacks of using the ELF loader?

217
nSDL / Re: SDL for the TI-Nspire
« on: February 11, 2012, 10:01:20 am »
This is very weird, not the first time only I have the issues.

Here's the assembly code: http://pastebin.com/2Giv2ScW

I also attached a TNS that doesn't print the values.

EDIT:
Windows 7 x64 and Yagarto that uses the following versions:
binutils: 2.21
gcc:      4.6.2
newlib:   1.19.0
gdb:      7.3.1

218
nSDL / Re: SDL for the TI-Nspire
« on: February 11, 2012, 08:04:18 am »
I think I've finally--after many smashed walls, headaches and a bucket of aspirin--narrowed down one major issue.

Have this piece of code for instance:
Code: [Select]
#include <os.h>

typedef struct type1_t {
    const char *s;
} type1_t;

typedef struct type2_t {
    const char *s1;
    const char *s2;
} type2_t;

int main(void) {
    type1_t test1 = {"foobar"};
    type2_t test2 = {"foo", "bar"};
    printf("test1.s: %s\n", test1.s); /* Prints "foobar" */
    printf("test2.s1: %s\n", test2.s1); /* Should print "foo"; doesn't */
    printf("test2.s2: %s\n", test2.s2); /* Should print "bar"; doesn't */
    return 0;
}

As you can read, the output is:
test1.s: foobar
test2.s1:
test2.s2:

Which is completely wrong. Here's what the output obviously should be: http://codepad.org/DQcGIFy3

I think this might be one of those ARM struct alignment issues, or possibly some other bug. Either way, it has kept me from advancing with the port.
Any input on this one, ExtendeD? (or others, if you know what might be causing the problem)

219
nSDL / Re: SDL for the TI-Nspire
« on: February 01, 2012, 06:56:37 am »
Got SDL to run on the calculator. Now that it does, I can start doing the more serious things.


220
TI-Nspire / Re: NGL — TI-Nspire Graphics Library
« on: January 30, 2012, 06:07:08 pm »
Sure.

Edit: disregard that, got it to work.

221
TI-Nspire / Re: NGL — TI-Nspire Graphics Library
« on: January 30, 2012, 03:58:06 pm »
Are you sure that the file not being sent isn't just a bug in nspire_emu? Try to connect and send again.
I'm quite sure it isn't a bug. It's difficult to explain why, but nspire_emu's behavior feels consistent and more or less logical.

edit: Isn't that the issue you wrote about and fixed here?
That was just a quick hack (that doesn't seem to always work) for nspire_emu disconnecting the USB link every once in a while. It's not it.

222
TI-Nspire / Re: NGL — TI-Nspire Graphics Library
« on: January 30, 2012, 03:46:44 pm »
hoffa, will you still continue to try the SDL port?
Yes, I will continue with the SDL port.

Quote
either the resulting binary cannot be sent to the calculator

What do you mean exactly?
Using nspire_emu, if I try to send the file nothing happens. No errors no nothing. Now that you mentioned the memcpy issue (didn't anyone was aware of it), I think it might very well be because of that.

or then that GCC doesn't compile the code (with some undefined reference's to memcpy).

See http://www.unsads.com/projects/nsptools/ticket/27 .
I'll quickly fix it if it's a blocking problem for you.
I'd appreciate it a lot if you could fix it, it would allow me to advance with the SDL port and with this library. I'm pretty sure it's what's causing the file not being sent.

223
TI-Nspire / Re: NGL — TI-Nspire Graphics Library
« on: January 30, 2012, 01:04:15 pm »
Great :)

Is it complementary to http://ourl.ca/14731/275989 ?
If I had to define it that way, I'd say alternative.

Also, I think I more or less know why there are issues with big chunks of data and the fact that sometimes my code doesn't run even though I changed practically nothing. I'm pretty sure it has to do with the way GCC optimizes for ARM. For instance the way it optimizes structs/enums/unions might cause alignment issues and whatnot (I noticed it won't run when I specify the blit destination with a struct ngl_rect).
http://www.aleph1.co.uk/chapter-10-arm-structured-alignment-faq
Seems like it's a rather common issue, at least according to the number of results on "arm struct alignment" on Google.

224
TI-Nspire / Re: NGL — TI-Nspire Graphics Library
« on: January 30, 2012, 09:20:35 am »
A suggestion:

ngl_create_surface(ngl_uint w, ngl_uint h)

Should probably be

ngl_create_surface(ngl_uint x, ngl_uint y, ngl_uint w, ngl_uint h)
ngl_create_surface only allocates memory for the surface. The surface can then be blitted to another surface (which can then be copied to the framebuffer using ngl_flip) using ngl_blit_surface, which asks for the position (the ngl_rect dst_rect parameter).

Edit:
Added support for 16-level grayscale format.

225
Calculator C / Re: program to convert bmp into Nspire c-arrays?
« on: January 30, 2012, 07:56:50 am »
I'm using a self-made tool, except it converts to normal RGB data (i.e. you'll have to parse the data in the program itself). http://hoffa.franceserv.fr/image2bytes/

Pages: 1 ... 13 14 [15] 16 17 ... 22