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 - Jim Bauwens

Pages: 1 ... 6 7 [8] 9 10 ... 125
106
Well in a sense you probably could minimize stuff like FFFFFFFF mathematically ;P Like replace it with 2^8 - 1.

107
My converter supports transparency now. I didn't enable it yesterday because it wasn't working properly, it gave some strange results. However, it seems that that was due to a little bug in the BLIT_P (which has already been fixed now :)). I modified my alpha conversion code a bit to bypass the bug and it works good now. (thanks timwessman for the help!)

Edit: and now it also minimizes the length for every 64bit group of data.

108
News / Re: HP-Prime prototype performance test: color graphic programs
« on: August 13, 2013, 06:39:21 am »
By the way, is there any image<>hex converter that supports A1R5G5B5 format or something that can convert JPEG/BMP/GIF to exactly that image format?

No, don't have anything for that. Sorry. (might tweak one and post it later though). It is a very basic encoding scheme though.


Basically, all that is happening is that you convert a #FF value into a linearly scaled #1F value. Here is a C macro that shows how this is done internally.

#define RGBToColor(R,G,B) (((R>>3)<<10)+((G>>3)<<5)+((B>>3))) // transforms 0-255 RGB into color

The 16 bit is just a flag that signifies transparency.

Note that the DIMGROB command just takes the information in order. So if you want to make a 6x3 grob, The first 4 16 bit groups come out of the first hex numb, the next hex num takes the first 2 and then the last 2 are the start of the second line and so on...  { |#64bits, #(upper32)||(lower32), #64bits|,|#64bits,#(upper32bits)|(unused) }.

Each line in the 6 width takes the first 6 16 bit groups it finds. Each "line" of the grob is defined between the paired | |. Remember that all hex numbers, regardless of sign/unsigned/bits is internally 64 bits of data.

Ah thanks for the information. I made a quick converter in javascript to convert sprites: http://bwns.be/jim/hpsprite.html .

109
News / Re: HP-Prime prototype performance test: color graphic programs
« on: August 12, 2013, 03:06:34 pm »
Hello,

The code I'd posted previously (the little sprite command), shows how to load colors to a grob, and how to scale it.

Code: [Select]
EXPORT Sprite()
BEGIN
DIMGROB_P(G2,4,4,{ #7C0003E0001F0000:64, #0, #0, #7C0003E0001F0000:64 });
BLIT_P(G0,20,20,100,100,G2,RGB(0,0,0));
WAIT(3);
END;

Note that scaling is only a pixel by pixel things. It doesn't not interpolate. Also note that you can specify different source regions from the grob. This means you could have a larger grob containing a tileset, and blit in from a specific location.

I've tried some of my own 4x4 sprites and they work fine. However, I can't manage to go beyond 4x4 because I can't specify hex strings longer than 64 bits. Any way that bigger sprites can be done (using hex strings)?

110
News / Re: HP-Prime prototype performance test: color graphic programs
« on: August 12, 2013, 05:33:54 am »
By the way, is there any image<>hex converter that supports A1R5G5B5 format or something that can convert JPEG/BMP/GIF to exactly that image format?

Do you have any sample HEX strings? Just to see what endianness is needed. Once I got this I'll add an export option to my TI-Nspire sprite editor as Nspire Lua also uses A1R5G5B5 for its sprites.

111
nRemote or NspireHub take screenshots and decode pixels that represent data (that we put there at 0,0 absolute position of the display). It then sends a trigger to the calc to let know that it received the data.

112
Well yeah, that's true.

In that case, here are the codes
Spoiler For Spoiler:
Code: [Select]
private static final byte[] ESC_KEY_BYTES = { 27, -106, 0 };
 private static final byte[] CTRL_ESC_KEY_BYTES = { 0, -17, 0 };

 private static final byte[] TAB_KEY_BYTES = { 9, -107, 0 };
 private static final byte[] SHIFT_TAB_KEY_BYTES = { 124, -107, 0 };
 private static final byte[] CTRL_TAB_KEY_BYTES = { 0, -19, 0 };

 private static final byte[] HOME_KEY_BYTES = { 0, -3, 0 };
 private static final byte[] CTRL_HOME_KEY_BYTES = { 0, -2, 0 };

 private static final byte[] MENU_KEY_BYTES = { 0, 54, 0 };
 private static final byte[] CTRL_MENU_KEY_BYTES = { 0, -50, 0 };
 private static final byte[] MOUSE_CONTEXT_MENU_KEY_BYTES = { 0, -96, 0 };

 private static final byte[] CLICK_KEY_BYTES = { 0, -83, 0 };
 private static final byte[] CTRL_CLICK_KEY_BYTES = { 0, -84, 0 };
 private static final byte[] SHIFT_GRAB_KEY_BYTES = { 0, -7, 0 };

 private static final byte[] LEFT_KEY_BYTES = { 0, 7, 0 };
 private static final byte[] SHIFT_LEFT_KEY_BYTES = { 0, -15, 0 };
 private static final byte[] SHIFT_HOLD_LEFT_KEY_BYTES = { 0, 7, 3 };
 private static final byte[] CTRL_LEFT_KEY_BYTES = { 0, -38, 0 };

 private static final byte[] RIGHT_KEY_BYTES = { 0, 39, 0 };
 private static final byte[] SHIFT_RIGHT_KEY_BYTES = { 0, -14, 0 };
 private static final byte[] SHIFT_HOLD_RIGHT_KEY_BYTES = { 0, 39, 3 };
 private static final byte[] CTRL_RIGHT_KEY_BYTES = { 0, -37, 0 };

 private static final byte[] UP_KEY_BYTES = { 0, 23, 0 };
 private static final byte[] SHIFT_UP_KEY_BYTES = { 0, -13, 0 };
 private static final byte[] SHIFT_HOLD_UP_KEY_BYTES = { 0, 23, 3 };
 private static final byte[] CTRL_UP_KEY_BYTES = { 0, -36, 0 };

 private static final byte[] DOWN_KEY_BYTES = { 0, 55, 0 };
 private static final byte[] SHIFT_DOWN_KEY_BYTES = { 0, -12, 0 };
 private static final byte[] SHIFT_HOLD_DOWN_KEY_BYTES = { 0, 55, 3 };
 private static final byte[] CTRL_DOWN_KEY_BYTES = { 0, -35, 0 };

 private static final byte[] EQUAL_KEY_BYTES = { 61, 117, 0 };
 private static final byte[] CTRL_EQUAL_KEY_BYTES = { 0, -23, 0 };

 private static final byte[] SUCH_THAT_KEY_BYTES = { 124, -19, 0 };

 private static final byte[] A_KEY_BYTES = { 97, 102, 0 };
 private static final byte[] SHIFT_A_KEY_BYTES = { 65, 102, 0 };
 private static final byte[] CTRL_A_KEY_BYTES = { 97, 102, 0 };

 private static final byte[] B_KEY_BYTES = { 98, 70, 0 };
 private static final byte[] SHIFT_B_KEY_BYTES = { 66, 70, 0 };
 private static final byte[] CTRL_B_KEY_BYTES = { 2, -79, 0 };

 private static final byte[] C_KEY_BYTES = { 99, 38, 0 };
 private static final byte[] SHIFT_C_KEY_BYTES = { 67, 38, 0 };
 private static final byte[] CTRL_C_KEY_BYTES = { 3, -78, 0 };

 private static final byte[] FLAG_KEY_BYTES = { 0, -89, 0 };
 private static final byte[] CTRL_FLAG_KEY_BYTES = { 0, -8, 0 };

 private static final byte[] LESS_THAN_KEY_BYTES = { 60, -90, 0 };
 private static final byte[] CTRL_LESS_THAN_KEY_BYTES = { 0, -49, 0 };

 private static final byte[] D_KEY_BYTES = { 100, -123, 0 };
 private static final byte[] SHIFT_D_KEY_BYTES = { 68, -123, 0 };
 private static final byte[] CTRL_D_KEY_BYTES = { 4, -77, 0 };

 private static final byte[] E_KEY_BYTES = { 101, 101, 0 };
 private static final byte[] SHIFT_E_KEY_BYTES = { 69, 101, 0 };
 private static final byte[] CTRL_E_KEY_BYTES = { 5, -76, 0 };

 private static final byte[] F_KEY_BYTES = { 102, 69, 0 };
 private static final byte[] SHIFT_F_KEY_BYTES = { 70, 69, 0 };
 private static final byte[] CTRL_F_KEY_BYTES = { 6, -75, 0 };

 private static final byte[] G_KEY_BYTES = { 103, 37, 0 };
 private static final byte[] SHIFT_G_KEY_BYTES = { 71, 37, 0 };
 private static final byte[] CTRL_G_KEY_BYTES = { 7, -74, 0 };

 private static final byte[] TILDE_KEY_BYTES = { 39, -11, 0 };
 private static final byte[] CTRL_TILDE_KEY_BYTES = { 36, 5, 0 };

 private static final byte[] GREATER_THAN_KEY_BYTES = { 62, -122, 0 };
 private static final byte[] CTRL_GREATER_THAN_KEY_BYTES = { 0, -34, 0 };

 private static final byte[] H_KEY_BYTES = { 104, -124, 0 };
 private static final byte[] SHIFT_H_KEY_BYTES = { 72, -124, 0 };
 private static final byte[] CTRL_H_KEY_BYTES = { 8, -73, 0 };

 private static final byte[] I_KEY_BYTES = { 105, 100, 0 };
 private static final byte[] SHIFT_I_KEY_BYTES = { 73, 100, 0 };
 private static final byte[] CTRL_I_KEY_BYTES = { 9, -72, 0 };

 private static final byte[] J_KEY_BYTES = { 106, 68, 0 };
 private static final byte[] SHIFT_J_KEY_BYTES = { 74, 68, 0 };
 private static final byte[] CTRL_J_KEY_BYTES = { 10, -71, 0 };

 private static final byte[] K_KEY_BYTES = { 107, 36, 0 };
 private static final byte[] SHIFT_K_KEY_BYTES = { 75, 36, 0 };
 private static final byte[] CTRL_K_KEY_BYTES = { 11, -70, 0 };

 private static final byte[] QUOTE_KEY_BYTES = { 34, -95, 0 };

 private static final byte[] IMAGINARY_KEY_BYTES = { 0, -94, 0 };
 private static final byte[] CTRL_IMAGINARY_KEY_BYTES = { 0, -95, 0 };

 private static final byte[] L_KEY_BYTES = { 108, -125, 0 };
 private static final byte[] SHIFT_L_KEY_BYTES = { 76, -125, 0 };
 private static final byte[] CTRL_L_KEY_BYTES = { 12, -69, 0 };

 private static final byte[] M_KEY_BYTES = { 109, 99, 0 };
 private static final byte[] SHIFT_M_KEY_BYTES = { 77, 99, 0 };
 private static final byte[] CTRL_M_KEY_BYTES = { 13, -68, 0 };

 private static final byte[] N_KEY_BYTES = { 110, 67, 0 };
 private static final byte[] SHIFT_N_KEY_BYTES = { 78, 67, 0 };
 private static final byte[] CTRL_N_KEY_BYTES = { 14, -67, 0 };

 private static final byte[] O_KEY_BYTES = { 111, 35, 0 };
 private static final byte[] SHIFT_O_KEY_BYTES = { 79, 35, 0 };
 private static final byte[] CTRL_O_KEY_BYTES = { 15, -66, 0 };

 private static final byte[] COLON_KEY_BYTES = { 58, 1, 0 };
 private static final byte[] CTRL_COLON_KEY_BYTES = { 59, 2, 0 };

 private static final byte[] EXP_KEY_BYTES = { 0, -92, 0 };

 private static final byte[] P_KEY_BYTES = { 112, -126, 0 };
 private static final byte[] SHIFT_P_KEY_BYTES = { 80, -126, 0 };
 private static final byte[] CTRL_P_KEY_BYTES = { 16, -65, 0 };

 private static final byte[] Q_KEY_BYTES = { 113, 98, 0 };
 private static final byte[] SHIFT_Q_KEY_BYTES = { 81, 98, 0 };
 private static final byte[] CTRL_Q_KEY_BYTES = { 17, -64, 0 };

 private static final byte[] R_KEY_BYTES = { 114, 66, 0 };
 private static final byte[] SHIFT_R_KEY_BYTES = { 82, 66, 0 };
 private static final byte[] CTRL_R_KEY_BYTES = { 18, -63, 0 };

 private static final byte[] S_KEY_BYTES = { 115, 34, 0 };
 private static final byte[] SHIFT_S_KEY_BYTES = { 83, 34, 0 };
 private static final byte[] CTRL_S_KEY_BYTES = { 19, -62, 0 };

 private static final byte[] QUESTION_MARK_KEY_BYTES = { 63, 3, 0 };
 private static final byte[] CTRL_QUESTION_MARK_KEY_BYTES = { 0, -53, 0 };

 private static final byte[] PI_KEY_BYTES = { 0, -93, 0 };
 private static final byte[] CTRL_PI_KEY_BYTES = { 0, -12, 0 };

 private static final byte[] T_KEY_BYTES = { 116, -127, 0 };
 private static final byte[] SHIFT_T_KEY_BYTES = { 84, -127, 0 };
 private static final byte[] CTRL_T_KEY_BYTES = { 20, -61, 0 };

 private static final byte[] U_KEY_BYTES = { 117, 97, 0 };
 private static final byte[] SHIFT_U_KEY_BYTES = { 85, 97, 0 };
 private static final byte[] CTRL_U_KEY_BYTES = { 21, -60, 0 };

 private static final byte[] V_KEY_BYTES = { 118, 65, 0 };
 private static final byte[] SHIFT_V_KEY_BYTES = { 86, 65, 0 };
 private static final byte[] CTRL_V_KEY_BYTES = { 22, -59, 0 };

 private static final byte[] W_KEY_BYTES = { 119, 33, 0 };
 private static final byte[] SHIFT_W_KEY_BYTES = { 87, 33, 0 };
 private static final byte[] CTRL_W_KEY_BYTES = { 23, -58, 0 };

 private static final byte[] COMMA_KEY_BYTES = { 44, -96, 0 };

 private static final byte[] THETA_KEY_BYTES = { -120, 6, 0 };

 private static final byte[] X_KEY_BYTES = { 120, -128, 0 };
 private static final byte[] SHIFT_X_KEY_BYTES = { 88, -128, 0 };
 private static final byte[] CTRL_X_KEY_BYTES = { 24, -57, 0 };

 private static final byte[] Y_KEY_BYTES = { 121, 96, 0 };
 private static final byte[] SHIFT_Y_KEY_BYTES = { 89, 96, 0 };
 private static final byte[] CTRL_Y_KEY_BYTES = { 25, -56, 0 };

 private static final byte[] Z_KEY_BYTES = { 122, 64, 0 };
 private static final byte[] SHIFT_Z_KEY_BYTES = { 90, 64, 0 };
 private static final byte[] CTRL_Z_KEY_BYTES = { 26, -55, 0 };

 private static final byte[] SPACE_KEY_BYTES = { 32, 32, 0 };
 private static final byte[] CTRL_SPACE_KEY_BYTES = { 0, -51, 0 };

 private static final byte[] NEW_LINE_KEY_BYTES = { 0, 10, 0 };

 private static final byte[] CTRL_KEY_BYTES = { 0, -86, 4 };
 private static final byte[] SHIFT_KEY_BYTES = { 0, -85, 3 };
 private static final byte[] CTRL_SHIFT_KEY_BYTES = { 0, -85, 7 };

 private static final byte[] BACK_SPACE_KEY_BYTES = { 8, 21, 0 };
 private static final byte[] SHIFT_BACK_SPACE_KEY_BYTES = { 8, 21, 0 };
 private static final byte[] CTRL_BACK_SPACE_KEY_BYTES = { 0, -29, 4 };

 private static final byte[] VAR_KEY_BYTES = { 0, -81, 0 };
 private static final byte[] CTRL_VAR_KEY_BYTES = { 0, -88, 0 };

 private static final byte[] LEFT_PARENTHESES_KEY_BYTES = { 40, 85, 0 };
 private static final byte[] CTRL_LEFT_PARENTHESES_KEY_BYTES = { 0, -25, 0
};

 private static final byte[] RIGHT_PARENTHESES_KEY_BYTES = { 41, 53, 0 };
 private static final byte[] CTRL_RIGHT_PARENTHESES_KEY_BYTES = { 0, -27,
0 };

 private static final byte[] CATALOG_KEY_BYTES = { 0, -111, 0 };
 private static final byte[] CTRL_CATALOG_KEY_BYTES = { 0, -18, 0 };

 private static final byte[] POWER_KEY_BYTES = { 94, -109, 0 };
 private static final byte[] CTRL_POWER_KEY_BYTES = { 0, -21, 0 };

 private static final byte[] SIN_KEY_BYTES = { 0, 116, 0 };
 private static final byte[] CTRL_SIN_KEY_BYTES = { 0, -24, 0 };

 private static final byte[] COS_KEY_BYTES = { 0, 84, 0 };
 private static final byte[] CTRL_COS_KEY_BYTES = { 0, -26, 0 };

 private static final byte[] TAN_KEY_BYTES = { 0, 52, 0 };
 private static final byte[] CTRL_TAN_KEY_BYTES = { 0, -28, 0 };

 private static final byte[] SLASH_KEY_BYTES = { 47, 20, 0 };
 private static final byte[] CTRL_SLASH_KEY_BYTES = { 0, -30, 0 };

 private static final byte[] SQUARE_KEY_BYTES = { 0, -109, 0 };
 private static final byte[] CTRL_SQUARE_KEY_BYTES = { 0, -110, 0 };

 private static final byte[] SEVEN_KEY_BYTES = { 55, 113, 0 };
 private static final byte[] CTRL_SEVEN_KEY_BYTES = { 0, -41, 0 };

 private static final byte[] EIGHT_KEY_BYTES = { 56, 81, 0 };
 private static final byte[] CTRL_EIGHT_KEY_BYTES = { 0, -40, 0 };

 private static final byte[] NINE_KEY_BYTES = { 57, 49, 0 };
 private static final byte[] CTRL_NINE_KEY_BYTES = { 0, -39, 0 };

 private static final byte[] TIMES_KEY_BYTES = { 42, 19, 0 };
 private static final byte[] CTRL_TIMES_KEY_BYTES = { 0, -31, 0 };

 private static final byte[] TEN__POWER_KEY_BYTES = { 0, -20, 0 };
 private static final byte[] CTRL_TEN_POWE_KEY_BYTES = { 0, -108, 0 };

 private static final byte[] FOUR_KEY_BYTES = { 52, 114, 0 };
 private static final byte[] CTRL_FOUR_KEY_BYTES = { 0, -44, 0 };

 private static final byte[] FIVE_KEY_BYTES = { 53, 82, 0 };
 private static final byte[] CTRL_FIVE_KEY_BYTES = { 0, -43, 0 };

 private static final byte[] SIX_KEY_BYTES = { 54, 50, 0 };
 private static final byte[] CTRL_SIX_KEY_BYTES = { 0, -42, 0 };

 private static final byte[] MINUS_KEY_BYTES = { 45, 18, 0 };
 private static final byte[] CTRL_MINUS_KEY_BYTES = { 0, -32, 0 };

 private static final byte[] E_POWER_KEY_BYTES = { 0, -54, 0 };
 private static final byte[] CTRL_E_POWER_KEY_BYTES = { 0, -87, 0 };

 private static final byte[] ONE_KEY_BYTES = { 49, 115, 0 };
 private static final byte[] CTRL_ONE_KEY_BYTES = { 0, -47, 0 };

 private static final byte[] TWO_KEY_BYTES = { 50, 83, 0 };
 private static final byte[] CTRL_TWO_KEY_BYTES = { 0, -46, 0 };

 private static final byte[] THREE_KEY_BYTES = { 51, 51, 0 };
 private static final byte[] CTRL_THREE_KEY_BYTES = { 0, -45, 0 };

 private static final byte[] PLUS_KEY_BYTES = { 43, 17, 0 };
 private static final byte[] CTRL_PLUS_KEY_BYTES = { 0, -33, 0 };

 private static final byte[] ON_KEY_BYTES = { 0, 11, 0 };
 private static final byte[] CTRL_ON_KEY_BYTES = { 0, -16, 0 };

 private static final byte[] ZERO_KEY_BYTES = { 48, 80, 0 };
 private static final byte[] CTRL_ZERO_KEY_BYTES = { 0, -48, 0 };

 private static final byte[] POINT_KEY_BYTES = { 46, 112, 0 };

 private static final byte[] NEG_KEY_BYTES = { -79, 48, 0 };
 private static final byte[] CTRL_NEG_KEY_BYTES = { 0, -82, 0 };

 private static final byte[] ENTER_KEY_BYTES = { 13, 16, 0 };
 private static final byte[] CTRL_ENTER_KEY_BYTES = { 0, -90, 0 };

113
You (mostly) don't need the 3-byte key code definition. You can just send ascii, as shown in my code ;)

114
Lua / Re: documentation on ETK API?
« on: August 09, 2013, 12:37:34 pm »
Yes, be sure to invalidate your screen if you want your application to be updated. On the PC/Mac software this happens very much without needing to invalidate yourself, so your application might seem to work properly on the computer software but not on the handheld. Also moving your mouse on the handheld might trigger invalidation of the screen (causing it to update). So just invalidate your screen when you want it to update.

Sadly enough we can't change how the cursor reacts. It's indeed quite horrid how it works now.

Normally on.mouseUp should be called when releasing the left mouse button on the handheld.

115
News / Re: Mini vMac for the TI-Nspire
« on: August 09, 2013, 12:32:25 pm »
First of all, the Mini vMac SDL version doesn't have support for scrolling. The reason why I can't fix it, something I mentioned before, is simply because I don't have the time to do so. At the moment I'm very busy managing all stuff in real life, while trying to keep it with some of my projects.

On a side note, Hoffa has noted that he is working again on adding mouse support to nSDL. This is great news as it means it will indirectly improve touchpad support in Mini vMac :)

116
Attached to this post you can find NspireHub and TinyWeb. Nspire hub is a Linux application using libti* to communicate with your TI-Nspire. It allows you to send files, keypresses and capture screenshots. It provides some "wrappers" for simple Lua scripts (you run ./nspirelink yourluascript.lua) to allow simple applications. At the moment it contains a script that provides support for TinyWeb. TinyWeb is a (pure) Nspire Lua web browser. At the moment it's not really stable software, but is perfect to demostrate what you can do. It incorporates 1) sending a request to the computer 2) receiving data back 3) receiving the html file converted to a tns 4) parsing the file and displaying the file.

So, I hope the code will help you take advantage of libti* and make an awesome package manager :)

117
News / Re: Mini vMac for the TI-Nspire
« on: August 01, 2013, 06:10:16 pm »
That's good to know, I'll see to fix this in a future build. Thanks for testing :)
If you keep pressing, the mouse should accelerate.

118
News / Re: Mini vMac for the TI-Nspire
« on: August 01, 2013, 03:04:16 pm »

119
News / Re: Mini vMac for the TI-Nspire
« on: July 31, 2013, 04:28:19 pm »
Ah, I somehow misread that you had a touchpad. I have only tested it on touchpad/cx hardware. Hmm, the problem might indeed be the touchpad driver I'm using. I'll see if I can find (but that will have to be tomorrow) the version that doesn't have touchpad support. If you can't wait you could try to compile the source code yourself, it will be without touchpad support by default (because you need to patch nSDL if you want that).

120
News / Re: Mini vMac for the TI-Nspire
« on: July 31, 2013, 03:07:03 pm »
Maybe one of the files somehow got corrupted, could you retry sending them? At the moment I don't have any idea what the problem could be. I'm thinking about it.

Pages: 1 ... 6 7 [8] 9 10 ... 125