Silmarils' games (Robinson's Requiem, Ishar, Transarctica, Targhan…) are programs for a virtual machine, ALIS: each .io file of a game is a compiled script (byte code, the variables it reserves, its pictures, sounds and 3D models). This port of the machine to PHP comes with a decompiler and a compiler: every script becomes a text in the ALIS source language, and the engine compiles that text back when it loads the script.
Silmarils' own sources were never published, so the syntax is a reconstruction: the names of the instructions and expression items are the machine's own (cput, cscmov, oimmb, oadd…), and the structures follow the habits of the original compiler, read from the byte code (one pass, left-to-right expressions, the same code for every if … else and while). The 109 scripts of Robinson's Requiem (46,886 lines) compile back byte for byte, and the game started from the sources shows exactly the same pictures as the original.
L0049:
putnat 108, 0, 137, 5 + vb[0x52], 1
if vw[0x54] {
call L010d
}
table inkey(), -187
goto L00b0
goto L00bf
end
vb[0x52] (a byte of the entity), vw[...] (a word), vs[...] (a string), mw[...] (the main script's), hw[e, ...] (another entity's), tables tb[...](i);[ ] groups, $+, $==… work on strings;local octet vague @ $52), si … alors … sinon … finsi, tantque … faire … fintantque, := to store, = / <> to compare, $52 numbers; translated word for word both ways, byte-identical;locate, tab, dim, plot, box, ink…), those of GFA BASIC, the language of the ST in France: so PUTNAT, TOPALET in capitals, IF … ELSE … ENDIF, WHILE … WEND, GOSUB, SELECT … CASE, ADD x, n, &H52, ' comments, typed variables (vague| a byte, x& a word, name$ a string) declared with LOCAL / GLOBAL; translated word for word both ways, byte-identical;<GAME> - ALIS EDITOR) edits a script with colours and search, compiles it (a mistake shows its line), keeps your version in your files and starts the game with it (F5).The full guide is in French: le langage ALIS, l'éditeur. Below: every instruction of the machine and its operands.
La documentation technique de la machine décrit, pour chaque instruction, ce que l'exécutable d'origine en fait.
| Code | Instruction | Opérandes |
|---|---|---|
| 0x00 | cnul | nul |
| 0x01 | cesc1 | esc1 (voir les échappements) |
| 0x02 | cesc2 | esc2 octet |
| 0x03 | cesc3 | esc3 octet |
| 0x04 | cbreakpt | breakpt |
| 0x05 | cjsr8 | call étiquette |
| 0x06 | cjsr16 | call étiquette |
| 0x07 | cjsr24 | call étiquette |
| 0x08 | cjmp8 | goto étiquette |
| 0x09 | cjmp16 | goto étiquette |
| 0x0a | cjmp24 | goto étiquette |
Warning: Uninitialized string offset 0 in /workspace/games/alis/tools/lang/reference.php on line 24 Warning: Uninitialized string offset 0 in /workspace/games/alis/tools/lang/reference.php on line 23 Warning: Uninitialized string offset 0 in /workspace/games/alis/tools/lang/reference.php on line 24 Warning: Uninitialized string offset 0 in /workspace/games/alis/tools/lang/reference.php on line 24 Warning: Uninitialized string offset 0 in /workspace/games/alis/tools/lang/reference.php on line 23 Warning: Uninitialized string offset 0 in /workspace/games/alis/tools/lang/reference.php on line 23
| 0x0b | cjsrabs | jsrabs | |
|---|---|---|---|
| 0x0d | cjsrind16 | jsrind16 | |
| 0x0e | cjsrind24 | jsrind24 | |
| 0x0f | cjmpind16 | jmpind16 | |
| 0x10 | cjmpind24 | jmpind24 | |
| 0x11 | cret | ret | |
| 0x12 | cbz8 | ifz goto étiquette, ou ifnot expr goto étiquette | |
| 0x13 | cbz16 | ifz goto étiquette, ou ifnot expr goto étiquette | |
| 0x14 | cbz24 | ifz goto étiquette, ou ifnot expr goto étiquette | |
| 0x15 | cbnz8 | ifnz goto étiquette, ou if expr goto étiquette | |
| 0x16 | cbnz16 | ifnz goto étiquette, ou if expr goto étiquette | |
| 0x17 | cbnz24 | ifnz goto étiquette, ou if expr goto étiquette | |
| 0x18 | cbeq8 | ifeq goto étiquette | |
| 0x19 | cbeq16 | ifeq goto étiquette | |
| 0x1a | cbeq24 | ifeq goto étiquette | |
| 0x1b | cbne8 | ifne goto étiquette | |
| 0x1c | cbne16 | ifne goto étiquette | |
| 0x1d | cbne24 | ifne goto étiquette | |
| 0x1e | cstore | cible = expr | |
| 0x1f | ceval | eval expr | |
| 0x20 | cadd | cible += expr | |
| 0x21 | csub | cible -= expr | |
| 0x22 | cmul | mul | |
| 0x23 | cdiv | div | |
| 0x24 | cvprint | vprint expr | |
| 0x25 | csprinti | sprinti "texte" | |
| 0x26 | csprinta | sprinta expr | |
| 0x27 | clocate | locate expr, expr | |
| 0x28 | ctab | tab expr | |
| 0x29 | cdim | dim offset, compteur, taille, [valeurs] | |
| 0x2a | crandom | random expr | |
| 0x2b | cloop8 | loop cible goto étiquette | |
| 0x2c | cloop16 | loop cible goto étiquette | |
| 0x2d | cloop24 | loop cible goto étiquette | |
| 0x2e | cswitch1 | switch expr … end | |
| 0x2f | cswitch2 | table expr, base … end | |
| 0x30 | cstart8 | start étiquette | |
| 0x31 | cstart16 | start étiquette | |
| 0x32 | cstart24 | start étiquette | |
| 0x33 | cleave | leave | |
| 0x34 | cprotect | protect expr | |
| 0x35 | casleep | asleep expr | |
| 0x36 | cclock | clock expr | |
| 0x37 | canim | anim | |
| 0x38 | cscmov | scmov expr, expr, expr | |
| 0x39 | cscset | scset expr, expr, expr | |
| 0x3a | cclipping | clipping | |
| 0x3b | cswitching | switching | |
| 0x3c | cwlive | wlive expr, mot, cible | |
| 0x3d | cunload | unload mot | |
| 0x3e | cwakeup | wakeup expr | |
| 0x3f | csleep | sleep | |
| 0x40 | clive | live mot, cible | |
| 0x41 | ckill | kill expr | |
| 0x42 | cstop | stop | |
| 0x43 | cstopret | stopret | |
| 0x44 | cexit | exit | |
| 0x45 | cload | load id, "fichier" | expr |
| 0x46 | cdefsc | defsc mot, octet, hex"(32 octets)" | |
| 0x47 | cscreen | screen mot | |
| 0x48 | cput | put expr | |
| 0x49 | cputnat | putnat expr, expr, expr, expr, expr | |
| 0x4a | cerase | erase | |
| 0x4b | cerasen | erasen expr | |
| 0x4c | cset | set expr, expr, expr | |
| 0x4d | cmov | mov expr, expr, expr | |
| 0x4e | copensc | opensc mot | |
| 0x4f | cclosesc | closesc mot | |
| 0x50 | cerasall | erasall | |
| 0x51 | cforme | forme expr | |
| 0x52 | cdelforme | delforme | |
| 0x53 | ctstmov | tstmov expr, expr, expr, expr, cible | |
| 0x54 | ctstset | tstset | |
| 0x55 | cftstmov | ftstmov expr, expr, expr, expr, expr, cible | |
| 0x56 | cftstset | ftstset expr, expr, expr, expr, expr, cible | |
| 0x57 | csuccent | succent cible | |
| 0x58 | cpredent | predent cible | |
| 0x59 | cnearent | nearent expr, expr, cible | |
| 0x5a | cneartyp | neartyp expr, mot, cible | |
| 0x5b | cnearmat | nearmat expr, expr, cible | |
| 0x5c | cviewent | viewent expr, expr, expr, cible | |
| 0x5d | cviewtyp | viewtyp expr, expr, mot, cible | |
| 0x5e | cviewmat | viewmat expr, expr, expr, cible | |
| 0x5f | corient | orient expr | |
| 0x60 | crstent | rstent cible | |
| 0x61 | csend | send entité, valeur, … | |
| 0x62 | cscanon | scanon | |
| 0x63 | cscanoff | scanoff | |
| 0x64 | cinteron | interon | |
| 0x65 | cinteroff | interoff | |
| 0x66 | cscanclr | scanclr | |
| 0x67 | callentity | allentity | |
| 0x68 | cpalette | palette expr | |
| 0x69 | cdefcolor | defcolor expr, expr | |
| 0x6a | ctiming | timing expr | |
| 0x6b | czap | zap expr ×4 (×5 si la durée n'est pas la constante 0) | |
| 0x6c | cexplode | explode expr, expr, expr, expr | |
| 0x6d | cding | ding expr, expr, expr, expr | |
| 0x6e | cnoise | noise expr, expr, expr, expr | |
| 0x6f | cinitab | initab | |
| 0x70 | cfopen | fopen z"fichier", mode | expr, expr |
| 0x71 | cfclose | fclose | |
| 0x72 | cfcreat | fcreat | |
| 0x73 | cfdel | fdel | |
| 0x74 | cfreadv | freadv cible | |
| 0x75 | cfwritev | fwritev expr | |
| 0x76 | cfwritei | fwritei | |
| 0x77 | cfreadb | freadb &adresse, long | |
| 0x78 | cfwriteb | fwriteb &adresse, long | |
| 0x79 | cplot | plot expr, expr | |
| 0x7a | cdraw | draw expr, expr | |
| 0x7b | cbox | box expr, expr | |
| 0x7c | cboxf | boxf expr, expr | |
| 0x7d | cink | ink expr | |
| 0x7e | cpset | pset expr, expr | |
| 0x7f | cpmove | pmove expr, expr | |
| 0x80 | cpmode | pmode expr | |
| 0x81 | cpicture | picture | |
| 0x82 | cxyscroll | xyscroll expr, expr | |
| 0x83 | clinking | linking expr | |
| 0x84 | cmouson | mouson | |
| 0x85 | cmousoff | mousoff | |
| 0x86 | cmouse | mouse cible, cible, cible | |
| 0x87 | cdefmouse | defmouse expr | |
| 0x88 | csetmouse | setmouse expr, expr | |
| 0x89 | cdefvect | defvect hex"…" | |
| 0x8a | csetvect | setvect mot | |
| 0x8b | cnul2 | nul2 | |
| 0x8c | capproach | approach expr | |
| 0x8d | cescape | escape expr | |
| 0x8e | cvtstmov | vtstmov expr, cible | |
| 0x8f | cvftstmov | vftstmov expr, expr, cible | |
| 0x90 | cvmov | vmov | |
| 0x91 | cdefworld | defworld mot, hex"(6 octets)" | |
| 0x92 | cworld | world octet, octet | |
| 0x93 | cfindmat | findmat | |
| 0x94 | cfindtyp | findtyp mot, cible | |
| 0x95 | cmusic | music expr, expr, expr, expr, expr, expr | |
| 0x96 | cdelmusic | delmusic expr | |
| 0x97 | ccadence | cadence expr | |
| 0x98 | csetvolum | setvolum expr | |
| 0x99 | cxinv | xinv | |
| 0x9a | cxinvon | xinvon | |
| 0x9b | cxinvoff | xinvoff | |
| 0x9c | clistent | listent cible | |
| 0x9d | csound | sound expr, expr, expr, expr, expr | |
| 0x9e | cmsound | msound expr, expr, expr, expr, expr | |
| 0x9f | credon | redon | |
| 0xa0 | credoff | redoff | |
| 0xa1 | cdelsound | delsound | |
| 0xa2 | cwmov | wmov expr | |
| 0xa3 | cwtstmov | wtstmov | |
| 0xa4 | cwftstmov | wftstmov | |
| 0xa5 | ctstform | tstform expr, expr, cible | |
| 0xa6 | cxput | xput expr | |
| 0xa7 | cxputat | xputat expr, expr, expr, expr, expr | |
| 0xa8 | cmput | mput expr | |
| 0xa9 | cmputat | mputat expr, expr, expr, expr, expr | |
| 0xaa | cmxput | mxput expr | |
| 0xab | cmxputat | mxputat expr, expr, expr, expr, expr | |
| 0xac | cmmusic | mmusic expr, expr, expr, expr, expr, expr | |
| 0xad | cmforme | mforme expr | |
| 0xae | csettime | settime expr, expr, expr | |
| 0xaf | cgettime | gettime cible, cible, cible | |
| 0xb0 | cvinput | vinput cible | |
| 0xb1 | csinput | sinput cible | |
| 0xb2 | casleepfar | asleepfar expr | |
| 0xb3 | casleepon | asleepon | |
| 0xb4 | casleepoff | asleepoff | |
| 0xb5 | crunfilm | runfilm expr, cible, cible | |
| 0xb6 | cvpicprint | vpicprint expr | |
| 0xb7 | cspicprint | spicprint expr | |
| 0xb8 | cvputprint | vputprint expr | |
| 0xb9 | csputprint | sputprint expr | |
| 0xba | cfont | font expr, expr, expr, expr, expr | |
| 0xbb | cpaper | paper expr | |
| 0xbc | ctoblack | toblack expr | |
| 0xbd | cmovcolor | movcolor expr, expr | |
| 0xbe | ctopalet | topalet expr, expr | |
| 0xbf | cnumput | numput expr, expr, expr, expr | |
| 0xc0 | cscheart | scheart expr, expr | |
| 0xc1 | cscpos | scpos expr, expr | |
| 0xc2 | cscsize | scsize expr, expr | |
| 0xc3 | cschoriz | schoriz expr, expr, expr | |
| 0xc4 | cscvertic | scvertic expr, expr, expr | |
| 0xc5 | cscreduce | screduce expr, expr, expr | |
| 0xc6 | cscscale | scscale expr | |
| 0xc7 | creducing | reducing expr, expr | |
| 0xc8 | cscmap | scmap expr, &adresse | |
| 0xc9 | cscdump | scdump | |
| 0xca | cfindcla | findcla expr, cible | |
| 0xcb | cnearcla | nearcla | |
| 0xcc | cviewcla | viewcla | |
| 0xcd | cinstru | instru expr, expr, expr | |
| 0xce | cminstru | minstru expr, expr, expr | |
| 0xcf | cordspr | ordspr expr | |
| 0xd0 | calign | align expr, expr | |
| 0xd1 | cbackstar | backstar expr, expr, expr, expr, expr, expr | |
| 0xd2 | cstarring | starring expr, expr, expr, expr, expr, expr, expr, expr | |
| 0xd3 | cengine | engine | |
| 0xd4 | cautobase | autobase | |
| 0xd5 | cquality | quality expr | |
| 0xd6 | chsprite | hsprite expr, expr, expr, expr | |
| 0xd7 | cselpalet | selpalet expr | |
| 0xd8 | clinepalet | linepalet expr, expr | |
| 0xd9 | cautomode | automode | |
| 0xda | cautofile | autofile expr | |
| 0xdb | ccancel | cancel | |
| 0xdc | ccancall | cancall | |
| 0xdd | ccancen | cancen expr | |
| 0xde | cblast | blast expr | |
| 0xdf | cscback | scback expr, expr, expr, expr, expr, expr | |
| 0xe0 | cscrolpage | scrolpage expr, expr, expr, expr | |
| 0xe1 | cmatent | matent cible | |
| 0xe2 | cshrink | shrink expr, expr | |
| 0xe3 | cdefmap | defmap &adresse, expr, expr, expr, expr, expr, expr, expr | |
| 0xe4 | csetmap | setmap &adresse, expr, expr, expr, expr, expr, expr | |
| 0xe5 | cputmap | putmap &adresse, expr, expr, expr, expr | |
| 0xe6 | csavepal | savepal expr | |
| 0xe7 | csczoom | sczoom | |
| 0xe8 | ctexmap | texmap &adresse, expr, expr, expr, expr, expr, expr, expr, expr, expr, expr, expr | |
| 0xe9 | calloctab | alloctab &adresse | |
| 0xea | cfreetab | freetab &adresse | |
| 0xeb | cscantab | scantab | |
| 0xec | cneartab | neartab | |
| 0xed | cscsun | scsun | |
| 0xee | cdarkpal | darkpal expr, expr, expr, expr, expr | |
| 0xef | cscdark | scdark expr, expr, expr | |
| 0xf0 | caset | aset expr, expr, expr | |
| 0xf1 | camov | amov expr, expr, expr | |
| 0xf2 | cscaset | scaset | |
| 0xf3 | cscamov | scamov | |
| 0xf4 | cscfollow | scfollow expr, expr, expr, expr, expr, expr, expr, expr | |
| 0xf5 | cscview | scview expr, expr, expr, expr, expr, expr | |
| 0xf6 | cfilm | film expr, expr, expr, cible | |
| 0xf7 | cwalkmap | walkmap &adresse, expr, expr, expr, cible | |
| 0xf8 | catstmap | atstmap &adresse, expr, expr, expr, cible | |
| 0xf9 | cavtstmov | avtstmov expr, cible | |
| 0xfa | cavmov | avmov | |
| 0xfb | caim | aim expr, expr, expr, expr, cible, cible, cible | |
| 0xfc | cpointpix | pointpix expr, expr, cible, cible, cible, cible, cible, cible | |
| 0xfd | cchartmap | chartmap &adresse, mode, (&adresse si mode = 0 ou 1 | expr) |
| 0xfe | cscsky | scsky expr, expr, expr | |
| 0xff | czoom | zoom expr, expr |
cesc1 + un octet)| Échappement | Instruction | Opérandes |
|---|---|---|
| 0x01 0x00 | cnul | esc1 nul |
| 0x01 0x01 | csoundon | soundon |
| 0x01 0x02 | csoundoff | soundoff |
| 0x01 0x03 | cmusicon | musicon |
| 0x01 0x04 | cmusicoff | musicoff |
| 0x01 0x05 | cdelfilm | delfilm |
| 0x01 0x06 | copenfilm | openfilm expr, expr, expr, expr, cible |
Les cibles d'affectation (storenames, addnames) suivent la même table avec s… / a… au lieu de o….
| Code | Élément | Écriture | |
|---|---|---|---|
| 0x00 | oimmb | nombre de -128 à 127 | |
| 0x02 | oimmw | nombre de -32768 à 32767 | |
| 0x04 | oimmp | "texte" | |
| 0x06 | olocb | vb[offset] (autres offsets) | |
| 0x08 | olocw | vw[offset] (autres offsets) | |
| 0x0a | olocp | vs[offset] (autres offsets) | |
| 0x0c | oloctp | ts[offset](index…) (autres offsets) | |
| 0x0e | oloctc | tb[offset](index…) (autres offsets) | |
| 0x10 | olocti | tw[offset](index…) (autres offsets) | |
| 0x12 | odirb | vb[offset] (offset 0 à 255) | |
| 0x14 | odirw | vw[offset] (offset 0 à 255) | |
| 0x16 | odirp | vs[offset] (offset 0 à 255) | |
| 0x18 | odirtp | ts[offset](index…) (offset 0 à 255) | |
| 0x1a | odirtc | tb[offset](index…) (offset 0 à 255) | |
| 0x1c | odirti | tw[offset](index…) (offset 0 à 255) | |
| 0x1e | omainb | mb[offset] | |
| 0x20 | omainw | mw[offset] | |
| 0x22 | omainp | ms[offset] | |
| 0x24 | omaintp | mts[offset](index…) | |
| 0x26 | omaintc | mtb[offset](index…) | |
| 0x28 | omainti | mtw[offset](index…) | |
| 0x2a | ohimb | hb[var, offset] | |
| 0x2c | ohimw | hw[var, offset] | |
| 0x2e | ohimp | hs[var, offset] | |
| 0x30 | ohimtp | himtp(…) | |
| 0x32 | ohimtc | himtc(…) | |
| 0x34 | ohimti | himti(…) | |
| 0x36 | opile | pile(…) | |
| 0x38 | oeval | ( … ) | |
| 0x3a | ofin | fin(…) | |
| 0x3c | oimml | autre nombre | |
| 0x3e | olocto | to[offset](index…) (autres offsets) | |
| 0x40 | opushacc | push(…) | |
| 0x42 | oand | a & b | |
| 0x44 | oor | a ` | ` b |
| 0x46 | oxor | a ^ b | |
| 0x48 | oeqv | a eqv b | |
| 0x4a | oegal | a == b | |
| 0x4c | odiff | a != b | |
| 0x4e | oinfeg | a <= b | |
| 0x50 | osupeg | a >= b | |
| 0x52 | oinf | a < b | |
| 0x54 | osup | a > b | |
| 0x56 | oadd | a + b | |
| 0x58 | osub | a - b | |
| 0x5a | omod | a % b | |
| 0x5c | odiv | a / b | |
| 0x5e | omul | a * b | |
| 0x60 | oneg | neg(…) | |
| 0x62 | oabs | abs(…) | |
| 0x64 | ornd | rnd(…) | |
| 0x66 | osgn | sgn(…) | |
| 0x68 | onot | not(…) | |
| 0x6a | oinkey | inkey(…) | |
| 0x6c | okeyon | keyon(…) | |
| 0x6e | ojoy | joy(…) | |
| 0x70 | oprnd | prnd(…) | |
| 0x72 | oscan | scan(…) | |
| 0x74 | oshiftkey | shiftkey(…) | |
| 0x76 | ofree | free(…) | |
| 0x78 | omodel | model(…) | |
| 0x7a | ogetkey | getkey(…) | |
| 0x7c | oleft | left(…) | |
| 0x7e | oright | right(…) | |
| 0x80 | omid | mid(…) | |
| 0x82 | olen | len(…) | |
| 0x84 | oasc | asc(…) | |
| 0x86 | ostr | str(…) | |
| 0x88 | osadd | a $+ b | |
| 0x8a | osequal | a $== b | |
| 0x8c | osdiff | a $!= b | |
| 0x8e | osinfeg | a $<= b | |
| 0x90 | ossupeg | a $>= b | |
| 0x92 | osinf | a $< b | |
| 0x94 | ossup | a $> b | |
| 0x96 | ospushacc | spush(…) | |
| 0x98 | ospile | spile(…) | |
| 0x9a | oval | val(…) | |
| 0x9c | oexistf | existf(…) | |
| 0x9e | ochr | chr(…) | |
| 0xa0 | ochange | change(…) | |
| 0xa2 | ocountry | country(…) | |
| 0xa4 | omip | mip(…) | |
| 0xa6 | ojoykey | joykey(…) | |
| 0xa8 | oconfig | config(…) | |
| 0xaa | ogettext | gettext(…) | |
| 0xac | oips | ips(…) |