Amiga
Demomaking - Story of a coder in 100 steps - Part 2 / x This is the second part of the whole story. Go HERE to read Part 1.
Step14: Bitplanes are evil In today hardware, one pixel is often coded on a byte (or serie of bytes). For example on Nintendo DS, you can use 256 colors mode. Each pixel is coded on one byte (value 0 to 255). That value correspond to one color into a palette (color table). That is quite simple. Amiga 500 (and Atari ST) had a different way of working. The Amiga 500 can display 32 colors. For coding 32 values, you need 5 bits. Sadly a computer use one byte (8 bits) as unit value. I guess there engineers imagined a new system to avoid loosing 3 bits one each pixel byte. The 5 bits have been divided into "planes". One plane for each bit. That give "bitplanes". Here is a drawing of the system: This is for Atari ST but works the same way on Amiga. Look at the pixel in the middle of the screen (the four small green points). To encoded a 4 bits (value 0 to 15 in color table), each bit have been put into one Bitplane. (Figure taken from that website)
Here is a sample of art, divided into bitplanes: You can see three different planes (each is only 1 bit). Total number of color is 8 once the three bitplanes are superposed. This is the result: (with a 8 color table of course) The drawback of that method is that one pixel can not easily be moved or copied. For changing one pixel, you have to change 1 bit on each bitplane. If you want to copy a full set of pixel, you usually have to do multiple copy, for each bitplanes. Some tricks have been found over years to transfer a multiple planes in one blitter transfer (using modulos).
Step15: HAWK Mega demo - August 1990 Johnny-B and I worked almost during one year to create this production. We acheived something huge for us: A complete mega demo. A
"mega demo" is a collection of chained demos. In this case the exact
name is "Trackmo". That means the demos are launched directly from the
tracks of the floppy disks.
The
demo is divided into 4 parts, with intermediates parts (executed while
loading and uncrunching demos, these are called "loaders"). The name of that production is : "Flight over Fight". The amiga disk can be found here: Hawk_1990_Megademo_FlightOverFlight_1MoVersion.adf 1Mb of memory required to run this demo. See folowing link for 512Kb version. Hawk_1990_MegaDemo_512KoVersion.adf Here is the full demo video: Sadly the WinUAE emulator is not perfect. The winter demo is not emulated very well. Here is a video on a real Amiga 500. The full source and data are here: Demo_HawkMegaDemo.zip Part 1: First part isterminator based on "Terminator" movie. We reproduced the opening title sequence. Arts: The big letters are drawn using small parts of 16x16. You can see after the decomposition of the "tiles" and one result letter. the "tiles" Sample of a letter I remember that we checked the video on philippe VCR. There was no internet and no DVD at that time :) The color gradient is done via the copper list. Source code: Here is the source code: PartI.s There is a nice header in this one: ; ********************************************************************** In a general way, I wrote better source code. I added some separators and the code is cleaner that my first demo. Here is the demo text: HAWK PICTURES LTD (That's a nice name :) ) Musics: Johnny B reprocuded the Terminator music. You can get the module HERE. 128 Ko. I like this one.Part 2: Second part featured a remix of Prince "BatDance". Here is the original video clip: Arts: The batman logo
done by Johnney-B is really great. Source code: Source code is here: PartII.S I remember working on the rasters animation
while beeing in holidays at my grandma house. It took me some time to
get the correct motion. (a "raster" is usually moving colored
horizontal bars). Ther bars are going backward in a kind of "3D"
effect. As I had no idea of how to do "3D", this is big tricks. The music replay routine have been changed to
detect when the note are played and flashes the two logos. Variables of
replay routine are directly used (named "MT_***").The code for this is: EQUA: Music: The music is also nice. He sampled
parts of the batdance and recreate the song under soundtracker in only 368 kb !. Download the module HERE. Part 3: "Shadow-of-the-beast" like scrolling. The musics and graphs were still very good.
Arts: The arts may be inspired from "Unreal"
video game. The trees looks the same as in "Unreal" (but Johnny B
redrawn them from screenshots I guess. There are not the same). You can
see lot of great artworks from that game on the Frank Sauer page:
Source code: Source code is here: PartIII.s To create scrolling on Amiga it was very
simple. You only have to use the video pointer and change the value
(video pointer is 16 pixels accurate, decay register is 0 to 16 pixels.
Using both, you can create a one pixel scrolling). Using video pointers
is free for the main cpu. The whole scrollings in the winter demo is
using no CPU at all. The video pointers are inside the copper list,
which is very easy for synchronisation with the display. This source code is the longuest I'd ever wrote. It is about 96Kb. The copper list is big because of all parallax scrolling. At the beginning, you can see some snowflakes falling down. The farer small disappear when going behind the trees. The logo at the end, is displayed using the "Extra half bright"
mode. This special mode required a 6 bitplane to be setup. The total
color is 64 (32 colors, and 32 others colors that are "half bright" of
the first 32 colors). The amiga hardware have a limitation of 32 color
register. This mode allow 64 colors to be displayed. You can see it in
the demo with the "Hawk / Amazing world of creation" bouncing logo. In the source code, you can also see the usage of a macro: Here are the full scrolltexts: ------------------ ------------------ THE AMAZING WORLD
OF CREATIONS !!!!!!!!! HERE THE NEW VERSION OF THE HAWK
MEGA DEMO. IT'S NOW WORKING ON 512K AMIGA AND ALL BUGS HAVE BEEN
REMOVED. FOR THOSE WHO WEREN'T AT THE CYCLONE PARTY .I JUST WANT TO SAY
THAT IT WAS COOL AND THAT WE WON THE DEMO COMPETITION ... NOW REMENBER
THE DATE OF THE 20/9/89 ... IT WAS NOT THE CREATION OF THE
NEW ATARI STE ( BEURK ), BUT THE FIRST HAWK DEMO WHICH WAS AT
LEAST FINISHED. AT THIS TIME, TWO MEN DECIDED TO CREAT A GROUP . HOPE
WE WILL HAVE FUN FOR A LONG LONG TIME. BUT FOR THOSE WHO KNOW OUR FIRST
DEMO WE MUST TELL YOU THE END OF THE DUEL BETWEEN THE THREE MEN
AND MACHINE. BUT WE STILL DON'T KNOW FOR THE SIMPLE REASON THAT THE
AMIGA WON AND DECIDED TO KEEP THE SOURCE !!!! ( HEUU BEN
ALORS ON SAIT ? POUF... TA GUELLE JOHNNY-B C'EST POUR L'EXPORTATION ).
BUT NO MORE BORING HISTORY LESSONS. LET'S SPEAK ABOUT THIS MEGA
DEMO. AS YOU COULD HAVE NOTICED OUR FIRST PREOCUPATION WAS ------------------ HERE ARE THE
GREETINGS YOU'VE BEEN WAITING.............. FIRST GIGAGREETINGS MUST
FLY TO: SKYWALKER ( THANK FOR YOUR HELP MY BROTHER. YOUR
LAST PRODUCTION IS VERY COOL. HOPE TO SEE YOU SOON.) INTOX
(THE MEGA SWAPPER. WAITING FOR YOUR GIGA-HYPRA-MENU . OHOH
. HE'S THE OFFICIAL ------------------ Nice end header: ;*********************************************************************** Music: The music is a nice slow theme, using a pan flute,
like "Shadow of the beast" (but that sounds was used a lot at that
time., like the great Hans Zimmer theme of the movie "Rain Man"). The module can be found here : stormy-monday.mod (186 Kb) Rain Main theme:
Part 4: This is end part.Quasimodo picture was the first fullscreen picture drawn by Kreator. It is inspired from french comic book artist "Gotlib". Music might be "never ending story" by Demon aka Allister Brimble. The end picture audio was taken from the game "Manoir de Mortevielle" from Lankhor. I'm sure the die hard fans recognized it. Loaders: In
that mega demo I coded a whole system of "loaders". When loading the
demos, there were animation with texte and musics. The track loading
was done in background as well as the uncompression of the demos. That
was a real hard work. Amiga system was a real multitask machine. At
that time, that was very rare for computers. Loader 1:
Arts:
Loader 2: Second loader. This one use a nice trick to
inscrease the numbers of displayed colors. It displays two gradient, in
an interlace way. It double the number of colors (check in the video,
can not be seen on a screenshot like below). Arts:
Source Code: You can read source code here: LOADERII.S Loader 3:
Musics: "EXPRESSION" by Zzzax / Time Circle. Music is a cover of "Street hawk" serie music. Original music by Tangerine Dream. Source Code: You can read source code here: LOADERIII.S New members:
Jerome "Kreator" was a friend from school. Here started to work with me
on the small intros we've made for Dino and T.S.F. He drawed
"Quasimodo" picture for that nice mega demo. He had really good skill
to draw pictures on Amiga. Jerome today making really nice photos. We
can see some on his website HERE. Fabrice "BoomBoom"
helped me for the terminator demo. I've met him some times and he is a
really nice man. HE was older and gave me good hints for programming.
We are still in touch today. In the loader
source code, I can see the "Skywalker" helped me for the loaders. I
guess we sent some papers mails. He was coding some intros for Paradox
at the time. Displaying the hexadecimal of the demo: I did not have that in mind, but displaying the demo binary make some messages appear. We wrote some data in unused space of the disk. Here are the messages: "THIS IS A NEW HAWK PRODUCTION. 1 MEGA WORKING VERSION ... REMENBER : RIP IS LAME !!!!!!!!!" "-----------------
HAWK -----------------MEGA DEMO
I FINISHED
:
22 / 08 / 90 AT 2:05
AM
LET'S GO TO
BED
-ORIENS
-JOHNNY-B
-KREATOR
WISH YOU A GOOD TIME WITH THIS
PRODUCTION.
WAIT FOR OUR FUTURE
CREATION
RIP IS LAME
!!!
3614 RTEL1 BAL
ORIENS TO CONTACT US. " Disks : To save the source code of all that works I used the most beautiful disks I had. Here they are: I also stored all data on 5 1/4 disks: (I had two 5 1/4 drives on my Amiga) Great games of that time: Shadow of the beast : This is an incredible released in November 1989. That game inspired our "winter demo" (part 3) (for the graphic parallax and the music style with pan flute).Here is "shadow of the beast" game: That
game was really impressive. It fully used the A500 and copper capacity.
The different speed scrolling gave depth effect (this is called
"parallax"). You can have read technical detail on codetapper website: HERE. Batman the movie: We played that game while developping our Batman demo. The race parts were really nice. As I was working a lot at Johnny-B's place, I brought there my A500. I remember that we were playing the batman race part with two amiga. No link between amiga, but it was like we were racing in LAN! Great memories. Great demos of that time: Scoopex - Mental Hangover
Step16: It's Party time! Cyclone demo party - Aug 1990 So we went to Saint Quentin (in the north of France) on the 25 August 1990. Johnny B came with me. It was the "Cyclone demo party". We went there without our machine. Before presenting our mega demo to the competition I tried it on the Amiga that will be used and the demo had many bugs !!!! In fact the Amiga used for demo competition had only 512 kb of memory and a standard "Agnus". Our demo required 1Mb if memory and a "Fat Agnus" equiped Amiga. So I talked to all people there and tried to find someone using that kind of Amiga. Hopefully I find someone with a corresponding Amiga and he was ok to lend it for the competition. Later he'll said to me that he was working for a magazine and that he'll write an article about the party. There were 4 demos in competition that day and we won the first place. We were really happy and went back with some money (demo competition are usually granted by money). We also met lot of nice people there, like Frederic "MOBY", which is an excellent french musician (his today name is "el mobo"). That's was a really nice day! The winning disk: Here is the magazine and article: (it is in french, english translation after) Micro news 40. October 1990. Translation: "... As I meditate like a guru in front of a
demo of "Passion", a humanoid approached me to inquire if I have a mega
byte and a fat agnus normal on my machine. Stepxx - Failing school because of heavy code - Sept 1990 Spending too much time on coding was very interesting and surely gave me strong basis for my future life as a programmer. Failing my school year helped me to understand how to manage my school life and my coder life (I was also doing lot of sport). From that point, I did not failed any school class anymore. Photo of me at school: http://image-parcours.copainsdavant.com/image/750/1153495128/2111340.jpg http://www.maurepas.fr/image/VIE%20QUOTIDIENNE/Scolaire/lycee7mares%5B320x200%5D.jpg
Stepxx - Hawk Game "racing" - Sept 1990 We worked on one track. Using snow, like in our mega demo. We also drawed some cars. Johnny B drawed the backgrounds arts, and we drawed cars together. The game was never finished, because it was too much work for us. Here is a screenshot of what it could have looked like: Title might have been "Road's kings" or "Highway to hell". Here are the tile for background: Download data here: 1990-09_HawkGame1.zip This was the last project Johnny B worked for on Amiga. I had lot of fun time with him. Now this is time for new adventures. Great games of that time: Super Cars 1 & 2
Stepxx - Paradox Menu - 1990 I worked with Kreator. Sources and data: Intro_Intox.zip I'm not sure how much compilation Intox released using this menu, but 3 can be found on internet: Intox Compilation 01 Intox Compilation 02 Intox Compilation 33 Here are video capture of compil numer 2 and number 33. The musics are different. Arts: Keator did a really good job on that intro. I like the font and the lady bug animation. It was the first time I fully worked with him. The small ladybug is a reference to comic book author "Gotlib". Music: As Johnny-B left, I seek for a new musician. When I met T.S.F member and specially Gilles "Aces", I also met Laurent "Tebirod" at the same time. He wrote me some musics and one of the first is the music from that demo. You can find it there: litlzic1 (25 Kb) Music (second version): Beat The Ice (28Kb) By the way "Tebirod" is french (backward) for "Golden dick" !! Programming: Here is the source code: COMPIL36.S Very clean. Sorry comments in french The small font is hardcoded inside the source code. Check at end of source code. Very handy to have small font this way, easy to display (1 letter = 8 bytes). 8x8 pixels. I like this one. little_font: dc.b $00,$00,$00,$00,$00,$00,$00,$00 ; Space dc.b $00,$18,$18,$18,$18,$18,$00,$18 ; ! dc.b $00,$6c,$6c,$00,$00,$00,$00,$00 ; " dc.b $00,$36,$7f,$36,$36,$7f,$36,$00 ; # dc.b $00,$08,$3c,$68,$3c,$16,$7c,$10 ; $ dc.b $00,$00,$66,$6c,$18,$36,$66,$00 ; % dc.b $00,$1c,$36,$1c,$3f,$66,$7b,$00 ; & dc.b $0c,$18,$30,$00,$00,$00,$00,$00 ; ' dc.b $00,$03,$06,$0c,$0c,$0c,$06,$03 ; ( dc.b $00,$60,$30,$18,$18,$18,$30,$60 ; ) dc.b $00,$18,$42,$18,$7e,$18,$42,$18 ; * dc.b $00,$00,$1c,$1c,$7f,$1c,$1c,$00 ; + dc.b $00,$00,$00,$00,$00,$30,$30,$60 ; , dc.b $00,$00,$00,$00,$7f,$00,$00,$00 ; - dc.b $00,$00,$00,$00,$00,$30,$30,$00 ; . dc.b $00,$00,$03,$06,$0c,$18,$30,$60 ; / dc.b $00,$00,$7f,$63,$63,$63,$7f,$00 ; 0 dc.b $00,$00,$3c,$0c,$0c,$0c,$0c,$1e ; 1 dc.b $00,$00,$7f,$03,$7f,$70,$7f,$00 ; 2 dc.b $00,$00,$7f,$03,$1f,$03,$7f,$00 ; 3 dc.b $70,$70,$76,$76,$7f,$06,$06,$00 ; 4 dc.b $00,$00,$7f,$70,$7e,$07,$7e,$00 ; 5 dc.b $70,$70,$70,$70,$7f,$73,$7f,$00 ; 6 dc.b $00,$00,$7f,$03,$03,$03,$03,$03 ; 7 dc.b $00,$00,$7f,$73,$7f,$73,$7f,$00 ; 8 dc.b $00,$00,$7f,$73,$7f,$03,$03,$03 ; 9 dc.b $00,$00,$18,$18,$00,$18,$18,$00 ; : dc.b $00,$00,$18,$18,$00,$18,$18,$30 ; ; dc.b $00,$0c,$18,$30,$60,$30,$18,$0c ; < dc.b $00,$00,$00,$3c,$00,$3c,$00,$00 ; = dc.b $00,$30,$18,$0c,$06,$0c,$18,$30 ; > dc.b $00,$00,$7f,$63,$0f,$0c,$00,$0c ; ? dc.b $00,$00,$00,$00,$00,$00,$00,$00 ; @ dc.b $00,$00,$ff,$03,$7f,$73,$73,$00 ; A dc.b $00,$00,$fe,$03,$7e,$73,$7e,$00 ; B dc.b $00,$00,$3f,$70,$70,$70,$3f,$00 ; C dc.b $00,$00,$fe,$03,$73,$73,$7e,$00 ; D dc.b $00,$00,$ff,$00,$7f,$70,$7f,$00 ; E dc.b $00,$00,$7f,$00,$7f,$60,$60,$00 ; F dc.b $00,$00,$3f,$70,$73,$73,$3f,$00 ; G dc.b $00,$00,$73,$73,$7f,$73,$73,$70 ; H dc.b $00,$00,$1c,$1c,$1c,$1c,$1c,$00 ; I dc.b $00,$00,$ff,$06,$06,$06,$7e,$00 ; J dc.b $00,$00,$73,$76,$7c,$76,$73,$00 ; K dc.b $00,$70,$70,$70,$70,$70,$7f,$00 ; L dc.b $00,$00,$63,$77,$7f,$6b,$63,$60 ; M dc.b $40,$60,$73,$7b,$7f,$77,$73,$01 ; N dc.b $00,$00,$fe,$03,$63,$63,$3e,$00 ; O dc.b $00,$00,$fe,$03,$7e,$70,$70,$00 ; P dc.b $00,$00,$3e,$63,$63,$6f,$3e,$03 ; Q dc.b $00,$00,$fe,$03,$7e,$66,$63,$00 ; R dc.b $00,$00,$0f,$1c,$1c,$1c,$f8,$00 ; S dc.b $00,$00,$ff,$1c,$1c,$1c,$1c,$00 ; T dc.b $00,$00,$73,$73,$73,$73,$3e,$00 ; U dc.b $00,$00,$73,$73,$73,$3e,$1c,$00 ; V dc.b $03,$03,$63,$6b,$7f,$77,$63,$00 ; W dc.b $00,$00,$73,$73,$3e,$73,$73,$00 ; X dc.b $00,$00,$73,$73,$7f,$1c,$1c,$1c ; Y dc.b $00,$00,$ff,$0e,$1c,$38,$7f,$00 ; Z dc.b $00,$3c,$38,$38,$38,$38,$38,$3c ; [ dc.b $00,$00,$1f,$38,$fe,$70,$7f,$00 ; £ dc.b $00,$3c,$1c,$1c,$1c,$1c,$1c,$3c ; ] dc.b $00,$18,$3c,$7e,$18,$18,$18,$18 ; HARROW UP dc.b $00,$00,$10,$3f,$7f,$3f,$10,$00 ; HARROW LEFT I did not found the name of that font. I can show the tool used to draw them. It is called "power font 8" I also released another intro for Paradox. In fact it was the same as the "T.S.F" with another logo. I remember the first time I presented that intro to one paradox member, he sent it to one of his contact in the USA (using old modem, took long time :) ). I remember well what his friend said: "Hey, this is a fucking PAL intro !!!". In fact it was the first time I discovered that USA was using different resolution as Europe. All my demos have been done to work in 320x256 (PAL). So I recoded the intro to fit the NTSC resolution (something like 320x220). This is why you can see black at the bottom of the screen. Nice demo of that time: Copper master : Nov 1990. Demo by Angels. I often met Corsair (coder) and his brother Mr Video (Art) in mettings or demo party. This prod is a real nice one. Cryptoburners - The hunt for seven october - Oct 1990 : I really love the music of that demo (the demo is also great). Module is named "klisje paa klisje" by Walkman surely one of the best module done on Amiga.
Step19: "VBL" and "IRQ" On amiga, there is a complete system of "interruptions" (called "IRQ"). You can ask amiga to wake up a part of code when an event occurs. The VBL is one of these events. So basically, the code structure of a demo is: --------------- (Start of demo) - Doing some init - Define VBL interrupt, associate code to execute - Infinit loop (waiting for mouse for example). (end of demo) - Code to execute when VBL interrupt is called. --------------- The VBL is the good time for changing things in relation to the display. At that moment, the electron beam is offscreen, so you can safely do some stuff. But remember, you also have the copper list to perfectly synchronise your registers modifications with the display. So why is the VBL really useful ? In fact, the VBL is synchronised with the video display. Pal amiga display rate is 50Hz. Ntsc is 60Hz. That means you'll have 50 VBL per seconds. That also means you have 20ms between two VBL. If your code is fast enough to be executed in less than 20ms, then your demo will be smooth. In french we say "à la frame" (means, "in the frame" , "frame" = one screen display, 50 screens per seconds, 50 FPS). Let's take a reak example: --------------- (Start of demo) ; Doing some init ... ; Define VBL interrupt, associate code to execute LEA $DFF000,A6 MOVE.W #$c020,$9A(A6) ; Interrupt enable bits (clear or set bits). INTENA ; This enable : Set VBL irw MOVE.L #MYIRQ,$6C ; level 3 - vector $6c : Vbl/Copper/Blitter ; infinit loop (waiting for mouse for example). WAIT: BTST #6,$BFE001 BNE WAIT (end of demo) ... ;Code to execute when VBL interrupt is called. MYIRQ: MOVEM.L D0-D7/A0-A5,-(SP) ; Save all register because interupt will "interrupt" ; main code. Not much in this case (wait for mouse). ..... ; Do your code here MOVEM.L (SP)+,D0-D7/A0-A5 RTE --------------- "RTE" is like "RTS" (Return from subroutine) but for interuptions. In my code, I'm not using the VBL interrupt, but the one just after, which is the "Copper" interrupt. In fact, the register INTENA is set directly from the copper list. with this line: DC.L $009C8010 This will generate a level 3 interrupt and call the code. Here is a full interruption code: --------------- IRQ: MOVE.L D0,-(SP) ; Save D0, because we think this is the only register that need to be save. MOVE.W $DFF01C,D0 ; Verify which interript have been raised. AND.W $DFF01E,D0 BTST #4,D0 ; Test copper interrupt BEQ ENDIRQ ; Do here you computing MOVE.W #$10,$DFF09C ; Clear interrupt flasg before exiting ENDIRQ: MOVE.L (SP)+,D0 RTE --------------- So here is how a demo (or a game) is structured. You can have the same result by testing the value of electron beam in the infinite loop (using the $DFF006 register), but using interruptions is much more clever.
Step20: Concept Tune Disk - 1990 Nice work. In this music disk, three more modules from Tebirod: mod.talkgun mod.aventure parallele mod.dark side (this one is missing)
Step21: Vocabulary - Part 2 Compos: Creations presented at à demoparty. Copyparty / Demoparty : Gathering of people for sharing moments around demo scene. (Copy party were the same, but for copying game). Demo parties have usually contest with lot of differents categories (best demo, best graphic, best music, ...) Warez / Stuff : New creation (or new game). "Hot stuff". Trackmo : Demo that directly use the track of the floppy. Dentro : Creation between "Intro" and "Demo". Bigger than an intro, smaller than a demo. Unpack, uncrunch, decrunch : Uncompress data. VBL : Vertical Blank Line. Time where the electron beam hit the bottom of the screen and is going up. FPS : "Frame Per Second". Demo on amiga usually run at full speed 50 FPS (PAL) and 60 FPS (NTSC). Demoscene : The informal international community that produces and watches demos (audiovisual computer programs).
Next Go to next
step : PART 3 You can send question/comments or things you would like to see here at my email: consolecoder@hotmail.com |