program.cc

来自「initial working phase of the design of s」· CC 代码 · 共 76 行

CC
76
字号
#include "program.h"#include <stdio.h>			// printf()//#include <allegro.h>// vector-scheduled threads should be able to modify registers, globally.// ------ --------- --------- --------- --------- --------- --------- ---------program::~program(){//   unlock( ( void* )this, sizeof( program ) );}extern void draw();program::program(){   exit = -1;//   loop = FALSE;//   step = FALSE;//   lock( ( void* )this, sizeof( program ) );//   surface = new term;}// ------ --------- --------- --------- --------- --------- --------- ---------//#include <stdio.h>//#include <conio.h>/*void program::time( void* state ){//   surface -> write( '%', 0, 0 );   if( surface -> timing )      surface -> pipe( '%' );   delete ( word* )state;}*/#include "thread.h" // spawnchar letter = 'A';void program::key( void* state ){   byte k = *( byte* )state;//   printf( "x" );//   fflush( stdout );   que -> stamp = *( timeval* )( ( byte* )state + 1 );/*   if( !( k & 0x80 ) )   {      char lcase = "qwertyuiop    asdfghjkl     zxcvbnm"[ k - 0x10 ];      dword* _state = new dword[ 2 ];      _state[ 0 ] = 0; //cursor;      _state[ 1 ] = lcase; //q -> input;      spawn( &vector::mcast, _state );   }*/   *( kbd* )this = ( char )k; // overloaded   if( xmit ) que -> xmit();   xmit = false;//   printf( "x" ); // doesn't happen for a letter//   fflush( stdout );   delete[] ( byte* )state;}void term( int signal );void program::mcast( void* state ){//   printf( "y" );//   fflush( stdout );  que -> disperse();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?