Remember me

Lost Password?

Register now!


Who's Online
80 user(s) are online (64 user(s) are browsing Forums)

Members: 0
Guests: 80


Support us!


ALS, a new graphics system
Quite a regular
2006/12/6 0:11
From Italy
Posts: 665
Recently I've been working on a new graphics engine.



"ALS" stands for "AMOS Layers System" (formerly "MLS" = "Multi-Layer System"), as it turns the screens of AMOS Professional ("AMOS" from now on) into layers that can be laid over one another, with complete control of order, colors and trasparency, while keeping them renderable as usual.
It is easy to use, does not require much knowledge of the Amiga graphics hardware, does not require installation or extensions, and comes as a set variables, arrays and procedures written in fully-commented AMOS code - it can be thought of as an AMOS source-level library.


· Layers usable as screens and vice versa
· Overlaying of multiple layers
· Overlaying order freely arrangeable
· Per-layer planes height
· Per-layer planes number
· Per-layer double-buffering
· Per-layer vertical positioning
· Per-layer colors
· Per-layer 257-degree opaqueness
· Per-color 257-degree opaqueness
· 24-bit internal colors
· LORES horizontal positioning of layers
· LORES and HIRES display resolutions
· Programmable display window size
· Automatic centering of display window
· Automatic adjustment to chipset (OCS/ECS/AGA)
· Automatic creation of layers from ILBM files
· Display descriptors
· Layer descriptors and snapshots
· Global snapshots
· Palettes management
· Banks management
· Basic file management


· Selectable video standard (NTSC/PAL) <ECS Agnus / AGA>
· Display border blanking <ECS Denise / AGA>


· Non-EHB 6-plane displays
· 24-bit display colors
· 24-bit palette colors
· SHRES display resolution
· SHRES horizontal positioning of layers
· 4x planes fetch mode


· Maximum number of visible planes / 1-plane layers:
· AGA: 8
· On OCS/ECS, EHB mandatory for 6-planes displays (display colors 32...63 equal to display colors 0...31 with halved brightness)
· On OCS/ECS, 12-bit display colors
· On OCS/ECS, 12-bit palette colors
· On OCS Agnus, video standard (NTSC/PAL) dictated by the hardware
· Limited horizontal positioning of display window
· Same width for all layers
· Same horizontal positioning for all layers


· Maximum number of in-use/ready-to-use layers: 8
· Maximum number of planes per layer: 6


· Most AMOS display/screen commands not allowed/possible
· Floppy drives not usable when the display is on.


In 2003 I wrote a Copper-based screen flipping effect for a developer who was making a game with AMOS. Eventually, the effect was not used (and the game was not made at all), but writing it gave birth to a whole bunch of ideas, which little by little brought to the creation of a small graphics system called XPF (Cross PlayField).
The development however, having started from an effect and having proceeded spontaneously, lacked the necessary rigour that a proper system requires, so I decided to rewrite everything from scratch and created CSS (Custom Screens System). That one turned out to be a clean, feature-rich system. It worked nicely and I even wrote a few tutorials for it.
But it didn't support sprites. While pondering on how to add them, I realized that actually the core design wasn't good enough, and that an alternative one would have allowed sprites and have been more efficient, too. Therefore, I wrote another system: AVS (Advanced Video System). When I was at about 80% of the development... I lost the sources. I can't remember how that happened, but for sure I couldn't recover them, so I remained only with the sources dating back to some days before, when some key additions had not been made yet. I was so angry that I hated the idea of reimplementing what had been lost, and that, coupled with the fact that I was about to move country, marked the end of the project.
The idea of rewriting an old game of mine using CSS - which was good enough for the purpose - kept on lingering in my head through the years. I kind of promised myself I'd do that sometime, as a smaller project between bigger ones. But, at the same time, I could never really accept the idea of using a non-optimal system, so a few times I considered completing AVS... only to drop the idea immediately: I just couldn't bother getting acquainted with that old code, maybe discovering that, after all, I'd do things differently once again.
Although I dedicated myself to many other projects, the ghosts of these systems kept on haunting me. In 2019 I presented CSS to the world with a video preview: it was an attempt between doing justice to the system (and thus hopefully make peace with it) and forcing myself to complete the work by exposing publicly the waste and the shame it represented. Since then, I made a new game (Blastaway), I continued the work on a game and released a preview of it (QUOD INIT EXIT IIo), I released two little updates for another game (MeMO), I prepared an update (still unreleased) for yet another game, I created two other graphics systems and made a demo (THE CURE) with one of them. But the ghosts were still there. Well - as they say - enough is enough and better later than never: the time to get rid of them came and I designed and implemented a new and proper system from the scratch - and so ALS was born.


