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

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55913
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #60 on: August 15, 2013, 10:44:54 pm »
Try to keep NES, SNES and such emulators for later if you code one, though, because as soon as we got emulators on the Nspire, this pretty much killed game development on the platform D:
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;
Wow that looks really cool and fun to play! One suggestion, though, would be to add colors and make the sky black like in the original game. It's a color screen, after all. ;)

Also welcome here Gilles59!
« Last Edit: August 15, 2013, 10:45:11 pm by DJ Omnimaga »

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: HP-Prime prototype performance test: color graphic programs
« Reply #61 on: August 16, 2013, 01:28:10 am »
Welcome, Gilles ;)

Quote
Try to keep NES, SNES and such emulators for later if you code one, though, because as soon as we got emulators on the Nspire, this pretty much killed game development on the platform :(
Emulators do have their share of responsibility in the fact that native Nspire ports / brand-new games are relatively scarce, but I think that the very facts the platform is a closed one, and TI repeatedly actively fights developers, have an even greater responsibility :)

Emulators are not to blame for the unusually long time it took for porting Linux to the Nspire (on most platforms, porting Linux is a challenge which lasts several weeks or months - lack of such a port simply shows general lack of developer interest); TI's behaviour and the availability of platforms which are all of more open, more powerful and cheaper, are to blame.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55913
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Re: HP-Prime prototype performance test: color graphic programs
« Reply #62 on: August 16, 2013, 12:10:19 pm »
Yeah true, but the issue with HP and Casio is that their smaller market share will already have an impact on how many programmers venture into those calcs, so the effects would be as bad as with TI's actions against 3rd party ASM dev on the Nspire.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: HP-Prime prototype performance test: color graphic programs
« Reply #63 on: August 16, 2013, 05:48:43 pm »
I'll get this if it is <$150 and has C/Asm support. It looks like a great calculator and I'd love to see it with an SDL port.
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55913
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #64 on: August 16, 2013, 06:38:14 pm »
Sadly I think it will be the same price as the regular TI-Nspire D:

As for now it only has BASIC, but it's very fast. But yeah I bet people will try to hack it to get ASM/C running on it, then the community mission will be to prevent people from posting cheating tools on forums to avoid HP from blocking ASM support.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: HP-Prime prototype performance test: color graphic programs
« Reply #65 on: August 17, 2013, 01:35:15 am »
Quote
I'll get this if it is <$150 and has C/Asm support.
It's supposed to be around this price tag, but it has been made clear that it has no native code support either.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: HP-Prime prototype performance test: color graphic programs
« Reply #66 on: August 17, 2013, 09:31:49 am »
I was going to wait until the community found a way. We were also told the nspire wouldn't have native code and we have linux for it now. I have lots of hope that we will get native code support eventually.
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55913
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Re: HP-Prime prototype performance test: color graphic programs
« Reply #67 on: August 17, 2013, 12:02:42 pm »
With the Nspire it took 3 years, though. I hope it won't take as long with the Prime. With the Prizm at least, Assembly hacks arrived before the calc even came out

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: HP-Prime prototype performance test: color graphic programs
« Reply #68 on: August 17, 2013, 03:12:19 pm »
Hey Gilles59, that's some great looking stuff. :D Thanks for sharing, and welcome to Omnimaga.

Offline Gilles59

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +1/-0
    • View Profile
Re: HP-Prime prototype performance test: color graphic programs
« Reply #69 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
« Last Edit: August 19, 2013, 07:59:38 am by Gilles59 »

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: HP-Prime prototype performance test: color graphic programs
« Reply #70 on: August 19, 2013, 04:45:36 pm »
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... 

I've been thinking the same based on the demonstrations I've seen so far. :)

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55913
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #71 on: August 19, 2013, 06:31:28 pm »
I guess someone could always do some sprite/tile rotation to draw pre-rendered maps that rotates by 90° when turning around, like Brandish for the SNES. Heck, maybe even 45° would be possible if you know how to calculate the new tiles location.

Offline Gilles59

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

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55913
  • Rating: +3152/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: HP-Prime prototype performance test: color graphic programs
« Reply #73 on: August 20, 2013, 11:07:17 pm »
Wow that is great! If a game in particular was kept kinda simple (without too many tiles), someone could just pre-render each frame of the rotated tile, store them into GROB's then display them whenever needed. Of course since 20x15 tilemapping is a bit on the slow side too, it would probably be best to just use larger tiles and use maps such as 10x7 though.

Good job!

Offline Gilles59

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +1/-0
    • View Profile
Re: HP-Prime prototype performance test: color graphic programs
« Reply #74 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)
« Last Edit: August 21, 2013, 10:07:27 am by Gilles59 »