Author Topic: HP PPL Fade in/out effects (SNES style)  (Read 9263 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
HP PPL Fade in/out effects (SNES style)
« on: December 12, 2013, 03:28:46 am »
Here are some fade in/out effects for the HP Prime:



Here is the code I used to fade the screen to black with a pixelating effect like in SNES transitions:

Code: [Select]
DIMGROB_P(G3,320,240);
DIMGROB_P(G4,320,240);
BLIT_P(G4,G0);
FOR A FROM 2 TO 16 DO
BLIT_P(G3,0,0,320/A,240/A,G4,0,0,320,240);
FILLPOLY_P(G3,{{0,0},{320,0},{320,240},{0,240}}, #000000, 16*A);
BLIT_P(G0,0,0,320,240,G3,0,0,320/A,240/A);
END;

And the code I used to fade from black (after drawing something in GROB #4):

Code: [Select]
FOR A FROM 16 DOWNTO 2 DO
BLIT_P(G3,0,0,320/A,240/A,G4,0,0,320,240);
FILLPOLY_P(G3,{{0,0},{320,0},{320,240},{0,240}}, #000000, (16*A)-16);
BLIT_P(G0,0,0,320,240,G3,0,0,320/A,240/A);
END;

To fade to/from black (or any other color), you have to use the new FILLPOLY_P command, which supports alpha transparency. To fade out, you can also do the following:

Code: [Select]
FOR Z FROM 1 TO 29 DO
FILLPOLY_P({{0,0},{320,0},{320,240},{0,240}}, #000000, 9);
WAIT(1);
END;

Which is smaller, but won't let you fade in.


Before this new firmware came out, to fade out, you had to use the BITSR command then use the following code by Gilles59. It took 4 seconds to render each frame. With the polygon command, it's as fast as the screenshot demonstrates!

Given what I did with the Super Sonic Ball HP logo in the screenshot above, I bet that wavy transitions could be used as well if you want to, not to mention the good ol' TI-89 ASM games transitions when launching them.
« Last Edit: December 13, 2013, 05:11:57 pm by DJ Omnimaga »

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: HP PPL Fade in/out effects
« Reply #1 on: December 12, 2013, 04:07:17 am »
Nice, now can the sprites be rotated? You could easily impelment the Street GIfhter 2 SNES intro like this!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: HP PPL Fade in/out effects
« Reply #2 on: December 12, 2013, 10:11:30 am »
That's looking nice!

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline timwessman

  • LV3 Member (Next: 100)
  • ***
  • Posts: 94
  • Rating: +32/-0
    • View Profile
Re: HP PPL Fade in/out effects
« Reply #3 on: December 12, 2013, 11:59:04 am »
One other thing, you might want to take a look at the program I've attached.

Note, the "ICON" keyword will most likely be changing, as will the encoded data. One thing I am thinking about is to create a "resource" area that would contain binary data, not show up in the editor on calc (a list of names only, and ability to change the names), and could be called by name within a program. The intent would be that large objects (graphics, strings, etc) that don't really ever get edited would be storeable alongside the program file for use.

Anyway, you can now load PNG data directly as of the last update. And the little helper program is attached. Note that neither this one nor the first was made by me, but rather by cyrille (one of my coworkers). It is not endorsed or supported in any way by HP, but is given out as a help for interested parties.

The program I've stuck up here for download randomly plasters that png data across the screen as shown below.



« Last Edit: December 12, 2013, 12:03:48 pm by timwessman »
TW

Although I work for the HP calculator group, the comments and opinions I post here are my own.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: HP PPL Fade in/out effects
« Reply #4 on: December 12, 2013, 01:35:02 pm »
This is just crazy epic. O.O

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: HP PPL Fade in/out effects
« Reply #5 on: December 12, 2013, 05:39:54 pm »
Wow, PNG support seems nice! Is it smaller and faster than the standard format?

Offline timwessman

  • LV3 Member (Next: 100)
  • ***
  • Posts: 94
  • Rating: +32/-0
    • View Profile
Re: HP PPL Fade in/out effects
« Reply #6 on: December 12, 2013, 06:48:10 pm »
Yes, it will be smaller. Might be faster too. There is only a single copy of the PNG referenced.

I have no clue what it does with transparency though now that I think about it...
« Last Edit: December 12, 2013, 06:48:38 pm by timwessman »
TW

Although I work for the HP calculator group, the comments and opinions I post here are my own.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: HP PPL Fade in/out effects
« Reply #7 on: December 12, 2013, 07:12:03 pm »
Are 8 bit PNGs supported?

Offline MacBernick

  • LV3 Member (Next: 100)
  • ***
  • Posts: 93
  • Rating: +3/-0
    • View Profile
Re: HP PPL Fade in/out effects
« Reply #8 on: December 12, 2013, 08:23:08 pm »
I did some tests, looks like 8 bits is supported, but transparency is lost somewhere, either in DIMGROBHelper or in blit operation.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: HP PPL Fade in/out effects
« Reply #9 on: December 12, 2013, 09:16:36 pm »
Ok but in such case, would we still be able to specify atransparent color at the end of the BLIT_P command?

Offline MacBernick

  • LV3 Member (Next: 100)
  • ***
  • Posts: 93
  • Rating: +3/-0
    • View Profile
Re: HP PPL Fade in/out effects
« Reply #10 on: December 12, 2013, 09:30:05 pm »
Yes that's still working.

I'll try tomorrow maybe to import a PNG without DIMGROBHelper to check if it solves transparency issues.
« Last Edit: December 12, 2013, 09:45:24 pm by MacBernick »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: HP PPL Fade in/out effects
« Reply #11 on: December 12, 2013, 10:44:02 pm »
Ok that's good.

One of my main concern is that I tend to not like to split my HP Prime games into too many files, because it makes it harder for the connectivity kit to detect my entire calc content in a reasonable amount of time. I usually prefer to keep my games into one single file or two unless it's impossible for any reason. However, if this can greatly reduce the size of one of my program (for example, my pseudo 3D tilemap demo is over 400 KB large) I might not mind.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: HP PPL Fade in/out effects
« Reply #12 on: December 13, 2013, 11:51:17 am »
That's pretty cool ^_^

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline SpiroH

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +153/-23
    • View Profile
Re: HP PPL Fade in/out effects
« Reply #13 on: December 13, 2013, 04:40:46 pm »
I like it, it looks cool to me! I would give a bit more emphasis to the fading process by slowing down the unrolling and rolling up.
Spoiler For Spoiler:
mockup (with your permission):


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: HP PPL Fade in/out effects
« Reply #14 on: December 13, 2013, 05:08:14 pm »
Yeah I plan to use such slower fading effect in the future, but probably not for transition between regular screens. Else, people will get annoyed due to the longer wait. I was mainly thinking about RPG cutscene or intro endings where it transitions into a different cutscene located elsewhere or a different chapter in the game. It would also work for when you load a saved game. I think it was pretty common in old SNES RPGs like Final Fantasy. For transitions between two linked maps, however, usually only the fade out effect without the pixelating occurs, else when pixelating is used, there's no fade-out and instead they use a black frame that shrinks down towards the middle of the screen.

What I also saw used as special effects in SNES RPGs is when your main character is feeling dizzy, the screen suddenly gets pixelated twice in a row, to make it look like you are fainting and have vision troubles. Then there's of course the battle transitions.
« Last Edit: December 13, 2013, 05:11:10 pm by DJ Omnimaga »