ALS is almost complete - only one thing is still missing: unsurprisingly, sprites support*. Even the documentation is in place, so, in theory, it could be released already - yes, the plan is to make it available so that other developers can build games and other cool stuff on top of it. However, I'm not going that route because, firstly, I want to test the system thoroughly and, secondly, because it might be lacking in some department and I haven't realized that yet.
Therefore, I decided to develop one or two mini-games with it before releasing it: that will make for a proper test and give me the chance to make also the dream of pimping up an old game come true.

*Sprites are always left behind for one reason: with this system, it's natural to use all the bitplanes available to have as many layers and colors as possible; as a consequence, all the color registers are set automatically as needed by the layers; since the hardware assigns some of those registers to the sprites according to a very limiting scheme, it's very hard or even impossible to draw and arrange the sprites. The only practical solution is not using all the planes (at most 4 on OCS/ECS and 7 on AGA), but that reduces greatly the power and the beauty of layers, which defies the purpose of having layers in first place.
Anyway, implementing sprites is possible and I do intend to do it (a routine is already in place, actually).


Whenever a color, an alpha value, or the stack of the layers gets changed, it is necessary to recalculate all the colors starting from those relative to the first bitplane of the first layer affected (for example: on AGA, if all the bitplanes are used, layer 2 starts from the 5th bitplane and its alpha gets changed, all the colors from 16 to 255 must be recalculated). That is a CPU-intensive operation that AMOS struggles with, so it must be avoided as much as possible by not using dynamic changes or by precalculating palettes (ALS provides specific procedures for that). To give an idea: the video has been recorded using UAE, but on my Amiga 1200 equipped with a 68030 @ 50 MHz the same demo, compiled, slows down when the HUD layer fades in (the colors from 64 to 255 need to be recalculated).
Other than that, the system is quite lightweight.


Although assembly would make the routines dramatically faster, one amusing and motivational thing for me was precisely using AMOS only. Returning to AMOS and writing everything in such language after many years was fun and, additionally, it's just too cool to say: "Hey, this stuff is made in AMOS!"

Edited by saimo on 2020/10/15 13:40:17
Edited by saimo on 2020/10/15 13:41:03
Edited by saimo on 2020/10/15 14:48:15
Edited by saimo on 2020/10/19 10:34:16
Edited by saimo on 2020/10/19 12:47:33
   Report Go to top

Re: ALS, a new graphics system
Supreme Council
2006/11/16 19:25
From Sweden
Posts: 3199

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
   Report Go to top

Re: ALS, a new graphics system
Amigans Defender
2006/12/2 13:27
From Taranto, Italy
Posts: 931

fantastic mate. :)
maybe is time to go back to amos..

i'm really tired...
   Report Go to top

Re: ALS, a new graphics system
Quite a regular
2006/12/6 0:11
From Italy
Posts: 665



Thanks and LOL!


Update: implementation finished! Now it's time to do some testing and writing the second tutorial.

   Report Go to top

Re: ALS, a new graphics system
Quite a regular
2008/11/3 12:06
From South France
Posts: 763
nice work on Amos !

All we have to decide is what to do with the time that is given to us.
   Report Go to top

Re: ALS, a new graphics system
Quite a regular
2006/12/6 0:11
From Italy
Posts: 665

Thank you!



The implementation is complete and a new demo program has been written both to test ALS and to provide a practical programming example.

The demo initializes a 2-layer display:
* background layer: 4 planes, with opaque colors, for fixed graphics;
* foreground layer: 2 planes, with (partially) transparent colors, for bobs.
Then, it makes some 3-color ghosts bounce around on the foreground layer while changing cyclically their colors and opaqueness.
The effect could be achieved also without ALS by means of the Set Bob and Palette commands, but:
* all the planes (6) would be double-buffered instead of just the planes for layer 1 (2), thus wasting a lot of memory;
* rendering the bobs would be slightly more demanding (as the rendering code would have to consider 6 planes instead of 2);
* it would not be as easy and efficient to handle colors;
* more in general, it is more comfortable to have separate layers/screens to render to.

   Report Go to top

Re: ALS, a new graphics system
Quite a regular
2006/12/6 0:11
From Italy
Posts: 665
Last week I analyzed the code produced by the AMOS Professional Compiler and changed the ALS code in order to have the compiler output the most efficient code it is capable of. Contextually, I have also added a new little feature (palette segments), updated two demos and improved the documentation constantly.
This week I'm continuing the review of the documentation and constantly improving it. Once done, (hopefully) it will only be a matter of preparing a web page before ALS gets released.

   Report Go to top

Re: ALS, a new graphics system
Quite a regular
2006/12/6 0:11
From Italy
Posts: 665

Since last time, I improved/fixed a few things, revised greatly the documentation and updated the programs shown in the video. I also prepared the project web page: https://www.retream.com/ALS (redirects to https://retream.itch.io/als).
Currently I'm continuing to revise the documentation iteratively: when no more corrections are needed, ALS will be released - and I hope to make that happen this week.

   Report Go to top

[Advanced Search]

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project