Screen wobble SGDK sample

SGDK only sub forum

Moderator: Stef

Post Reply
Joe Musashi
Interested
Posts: 17
Joined: Sat Oct 13, 2018 10:08 pm

Screen wobble SGDK sample

Post by Joe Musashi » Wed Dec 30, 2020 6:30 pm

Hi,

I wanted to get a bit more used to the new SGDK 1.60 release, so I programmed a sample as an exercise. Something I always wanted to try on the Genesis is screen warping. To achieve this, the demo uses a horizontal interrupt handler which modifies the vertical scrolling settings each line. Included is also an on-screen menu, where you can change the parameters of the wave function that distorts the screen.

wobble.png
wobble.png (32.21 KiB) Viewed 9114 times

Binary and source are attached. If you want to compile the source yourself, simply define the $GDK environment variable so that it points to your SGDK folder and then run:

Code: Select all

cd wobble
make -f $GDK/makefile.gen 
Have Fun!
Attachments
wobble.src.zip
(53.46 KiB) Downloaded 360 times
wobble.bin.zip
(28.26 KiB) Downloaded 293 times

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Screen wobble SGDK sample

Post by Stef » Wed Dec 30, 2020 9:47 pm

The effect looks gorgeous ! well done !
And the settings menu is really nicely done too.
Can i eventually use it as default sample ? that is the kind of sample i always wanted to do but never spent time for that. Of course you will be credited for that :)
Also it's good that you made it for SGDK 1.6 as i modified the way the hint / vint callback handler to make it faster (less overload compared to previous SGDK) :)

danibus
Very interested
Posts: 135
Joined: Sat Feb 03, 2018 12:41 pm

Re: Screen wobble SGDK sample

Post by danibus » Thu Dec 31, 2020 12:43 am

Very nice example! Love it!
Is there any possibility to make this in horizontal instead vertical?

Joe Musashi
Interested
Posts: 17
Joined: Sat Oct 13, 2018 10:08 pm

Re: Screen wobble SGDK sample

Post by Joe Musashi » Thu Dec 31, 2020 6:42 pm

Stef wrote:
Wed Dec 30, 2020 9:47 pm
The effect looks gorgeous ! well done !
And the settings menu is really nicely done too.
Can i eventually use it as default sample ? that is the kind of sample i always wanted to do but never spent time for that. Of course you will be credited for that :)
Also it's good that you made it for SGDK 1.6 as i modified the way the hint / vint callback handler to make it faster (less overload compared to previous SGDK) :)
Thanks for the kind words!
Of course you can use it if you like, I'd love to see it as an SGDK default sample.

Speaking of hint callback :), I noticed that sys.h still defines

Code: Select all

extern VoidCallback *internalHIntCB;
even though it does not seem to be used anymore. It might be just a leftover, but I would like to ask if this is intentional and if there is any use to it?

Joe Musashi
Interested
Posts: 17
Joined: Sat Oct 13, 2018 10:08 pm

Re: Screen wobble SGDK sample

Post by Joe Musashi » Thu Dec 31, 2020 6:47 pm

danibus wrote:
Thu Dec 31, 2020 12:43 am
Very nice example! Love it!
Is there any possibility to make this in horizontal instead vertical?
Thanks!

It's possible to shift each line horizontally, but that would not warp (or scale) the line, just move it.
Thinking more of it, one could pre-compute some warping as tiles, and then repeat them (a bit like the flags in VectorMan). That might make a cool effect in a game :)

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Screen wobble SGDK sample

Post by Stef » Fri Jan 01, 2021 9:51 pm

Joe Musashi wrote:
Thu Dec 31, 2020 6:42 pm
Thanks for the kind words!
Of course you can use it if you like, I'd love to see it as an SGDK default sample.
Thanks ! i will probably add it soon then :D
I may eventually add some comments here and there (I saw you used low level sprite API for instance)
Speaking of hint callback :), I noticed that sys.h still defines

Code: Select all

extern VoidCallback *internalHIntCB;
even though it does not seem to be used anymore. It might be just a leftover, but I would like to ask if this is intentional and if there is any use to it?
Oh in fact it was renamed ! But to be honest i shouldn't had made directly accessible, and now you really need to use the setXintCallback(..) method in every case so i will remove the direct access to the variable :)

Post Reply