* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Prime PPL animated graphics question  (Read 2010 times)

0 Members and 1 Guest are viewing this topic.

Offline Peyrol

  • New User
  • Join Date: Jan 2015
  • Location:
  • Posts: 3
  • Post Rating Ratio: +0/-0
Prime PPL animated graphics question
« on: January 13, 2015, 02:57:41 am »
First, I am grateful this forum exists.

I am considering purchase of a Prime. One big reason to buy is so I can develop animated graphics programs. I looked at the HP Prime user guide, and it mentions 10 GRaphics OBjects, with G0 apparently always set as the screen display. This is a little confusing to me. I am used to the concept of double buffering, where the screen display can shift from one graphics object to another, so that changes applied to the entire screen will appear all at once as we update from one frame to the next. But I watch the Prime "Programming Tribute Video" and see lots of cool animations, so there must be a way to quickly update each new screen. How is it done? Any clue would be appreciated. TIA



Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18795
  • Post Rating Ratio: +98/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Prime PPL animated graphics question
« Reply #1 on: January 13, 2015, 03:34:49 am »
Hiya and welcome here. :D Congratulations: You found a calculator that can do it very easily and fast without much external assistance. :D (although beware of some OS bugs).

Basically, the G0 to G9 graphical objects let you do double-buffering like you see fit and with 10 objects total, you could even do tentuple-buffering :D.


As for screen update speed the reason why it's done so fast in the video is because the calculator's built-in language, HP PPL, is that fast. It can surprise people who are used to HP 50g or even TI-BASIC speed (which can still do very decent stuff), but yeah, you can basically make action games on this platform.

How it's done is another story, though, because it would take me a while to explain and I am a bit busy for that :P. There are probably some tutorials and documentation online on how to use DIMGROB_P and BLIT_P commands, as well as that one tool to convert image files to HP Prime PNG format. But basically, DIMGROB_P is the command to setup a graphical object. That object can be any size, so you could easily store several dozens of screens into one (although I usually recommend working with small GROB's such as 336x256 since the calculator can get a bit unstable otherwise), while you could easily just use a tiny GROB to store a few 16x16 icons/sprites.

The BLIT_P command lets you copy a part of a GROB variable (G0 being the screen itself) or part of PNG image data into another GROB of your choice. You can even scale the graphical chunks up or down, although that slows things down.

Here is an example program demonstrating how you can use BLIT_P and DIMGROB_P commands: http://codewalr.us/index.php?topic=124.0 . If you ever figure out how to just shift the screen and only draw the missing rows of tiles to speed things up, then you could write a Mario game. Or you could add some frame skipping to the mix and do Sonic. It's best to start smaller, though :P

Also, as an advice: If your calculator ever freezes or acts erratically, the ON+SYMB key combo is your friend. It will reboot the calc but you should not lose your programs (backup often, though, like with any other platform!) :)
« Last Edit: January 13, 2015, 03:38:41 am by DJ Omnimaga »
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline Peyrol

  • New User
  • Join Date: Jan 2015
  • Location:
  • Posts: 3
  • Post Rating Ratio: +0/-0
Re: Prime PPL animated graphics question
« Reply #2 on: January 13, 2015, 01:26:26 pm »
Wow that looks super easy. So, whenever you execute a BLIT_P command with G0 as the destination, the screen will refresh, is that right? What sort of frame rate is that on your demo, looks like around 20 fps?
Thank you so much!

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18795
  • Post Rating Ratio: +98/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Prime PPL animated graphics question
« Reply #3 on: January 13, 2015, 07:47:59 pm »
It will update the screen area that you specified. If you use G1 instead, then it will update the specified area of that GROB. As for frame rate it depends of how complex the program is, but the star animation above is around 15 FPS. It would be much faster if I pre-rendered everything before runtime then scrolled one massive 320x240 GROB around. The calculator screen is about 52 Hz if I remember, so if a program runs much faster than 52 FPS it will start skipping some frames.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline Peyrol

  • New User
  • Join Date: Jan 2015
  • Location:
  • Posts: 3
  • Post Rating Ratio: +0/-0
Re: Prime PPL animated graphics question
« Reply #4 on: January 14, 2015, 02:38:53 am »
That's great news. I hope to afford a Prime soon. Thanks so much.

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18795
  • Post Rating Ratio: +98/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Prime PPL animated graphics question
« Reply #5 on: January 14, 2015, 02:53:36 am »
Aah I thought you already had the calculator. I hope you get one soon too. In the meantime, you can try it in the emulator that is freely available, although keep in mind it runs much faster than the real calculator (all video screenshots were slowed down to match real hardware speed)
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games