DEMOSCENEDEMOS ★ ACU DEMO (AMSTRAD COMPUTER USER) ★

ACU Demo (Amstrad Computer User)Demoscene Demos
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

THE DEMO COLUMN

ChaRleyTroniC of Conspiracy explains the art of useless programming.

I his is 1992-the year of Europe. We are now closely linked with the French, the Germans, the Dutch and the Danes in all walks of life.Well, not quite; go over to the Continent and have a look at some CPC programs.You might see all 26 colours and three modes on screen at once, really smooth movement, great music...

What the Continentals know is how to write demos. Demos are not just boring clips from the latest beat-em-up, which certain magazines fill up their cover tapes with.No, real demos have great graphics, animation and sound, and have twro purposes: to show how clever the programmer is, and to show how good the CPC is.

So, if you want to annoy that smartalec ST owner next door-and ST owners have been known to be jealous at the sight of CPC demos-then read on.

You can either write demos all on your own, or as part of a team.The team approach is often useful as you can have a good coder, an artist and a musician all working at once. Some of the most well-known teams in Europe include Logon System (probably the best team around) from France, Cad jo Clan from Germany, Unix (from all over Europe), and GPA (from France and Germany).In Britain, the only two "demogroups" at the moment are Conspiracy and the Bitmap Vandals.

Not only do the groups have names, but also each member.For example, Logon System has 11 members with names like Longshot, Fefesse and Fred Crazy. Cadjo Clan is made up of Thriller and Weee!, and Conspiracy includes Hangman, Wild Thang, LDC, Pixel and CRTC-me!Think of a silly name and you're well away.

Some people ask:"Are demos PD?." As they are written to show off to as wide a public as possible, this is certainly true. However, quite a lot of CPC demos have music hacked from games in them. This means that, even though they are made to be copied, your favourite PD library cannot legally give you a copy.

First of all, the bad news. You will have to write in machine code, (cue sound of page turning across Britain). However, with this series combined with Doc Watson's assembly tutorial, you shouldn't find it too difficult. lt  is a mistake to think that machine code is only understood by really clever programmers.After all, Bridge-It was written in machine code...

Before you start programming, have some idea of what your demo is going to be like.The hardest part is having the ideas for the demo:a demo will look that much more impressive if it has something original in it.A simple demo will have a smooth scrolling message across the bottom (which usually contains greetings to other demo-writers), a picture and some music playing. More advanced demos will have moving sprites, extra "scrollies", different modes on screen, rasters (which are shaded colour bars on the screen, often spinning or moving about, with as many colours as you like in them!), a moving starfield, perhaps a music power meter, like on a stereo, and even "overscan"-the whole screen is used, without any border. By the end of this series, you'll know how to do all of this-but don't get too ambitious at first..

So how are demos programmed?The most important thing is to synchronise your program to "frame flyback".TVs and monitors work at 50Hz-that is to say, a new image is displayed on the screen every 50th of a second .To achieve good-looking graphics, your demo should work at the same rate, changing the screen at this rate.

By a simple CALL-the infamous CALL &BD19-your CPC will wait until frame flyback is met. Frame flyback occurs every 50th of a second, and is the time when the electron beam has finished "drawing" the image on your monitor, and is "flying back" from the bottom to the top of the frame. Now, by putting a simple timing loop after this, you can synchronise your code to execute when the electron beam is at any point on the screen.

But what is the use of this?Earlier, I mentioned rasters, bars of different colours. These are programmed by waiting until the electron beam is at the start of the screen line, changing, say, the background ink to dark blue, waiting until the electron beam is at the start of the next line, changing the ink to a brighter shade of blue, and so on. In this way, you can easily get all 26 colours on screen at once!

You can probably see how this system could be extended to having different modes on the screen. If, when the electron beam is at a certain point, you change the mode, there is no reason why you can't have all three modes on the screen at once. However, you can't use the firmware. Instead, you need to go straight into the hardware and the Video gate Array chip which, fortunately, on the Amstrad, is not too difficult to do.

