Commit 3cd55835 authored by Alexander Shabarshin's avatar Alexander Shabarshin

Added TERNARO PLAYGROUND

parent 4abbb5c7
// ROBBY standard functions and definitions for v2.3
// (c) 1998-2018, Alexander Shabarshin <me@shaos.net>
@empty=0
@eye=1
@gun=2
@front=0
@right=1
@back=2
@left=3
@t_empty=0
@t_hole=1
@t_stone=2
@t_box=3
@t_reactor=4
@t_missle=5
@t_robot=6
@t_my=7
@t_wall=10
@if(3)=((@1)?(@2):(@3))
@max(2)=(((@1)>(@2))?(@1):(@2))
@min(2)=(((@1)<(@2))?(@1):(@2))
@abs(1)=(((@1)<0)?(-(@1)):(@1))
@sqr(1)=((@1)*(@1))
@mod(2)=((@1)%(@2))
@and(2)=((@1)&&(@2))
@or(2)=((@1)||(@2))
@not(1)=(!(@1))
@neg(1)=(-(@1))
@mouse=0xFFFF
@keyboard=0xFFFE
@select=0xFFFD
@filesystem=0xFFFC
@filebuffer=0x8000
@true=1
@false=0
// LOCAL VARIABLES
@lini(1)=def local[@1];lbase=0
@lbeg(1)=lbase=lbase+@1
@lend(1)=lbase=lbase-@1
@l(1)=local[lbase-@1]
@1=@l(1)
@2=@l(2)
@3=@l(3)
@4=@l(4)
@5=@l(5)
@6=@l(6)
@7=@l(7)
@8=@l(8)
@9=@l(9)
// BYTE MANIPULATIONS
@lobyte(1)=((@1) & #00FF)
@hibyte(1)=(((@1)>>8) & #00FF)
@setlobyte(2)=@1=(@1 & #FF00)|((@2) & #00FF )
@sethibyte(2)=@1=(@1 & #00FF)|((@2) << 8)
// PLATFORM 2 CONSTANTS
@P2_TERMINFO=0x2000
@P2_SETSAY=0x2001
@P2_SETATR=0x2002
@P2_TERMCLR=0x2003
@P2_PEEK=0x2010
@P2_POKE=0x2011
@P2_CHSTAT=0x2110
@P2_CHOPEN=0x2111
@P2_CHCLOSE=0x2112
@P2_CHSEEK=0x2113
// CONST FOR CHSTAT
@P2OK=0
@P2SIZE=1
@P2TIME=2
@P2BLOCK=3
@P2ATTR=4
// CONST FOR FILEATTR
@P2A_RO=0x01
@P2A_HID=0x02
@P2A_SYS=0x04
@P2A_DIR=0x10
// CONST FOR CHOPEN
@P2OPENR=0
@P2OPENW=1
@P2OPENRW=2
@P2OPENA=3
@P2OPENSYS=4
@P2OPENRUN=5
This diff is collapsed.
<HTML>
<HEAD><TITLE>TERNARO PLAYGROUND</TITLE>
<META HTTP-EQUIV="Content-Language" content="en">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8">
<SCRIPT type="text/javascript" src="webitable.js"></SCRIPT>
<SCRIPT type="text/javascript" src="weberta.js"></SCRIPT>
<SCRIPT type="text/javascript" src="robot.js"></SCRIPT>
<SCRIPT type="text/javascript" src="ternaro.js"></SCRIPT>
</HEAD>
<BODY BGCOLOR=#000000 TEXT=#00AA00 LINK=#00AAAA>
<center>
<h3>TERNARO PLAYGROUND</h3>
</center>
<p id="tut" align=center>TERNARO.COM requires a modern web-browser to work properly...</p>
<p align=center>
<font size=-4>
Click <a href="https://hackaday.io/project/159905-ternaro">here</a> for more info about TERNARO FPGA
</font>
</p>
</BODY>
<script type="text/javascript">
var dx=90;
var dy=45;
$R.files = library;
$R.prefix = "www/pcb/";
function rob_get(x,y) {
return [ $R.table_get(x,y,0), $R.table_get(x,y,1) ];
}
function rob_set(x,y,n) {
var i = arguments[3];
$R.table_set(x,y,n);
if(i!=null) {
$R.table_set(x,y,i,1);
}
}
function rob_setc(x,y,c,o) {
rob_set(x,y,c.charCodeAt(0)+(o<<8));
}
function rob_sets(x,y,s,o) {
var i,l=s.length;
for(i=0;i<l;i++) {
rob_set(x+i,y,s.charCodeAt(i)+(o<<8));
}
return x+i;
}
function rob_seth(x,y,o) {
var c = rob_get(x,y)[0]&255;
rob_set(x,y,c+(o<<8));
return c;
}
function tab_act(x,y) {
$R.event(0,-1,1,x,y);
}
if($R.init('tut',dx,dy,tab_act)>0) {
var i,j,k=0,c=1;
for(j=0;j<dy;j++){
for(i=0;i<dx;i++){
rob_set(i,j,32);
}}
$R.add(robot);
$W.start();
}
</script>
</HTML>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment