Home Memoirs of a Gamer Movies I watched Guidebook Code Projects Links

The Gorgon Engine

Acceptable Scriptor Instructions

All instructions follow an assembler style format:

instruction parameter1,parameter2,paramter3,...

All parameters are translated to 16 bit integers. Paranthesis can be used to nest instructions together.

= var1,(+ var1,(>> var2,1))

Operators

OperatorFunctionality
=Integer Assignment
+Integer Addition
-Integer Substraction
*Integer Multiplication
/Integer Division
%Integer Modulus
&Bitwise AND
|Bitwise OR
^Bitwise XOR
!Bitwise NOT
<<Bit Shift Left
>>Bit Shift Right
==Equals
<Less Than
<=Less Than OR Equals
>Greater Than
>=Greater Than OR Equals
!=Not Equals

General Functionality

InstructionParametersFunctionality
break0Triggers a controlled system crash
wait2Delays script execution by the time provided in parameters
exit1Triggers a graceful shutdown of Gorgon engine
textcolor2Sets the Foreground and Background text colors
print4Prints text directly to screen
msgbox2Prints text in a message box
sound1Plays the specified sound effect
music2Plays the specified track in the music package
queue2Queues the next music track to play
call2Calls the specified event from any code segment
said1Tests the player command input
clearvars0Clears all variables
clearrooms0Clears all room flags
loadroom1Loads indexed room script
loadaux2Loads specified script into aux segment
achievement.add1Adds Steam achievement
achievement.drop1Removes Steam achievement

Screen

InstructionParametersFunctionality
pal1Loads desired palette data into video card
target1Specifies backbuffer targeted by screen instructions
image4Draws sprite object to full screen backbuffer
screen.limits2Sets vertical line limits for video refresh
screen.clear0Clears screen backbuffer
screen.load2Loads full screen artwork to backbuffer
screen.draw0Draws screen art backbuffer to main backbuffer
screen.present0Draws contents of backbuffer to video memory
map1Loads fullscreen 16 color priority to Map backbuffer
mask1Loads fullscreen 16 color priority to Mask backbuffer

Inventory

InstructionParametersFunctionality
item.has1Tests player inventory for item ID
item.add1Adds item ID to player inventory
item.drop1Removes item ID from player inventory
item.clr0Clears player inventory

Sprites

InstructionParametersFunctionality
sprite.clr0Clear sprite registers
sprite.setseq2Set sprite sequence for direction
sprite.setloc2Set sprite location
sprite.vis2Set sprite visibility flags
sprite.anim2Set sprite animation flags
sprite.load2Load sprite image data file

Files

InstructionParametersFunctionality
file.open2Opens custom data file
file.close0Closes custom data file
file.read0Reads 16 bit integer from custom data file
file.reads1Reads string from custom data file
file.write1Writes 16 bit integer to custom data file
file.writes1Writes string to custom data file

Serial Connection

InstructionParametersFunctionality
serial.open2Attempt to open serial connection
serial.close0Close serial connection
serial.in0Read 16 bit integer from serial port
serial.out1Write 16 bit integer to serial port

Strings

InstructionParametersFunctionality
string.read2Read string from player input
string.set2Set string from data
string.len1Get string length
string.atoi1Convert string to 16 bit integer value
string.cat2Concatonate 2 strings
string.cmp2Compare 2 strings