Thursday, March 10, 2011

Life-changing books (2/3)

When I turned 17, it became clear that I couldn't realise all my projects with BASIC alone. I opted for physics/chemics labs rather than computer labs, unfortunately, and the teacher wouldn't let me get a copy of the Turbo Pascal she was using for her courses. "It wouldn't make any sense to me without her teaching" or something alike.

A friend of mine (later known as Parmy in PPP Team) had a copy of A86 -- a 16-bit assembler for dos -- left over a floppy, and a book "Easy Assembly" he never really made sense of. Being from the 8-bit era, "Assembly" meant to me "the language of gods" and "blazing fast execution speed", so I immediately accepted the offer and started studying Intel's instruction set.


Vers 16 ans, je commençais a avoir fait le tour de ce qui peut se faire en BASIC. J'avais (mal?)heureusement préféré les cours de labo physique/chimie l'année précédente, et la prof d'informatique ne voulait pas me faire une copie du Turbo Pascal sous prétexte que je serais incapable de m'en servir sans suivre ses cours. Grmbl. En allant expliquer à un de nos nouveaux amis (que l'on connaîtra plus tard dans PPP Team sous le nom de Parmy) mes techniques graphiques en BASIC, je tombe dans sa bibliothèque sur un bouquin "L'assembleur facile" et une diskette 5'1/4 estampillée "A86". "Je ne m'y suis jamais vraiment mis", me confie-t'il. Pour un enfant de la génération 8-bit comme moi, l'assembleur, c'est comme le langage des dieux. J'emprunte sans hésiter le bouquin et je me mets à potasser le jeu d'instruction des processeurs Intel.


After I showed my uncle my first assembly program (iirc, a password-prompting tool to prevent my sister to mess up with "our" computer), he brought me a box full of low-level C64 stuff, including a copy of "programming the 6502" book, a disassembled and commented dump of the C64 kernal rom, an EEPROM programmer (with no EEPROM provided) and other similar books. SYS 49152 was no longer a mystery to me -- although POKEing machine instructions from a BASIC program wasn't a very sexy way to proceed. It took me time to wrap my brain around the LIFO stack concept ...
I never really "programmed" the 6502 at assembly level, as it was already a decade-old machine, but I must admit the beauty of 6502's instruction set simplicity has been inspiring to many regards... more about that in part 3.

At last, mastering assembly and the Ms-DOS service interrupts allow direct manipulation of any file format, opening up countless possibilities.


Voyant mon premier programme assembleur, mon oncle me propose de reprendre une caisse de documentation technique sur le commodore, dont une copie d'un livre d'introduction à la programmation du 6502 en assembleur -- le processeur du commodore 64. La caisse contient un programmateur d'EEPROM pour faire "de véritables cartouches" façon Rick Dangerous. Je bave. Je prends. Il n'en sortira pas grand-chose, cependant, hormis une meilleure compréhension de cette machine de rêve définitivement désuète et une admiration sans borne pour la simplicité de ces LAY et LAX. Mais n'anticipons pas.

Knowing the assembly language, however, wouldn't be of much use without knowing the hardware that sits around the CPU. A "PC" was still fairly simple by that time: everyone had a VGA-clone video card (super-VGA was only slowly starting to be adopted, and not by game vendors) and a Sound Blaster clone. Both and more were discussed in the "Bible of PC System Programming", a fairly huge book that I borrowed to another friend -- later known as Nowan -- before I got myself a copy of my own. He also let me grab another Sound-blaster related book (ISBN 978-2742901951) from the same editor, which was describing "how to build a 4-track modplayer from scratch -- in Pascal".

Bien sûr, l'assembleur tout seul ne servirait pas à grand-chose sans une meilleure compréhension du hardware du PC. Fort opportunément, c'est approximativement à ce moment qu'un autre ami (connu plus tard sous le pseudo de Nowan) va me préter coup sur coup la bible du PC et le supergrand livre de la SoundBlaster. Me voilà plongé de plus belle dans les documentations techniques, et armé jusqu'aux dents pour attaquer la conception 100% assembleur d'un modplayer -- pardon un S3Mplayer -- qui devra être le coeur de l'Ultimate Game Maker. J'aurai bien un petit jeu réalisé (Crazy Brix) fin '97, qui sera amélioré plus tard pour la Inscene '99, mais UGM restera un tas de papier attendant la réalisation de mon propre OS -- Clicker, une idée de Nowan, à l'origine -- le Windows 95 ne pouvant définitivement pas convenir pour nos projets.

I still had no Pascal compiler by that time, and I was sufficiently confident that, with that knowledge and the S3MINFO.TXT file shipped with my brother's Scream Tracker III, I would be able to run a 8-track Stereo S3M player instead, with 2 tracks dedicated to sound effects and 6 tracks dedicated to background music. I started copying every meaningful bit of information into a smaller draftbook, easier to carry around and not to be returned to a friend by the end of the month ^_^

According to my brother's archive, it took me another 6 month to convert that idea into something capable of replaying some simple modules. I never made it "the corner stone of the ultimate game maker" as I initially intended, but it was the core of Crazy Brix and Out'm'Up, the two awards-winning 100K game at Inscene'99 and Inscene'Y2K, respectively.

5 comments:

Mojo Jojo said...

Rodnay Zaks, wow! Soudain je me retrouve 30 ans plus tôt, une carte avec un Z80, un affichage type calculatrice (8 leds par chiffre). Je me demande si j'ai encore le bouquin d'assembleur 6502 (ah oui, dans le C64, bien sur!). Je me demande comment les p'tits gars de nos jours se mettent le pied à l'étrier, j'ai l'impression que les systèmes maintenant sont terriblement complexes.

PypeBros said...

Bin j'ai fort l'impression que pour les "p'tits gars de nos jours", le "système" c'est Java2EE ou XNA. Et point-barre.

En tout cas, ça expliquerait l'engouement pour la PALib.

cyborgjeff said...

Oui... je pense qu'il y a moins de gens qui plonge directe dans le langage machine quand même non ?

PypeBros said...

ça a moins de raison d'être, aussi, sauf à considérer la programmation des shaders OpenGL comme de l'assembleur (en fait, c'est presque pire :P)

Mais comme on a maintenant tous un PC capable de compiler du C ou du pascal (ou n'importe quoi d'autre) ...

c0dasm said...

[Solar date IIMM.J.15] I work on UGM, wichshould allows me to code games easily in PM32, with VBE mode 480×360 16 Mo colors, WSS sound 16 bits stereo 48000Hz and very flexible sprites supports (Object-oriented, according to SEB)