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

Pages: [1]
1
The begin is slow but the end is funny

http://www.dailymotion.com/video/x13z0bv_prime_tech

Sorry for poor quality video. It's better on the screen ;)

2
I tried your last code by the way and it works :D. Question, though: What is the BITSC command and what does it do? I couldn't find anything about it in the Wiki nor the calculator help. I did a search for BITSC and nothing could be found.


BITxx are bits manipulation commands . BITSR is bitwise shift right and it's the same than divide by 2 with a binary number.

1010101010b  -> 101010101b

To get the syntax on the Prime

push  the 'tool box'  key ( the same with MEM in blue)
tap 'Catlg' soft key to acces to all the Prime commands
search the command (scroll or write the first letters)
then push HELP

3
Hi all !

I don't understand how the alpha channel works (it use 1 bit or 3 bits ? one bit per channel color ?) ...

However, this  works for RGB :

Code: [Select]
EXPORT Red(c) BEGIN BITAND(BITSR(c,16),#7Fh); END;
EXPORT Green(c) BEGIN BITAND(BITSR(c,8),#7Fh); END;
EXPORT Blue(c) BEGIN BITAND(c,#7Fh); END;

I think it will be faster than divisions and modulo. Note that there is no need of RETURN keyword as the Prime always returns its last calculation

Quote
the HP Prime's screen uses 16-bits colors (R5G6B5 format), so you can't access  colors separately unless you use bitwise operators (and, or, not) and bit shifting. I don't think HP basic permits you to do that.

Seems to be  24 bits colors scheme with alpha transparency. It seems that you can define for each R G B color if there is transparency or not
So you have 128 x 128 x 128 colors,and 1 bit of tranparency for each R V B color ( it's just a guess ...)


This one is a lot faster :

Code: [Select]
EXPORT fadein()
BEGIN
 FOR C FROM 0 TO 3 DO
  FOR X FROM 0 TO 319 DO
   FOR Y FROM 0 TO 239 DO
    PIXON_P(X,Y,BITSR(GETPIX_P(X,Y)));  //avoid division and  variable ...
   END;
 END;
 END;
END;

By the way I wonder what happen when you use 'transparency' and copy a grob in another grob with the BLIT_P command ?

4
News / Re: HP-Prime prototype performance test: color graphic programs
« on: August 21, 2013, 09:55:54 am »
Wow 5 FPS is actually pretty darn good considering that is BASIC. Even the CSE has an hard time pulling this with pure ASM when in 320x240 mode.

SO basically no scrolling unless you want your game to scroll tile by tile, but pretty fast sprite movement and no long map loading :D

Now to figure out how to avoid having to keep a bunch of tiles displayed to the right side of the screen >.<

Hi, Just try :

EXPORT Sprite()
BEGIN
DIMGROB(G1,16,239);
FOR Z FROM 0 TO 239 DO
RECT_P(G1,0,Z,16,Z+1,RGB(IP(RANDOM(256)),Z,240-Z));
END;
WHILE 1 DO
FOR X FROM 0 TO 19 DO
FOR Y FROM 0 TO 14 DO
V:=16*IP(RANDOM(14));
BLIT_P(G0,16*X,16*Y,G1,0,V,16,V+16);
END;
END;
END;
END;

It's cuirous that INT works for Integer Part. The correct keyword accordind the help is IP  (INT is for calculate Integral)

5
News / Re: HP-Prime prototype performance test: color graphic programs
« on: August 20, 2013, 05:33:52 pm »
Small program example...
Real time rotation with a 40x40 pixels bloc

Code: [Select]

EXPORT Rota
BEGIN
 LOCAL sa,ca;
 DIMGROB(G1,40,40);
 RECT_P(99,79,140,120,0,RGB(255,255,255));
 FOR A:=0 TO 10*PI STEP PI/12 DO
  RECT_P(G1);
  sa:=SIN(-A); ca:=COS(-A);
  FOR X:=-20 TO 20 DO
   FOR Y:=-20 TO 20 DO
    PIXON_P(G1,X+20,Y+20,GETPIX_P(G0,X*ca-Y*sa+20,X*sa+Y*ca+20));
   END;
  END;
 BLIT_P(G0,100,80,140,120,G1,0,0,40,40);
 END;
 WAIT();
END;

Video hdw : http://www.dailymotion.com/video/x13eb0q_rotation

6
News / Re: HP-Prime prototype performance test: color graphic programs
« on: August 19, 2013, 07:20:11 am »
Hey Gilles59, that's some great looking stuff. :D Thanks for sharing, and welcome to Omnimaga.

Thanks!

I've no time for now but I did some little tests with the small skeletton of the 'defender'  program (change color, use sprites, kind of 'radar' in the upper of the screen...). I think the integrated langage of the prime is fast enough for fluid programs  like  tretis, 'snake', space invader ... even with scrolling...  

Add to this  the 'touch screen' behavoir and the possibilities are infinite. Of course, no 3D real time and  probably limitations with 2 D games...

All graphics command are really fast (including copy of parts of 'grob'in another grobs or in the screen (grob G0), ,and the keyboard management is fine.

I tried a 90° rotate with a 100x100 pixels in the more easy way to do (FOR x:1->100, FOR y:1->100, getpix (x,y)  -> pixon(y,x) in ... It tooks less than 0.6 sec (with the copy from G0 -> G1 and G1 ->G0 and 10000 pixels in 24 bits) . Not ASM for sure, but fast enough for many things

7
HP Calculators / Re: Student testers of DVT HP Prime appeared
« on: August 17, 2013, 12:28:05 pm »
They also mention that the touch screen isn't that accurate and that the key-pad can only move horizontally/vertically, no diagonal movement when moving a cursor, for example.

Hi,

No such problem with my pre-release unit. Touch screen accurate (for my fingers ;) ) , and the key-pad moves diagonal :D  
There is a MOUSE command for use touch screen in program...

8
News / Re: HP-Prime prototype performance test: color graphic programs
« on: August 15, 2013, 05:25:53 pm »
Hi all,

2 examples of programs and videos with the hardware :

http://www.dailymotion.com/video/x132v9e_defender_tech
Code: [Select]
EXPORT Defender()
BEGIN
 LOCAL xv:=10,yv:=20;
 DIMGROB_P(G1,640, 48);
 DIMGROB_P(G2,320,240);
 Y:=32;
 FOR X:=0 TO 640 DO
  Y:=MIN(MAX(Y-1+IP(RANDOM(3)),0),47);
  LINE_P(G1,X,48,X,48-Y);
  FREEZE;
 END;
 RECT();
 FOR X:=0 TO (640-64) DO
  xv:=xv+2*(ISKEYDOWN(8)-ISKEYDOWN(7));
  yv:=yv+2*(ISKEYDOWN(12)-ISKEYDOWN(2));
  BLIT_P(G2,0,0,320,240,G1,X,0,X+64,48);
  IF GETPIX_P(G2,xv+10,yv+5)==0 THEN BREAK; END;
  RECT_P(G2,xv,yv,xv+10,yv+5,0,#20B2AAh);
  BLIT_P(G0,G2);
 END;
 FOR N:=1 TO 100 DO INVERT_P; END;
END;

I tried the same program with a 40*20 pixels for the spaceship and it run at the same speed

Scroll(1) ->1 pixel scroll :D

http://www.dailymotion.com/video/x130nft_scroll-prime_tech

Code: [Select]
EXPORT Scroll(s)

BEGIN
LOCAL x:=100,y:=100;

DIMGROB_P(G1,640,480);  

FOR N:=1 TO 200 DO
RECT_P(G1,IP(RANDOM(640)),IP(RANDOM(480)),IP(RANDOM(640)),IP(RANDOM(480)),0,IP(RANDOM(255^3)));
END;

REPEAT
x:=MAX(MIN(x+ISKEYDOWN(8)-ISKEYDOWN(7),320),0);
y:=MAX(MIN(y+ISKEYDOWN(12)-ISKEYDOWN(2),240),0);
BLIT_P(G0,0,0,G1,x,y,320+x,240+y);
UNTIL ISKEYDOWN(4);

END;

Pages: [1]