how to make a program - BILLPC2684/VEXREX-emulator-love2D- GitHub Wiki
##Remember: REGS = A,B,C,D,E,F,G,H,SCW,SCH
(SCW = SCreenWidth,SCH = SCeenHight)
#Building a ROM using the CVT.py
CVT.py is a program that alows you to draw custom functions that'll make the ROM for you, basicly all you need to know are the functions...
###functions --need to update this later :3
#Building the ROM
Because the emulator don't read ROM(s) as binary(due to lua's dofile() function),
so the file must start with:
ROM = {
and "opcodeName $1 $2"(replace the " "spaces with [tabs])
and end with with } if you wana add a DataDrive well just type drivename = "<filename.ext>" how long you want your drive to be, you will type fileLangth = <number>
###OPCODES
$1 = number
$1 = keyboardPress($2)
$1(x),$2(y) = cursorPos
$1 = CursorPress($2)
$1 = number
$1 = CursorWheelX
$1 = CursorWheelY
$1 = $2
tempREG = $1
$1 = tempREG($2)[0-7]
$1 = tempREG($2)[0-7]
$1 = tempREG($2)[0-15]
del tempREG($1)[$2-&2+8]
$1 = $1[1-30] .. $2
$1 = $1 & $2
$1 = $1 | $2
$1 = $1 ^ $2
$1 = !$1
$1 = $1 + $2
$1 = $1 - $2
$1 = $1 / $2
$1 = $1 * $2
print $1
PC = $1
PC = ((? F == number)*1 or (? F != number)*2)
returns "CPU HALTED!!!"
RAM[$1] = $2
$1 = RAM[$2]
F = ((? $1 < $2)*1 or (? $1 == $2)*2 or (? $1 > $2)*3)
$1 = RNG($1,$2)
R = $1
G = $1
B = $1
$1 = screen[X][Y][R]
$1 = screen[X][Y][G]
$1 = screen[X][Y][B]
X = $1
Y = $1
POINT[number] = {X,Y}
Plots a pixel at X,Y
Plot pixels at POINT[1] to POINT[2]
plot lines to make a rectangle from POINT[1] to POINT[2]
renders the screen
DataDrive[$1] = $2
$2 = DataDrive[$1]