void draw(void) { int t, f; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); if (back_wall) { glMaterialfv(GL_FRONT, GL_DIFFUSE, wallcolor); DrawWall(); } glPushMatrix(); { glTranslatef(WIDTH / 2, HEIGHT / 2, 0); glRotatef(xlangle, 0, 1, 0); glRotatef(ylangle, 1, 0, 0); glTranslatef(-WIDTH / 2, -HEIGHT / 2, 0); glLightfv(GL_LIGHT0, GL_POSITION, lightZeroPosition); } glPopMatrix(); glPushMatrix(); { glTranslatef(WIDTH / 2, HEIGHT / 2, 0); glRotatef(xangle, 0, 1, 0); glRotatef(yangle, 1, 0, 0); glTranslatef(-WIDTH / 2, -HEIGHT / 2, 0); DrawPosts(); DrawDooDads(); } glPopMatrix(); if (motion && moves.depth) { t = moves.head->t; f = moves.head->f; push(t, pop(f)); mpop(); } glutSwapBuffers(); }
void shl(){ mpush( mpop()<<1 ); }
void zbra(){ if( mpop() ) ip=ip+CELL; else bra(); }
void dup(){ cell t=mpop(); mpush(t); mpush(t); }
void push(){ rp=rp-CELL; mstore(mpop(),rp); }
// Pops 2 cells off data stack void m2pop(){ t=mpop(); n=mpop(); }
void com(){ mpush( ~mpop() ); } void plus(){ m2pop(); mpush( t + n ); } void shl(){ mpush( mpop()<<1 ); } void shr(){ mpush( mpop()>>1 ); } void oneplus(){ mpush( mpop()+1 ); } void oneminus(){ mpush( mpop()-1 ); } void spat(){ mpush(sp); } void spbang(){