Scrolling messages are easy to program, too. For example, say that you wanted a message scrolling across the bottom line of the screen, left to right as usual. Every frame flyback, you would move the whole of the bottom line left by one character-using the Z80's LDIR memory copy instruction-and print a character at the bottom right.

Try this in mode 1 and you'll find that the message is much too fast to read. To slow it down then, you could move the bottom line left by only half a character (i.e.one byte) and print a character every other frame flyback. This sort of experimentation is vital in demo programming, for example, when you are trying to get the timing EXACTLY right with a raster routine. To obtain perfect raster timing, you will need precision to around 1/40,000th of a second:fortunately, it is not as difficult as it sounds.

One of the hardest parts of writing a demo is the music.90% of demo writers do not bother with coding their own music, after all, good musicians are rare on the CPC. Instead, they rip it out of a game or, even easier, another demo. Apart from being illegal, this leads to boring music. The number of demos with David Whittaker's Glider Rider music in is quite astounding!To save you the bother of coding your own music routines, you could use a music creation system: Ubisoft's Equinoxe is ideal for creating muse for demos, but I hear another package in a similar vein-with more flexibility promised-is in development at the moment. When music is covered later in this series, there will be full details on which is the best choice for your demos.

One clever music-related effect is to have a power meter, like you find on many stereo systems. As the Amstrad has three channels of sound, you could have three separate meters, one for each channel.To do this, you need to access the sound chip and ask it for the current volume of each channel-then draw your meter accordingly.lt is even possible to hook up a little animation to this-how about a drummer who hits the drum each time a volume above 5, for example, is sensed on your drumbeat channel?

Using this information, you should be able to plan a simple demo. Don't go too overboard at first:most demo writers' first efforts are pretty basic. Nobody expects a breakthrough in CPC programming from a first demo but, with practice, you can expect to see your demos improve until, one day, you are writing demos as good as most of those from Europe-and it doesn't take long!

Sorry to those few people who know about demos already, but this month's article has, by necessity, been a bit general, to explain what demos are and how they work. Starting next month, there will be practical examples of how to code specific parts of a demo, beginning with scrolling messages.

In the meantime, there is a simple demo for you this month, complete with rasters and scrolling messages. The actual code for this, excluding the "scroll-text" and the colour data for the rasters, is only about 1 /4k long. When you think how long an average BASIC program is, let alone a commercial game or utility, you'll see that impressive results can be achieved with only a small program.If you are feeling really brave, you might like to try and work out how the demo works!

If you have any questions about demo programming, then write to this column c/o ACU. The address is: CRTC's Demo Column, ACU, Sunnyside Cottage, Carluddon, St.Austell, Cornwall PL26 8TY.I would also be enthusiastic to receive any demos you have written yourself... fa me throughout Europe, with ACU's help, could be only a few k of code away!

Amstrad User April 1992

★ PUBLISHER: Amstrad Computer User
★ YEAR: 1992
★ CRTC: ???
★ CONFIG: ???
★ EFFETS: SCROLL TEXT , SPLIT RASTER , RASTERS
★ AUTHOR: CHARLEYTRONIC (CRTC)
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Dump disquette:
» CRTC  s  Demo  Column    (Amstrad  Computer  User)    ENGLISHDATE: 2023-12-03
DL: 269
TYPE: ZIP
SiZE: 4Ko
NOTE: 40 tracks
.HFE: Χ
.DSK: √

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Demoscene » Robot Demo
» Demoscene » Hypnosys Demo
» Demoscene » The Cookie 2017
» Demoscene » Fres Fighter 2 Turbo Musics (Tom et Jerry/GPA)
» Demoscene » Germaine se déchaine
» Demoscene » Sound-Sampler v1.0
Je participe au site:
» Vous avez des infos personnel ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 330 millisecondes et consultée 1561 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.