Enterprise Forever

:UK => Programming => Topic started by: ssr86 on 2015.March.14. 22:54:35

Title: fun with margins
Post by: ssr86 on 2015.March.14. 22:54:35
Here are a few screen-transition effects obtained by modifying values of margins and line pointer of each modeline. The examples work in 160x144 16-c square pixel "mode" but the code works for all screens (I think) with more than one modeline for display block...

First "screen swipe":

tsweep0
[attach=5]
- moving screen
- fixed left margin increments (+-1)

tsweep1:
[attach=6]
- static screen
- fixed margin increments (+-1)

tsweep2
[attach=7]
- moving screen
- "random" left margin increments (+-1)

tsweep3:
[attach=8]
- static screen
- "random" margin increments (+-1)

Don't know if anyone is interested in the code but I'm posting it anyway...

Controls: joy left/right

front.asm and back.asm are the images used for background graphics...
Title: Re: fun with margins
Post by: ssr86 on 2015.March.14. 23:08:51
Second: "movable and resizable square"

tsquarem
[attach=1]
- an animated "demo"

tsquarer
[attach=3]
- you move and resize with joystick (no animation)

Controls:
- you can move the visible square area with the joystick
- joystick fire+up/down changes the size of the visible square (won't really work with the animated one)
Title: Re: fun with margins
Post by: ssr86 on 2015.March.14. 23:13:56
Third: "movable and resizable circular shape"

tcirclem
[attach=1]
tcircler
[attach=3]
the same as tsquare but with circular shape(although the shape seems a little off...)

The sources aren't commented and may be a bit messy...sorry for that
Title: Re: fun with margins
Post by: ssr86 on 2015.March.14. 23:29:53
All presented effects can be used as in-game screen transition animations. The more modelines your lpt display block uses the better the effect can look...
These margin-effects don't require changes to graphic data - only lpt is modified.

Any convex shape should be obtainable (not only rectangle/square or circle/ellipse)... So for example a cross, a diamond or a hexagon..

There are some glitches when you resize the shape after moving the center of the square/circle near the left or right screen boundary... I haven't secured all bad cases it seems...
Title: Re: fun with margins
Post by: Zozosoft on 2015.March.15. 07:02:21
Amazing! :smt038 :smt038 :smt038
Title: Re: fun with margins
Post by: CiH on 2015.March.15. 21:46:33
Agreed, is amazing.

Full demo, or even a nice 4ktro sometime, pretty please ;-)
Title: Re: fun with margins
Post by: ssr86 on 2015.March.16. 01:49:51
Yeah, these effects look quite good but the best is that they're quite cheap (about 0.5-1.0 frame)  and don't corrupt the screen buffers so can be used in games. Not much additional memory needed - only the routine and one 256-byte lut. The code is not optimized (the circle one the most).

Here are two more variations:

tsweep4:
[attach=1]
- a "noise" animation of screen ends using "random" increments/decrements

tsweep5:
[attach=3]
- "random" margin increments/decrements (both margins)
- static screen
- move joystick left and right to animate

tsweep5 could be changed to use fixed increments/decrements
Title: Re: fun with margins
Post by: ssr86 on 2015.March.16. 02:40:41
...and one more:

tsweep6
- "random"changes of margins
- background is static
- screen disappears at the right side and appears from the left side (previously was right/right)
Title: Re: fun with margins
Post by: szipucsu on 2015.March.16. 20:00:31
...and one more:
Awesome!
Title: Re: fun with margins
Post by: geco on 2015.March.17. 20:45:03
Cool, CiH has right, you could make a small demo with these effects, even in higher resolution, as I saw not all effects could be used if 1 LPB is one vertical line in this form, but I am sure you could do it also.
Ex on an Attribute screen these effects should be more powerful :) ( in this case 4K demo is out of scope :D )