Author Topic: HP-Prime prototype performance test: color graphic programs  (Read 20105 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55876
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #45 on: August 13, 2013, 05:56:28 pm »
By the way, Deeph's converter doesn't appear to do sprites larger than 16x16, so to convert multiple images, you might have to convert them separately then merge the sprite data.

Otherwise, if you try to convert, for example, a sprite sheet that is 144x96, all you'll get is 16x16 worth of data. For example, the following image gave the following code:



Code: [Select]
{ #839B839B839B839B:64, #010001000100839B:64, #839B010001000100:64, #839B839B839B839B:64, #839B839B839B839B:64, #7DE17DE17DE10100:64, #01007DE17DE17DE1:64, #839B839B839B839B:64, #0100839B839B839B:64, #7DE17DE17DE17DE1:64, #7DE17DE17DE17DE1:64, #839B839B839B0100:64, #0100839B839B839B:64, #01007DE17DE17DE1:64, #7DE17DE17DE10100:64, #839B839B839B0100:64, #01000100839B839B:64, #010001007DE17DE1:64, #7DE17DE101000100:64, #839B839B01000100:64, #01000100839B839B:64, #7DE17DE101000100:64, #010001007DE17DE1:64, #839B839B01000100:64, #01007F6A0100839B:64, #7F6A7F6A7F6A7F6A:64, #7F6A7F6A7F6A7F6A:64, #839B01007F6A0100:64, #7F6A7F6A0100839B:64, #7F6A01007F6A7F6A:64, #7F6A7F6A01007F6A:64, #839B01007F6A7F6A:64, #01000100839B839B:64, #7F6A01007F6A7F6A:64, #7F6A7F6A01007F6A:64, #839B839B01000100:64, #0100839B839B839B:64, #7DE17F6A7F6A0100:64, #01007F6A7F6A7DE1:64, #839B839B839B0100:64, #01000100839B839B:64, #010001007DE17F6A:64, #7F6A7DE101000100:64, #839B839B01000100:64, #7F6A7F6A0100839B:64, #7DE17F6A7F6A0100:64, #01007F6A7F6A7DE1:64, #839B01007F6A7F6A:64, #7F6A7F6A0100839B:64, #7F6A7DE17DE10100:64, #01007DE17DE17F6A:64, #839B01007F6A7F6A:64, #01000100839B839B:64, #0100010001000100:64, #0100010001000100:64, #839B839B01000100:64, #0100839B839B839B:64, #010001007DE17DE1:64, #7DE17DE101000100:64, #839B839B839B0100:64, #839B839B839B839B:64, #839B010001000100:64, #010001000100839B:64, #839B839B839B839B:64 }
Using Jim Bauwens' converter, the code didn't even fit in one post lol.
« Last Edit: August 13, 2013, 05:58:59 pm by DJ Omnimaga »

Offline deeph

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 138
  • Rating: +6/-0
    • View Profile
    • deeph.servhome.org
Re: HP-Prime prototype performance test: color graphic programs
« Reply #46 on: August 13, 2013, 06:22:15 pm »
It works fine here, with your image I get ~70kb of data (which seems too much for the prime to draw).

How did you use it ?

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55876
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #47 on: August 13, 2013, 06:39:55 pm »
I drag-dropped the image above into your batch file.

By the way I created a new topic to continue this sprite converter/compression discussion, so that it's in the HP Prime section and not lost later in news. http://ourl.ca/19398
« Last Edit: August 13, 2013, 06:41:48 pm by DJ Omnimaga »

Offline deeph

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 138
  • Rating: +6/-0
    • View Profile
    • deeph.servhome.org
Re: HP-Prime prototype performance test: color graphic programs
« Reply #48 on: August 13, 2013, 06:42:17 pm »
The batch file is just an example of how to use it inline (it only converts sprite.png), you have to drop your image on img2prime.exe (I know it's a bit confusing)...

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55876
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #49 on: August 13, 2013, 06:42:56 pm »
Oh ok lol, my bad.

Offline deeph

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 138
  • Rating: +6/-0
    • View Profile
    • deeph.servhome.org
Re: HP-Prime prototype performance test: color graphic programs
« Reply #50 on: August 13, 2013, 06:51:01 pm »
Looks like there are some colors messed up in some cases, I'll have to fix that tomorow :o

And I'll certainly remove the spaces between the values because it increases the program size uselessly.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55876
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #51 on: August 13, 2013, 06:59:56 pm »
Yeah true. That said, if someone prefers his sprites to be in a format where it shows each column in separate lines for readability, it's good, but since the screen has no word wrapping, I feel it's better to keep them in one line. It takes much less time to scroll through the code lol.

Hopefully, if one day there is ASM support on the Prime, maybe someone could write a program that compresses BASIC programs that don't contain special chars into ASCII and that decompresses them back into Unicode when you try to run them, so they would take less space.

Offline deeph

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 138
  • Rating: +6/-0
    • View Profile
    • deeph.servhome.org
Re: HP-Prime prototype performance test: color graphic programs
« Reply #52 on: August 13, 2013, 07:29:24 pm »
Ok I've debugged my program, now it works perfectly :)



img2prime.zip

bb010g > can you recompile it for linux ?

Also, you can now throw as many images as you want on it.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55876
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #53 on: August 13, 2013, 10:38:04 pm »
Nice :D. It appears a little distorted in your program, but I guess just some minor BLIT dimensions adjusting would fix the problem.

Btw does programs written in English mode work on French mode or vice-versa? I remember that on the TI-89 it wasn't the case.

Offline bb010g

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 428
  • Rating: +22/-1
  • I do stuff
    • View Profile
    • elsewhere on the net
Re: HP-Prime prototype performance test: color graphic programs
« Reply #54 on: August 14, 2013, 01:36:18 am »
Ok I've debugged my program, now it works perfectly :)

(image)

img2prime.zip

bb010g > can you recompile it for linux ?

Also, you can now throw as many images as you want on it.

I'm planning to have a program to do sprites with RECTs by Thursday, but for now:
http://db.tt/9PLl5hL8
Arch Linux user
Haskell newbie | Warming up to Lua | Being dragged into C++
Calculators: HP 50g, HP 35s, Casio Prizm, TI-Nspire CX CAS, HP 28s, HP Prime, Mathematica 9 (if that counts)
π: 3.14...; l: 108; i: 105; e: 101; l+i+e: 314
THE CAKE IS A LIE IS A PIE

Offline deeph

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 138
  • Rating: +6/-0
    • View Profile
    • deeph.servhome.org
Re: HP-Prime prototype performance test: color graphic programs
« Reply #55 on: August 14, 2013, 04:44:10 am »
Btw does programs written in English mode work on French mode or vice-versa? I remember that on the TI-89 it wasn't the case.
Yes, the functions names aren't translated since I think it's not tokenized so there are no problems of compatibility (luckily).

I'm planning to have a program to do sprites with RECTs by Thursday
Is that really more optimised than with GROBs ?

edit : I've optimised a bit more the converter, now when he finds "#0000000000000000:64" (black) it only writes "#0:64".

The download link is the same ( http://www.mirari.fr/mjJj ), but bb010g, can you recompile it again ? Sorry :-[
« Last Edit: August 14, 2013, 05:03:52 am by deeph »

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55876
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #56 on: August 14, 2013, 05:52:45 pm »
Thanks for the update :)

Also I saw the video at
and I'm betting that parallax scrolling might be possible or at least displaying multiple sprites on the screen.


EDIT: Fixed link
« Last Edit: August 14, 2013, 06:00:02 pm by DJ Omnimaga »

Offline Gilles59

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +1/-0
    • View Profile
Re: HP-Prime prototype performance test: color graphic programs
« Reply #57 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;
« Last Edit: August 15, 2013, 05:32:02 pm by Gilles59 »

Offline deeph

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 138
  • Rating: +6/-0
    • View Profile
    • deeph.servhome.org
Re: HP-Prime prototype performance test: color graphic programs
« Reply #58 on: August 15, 2013, 05:52:28 pm »
Wow this is impressive. HP really made a great work with its Basic :thumbsup:

I wasn't sure if I should buy a 84+CSE knowing it is so slow (they simply should have put an eZ80 at 50 MHz on it  ::)), but I'll surely get one of this. At least even if we don't have the possibility to execute ASM/C code on it for some time it still looks like a great plateforme for programing :)

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 816
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: HP-Prime prototype performance test: color graphic programs
« Reply #59 on: August 15, 2013, 08:08:57 pm »
It does look like a nice platform for programming, but i'd only get it for ASM/C programming ;) Everything so far has impressed me, though. Congrats, HP!