main() { int frame,halt=0,storea=0; int a,b,c,y,ya,ysz,ysza,xsc,spd=10,la; int y1,y2,y1a,y2a,ly1a; dis_partstart(); for(a=0;a<200;a++) row[a]=rowdata1[a]; for(a=0;a<200;a++) row[a+200]=rowdata2[a]; frame=0; ysz=400*16; ysza=-460/6; y=0; y1=0; y1a=500; y2=399*16; y2a=500; for(frame=0;frame<512;frame++) { if(!halt) { y1+=y1a; y2+=y2a; y2a+=9; if(y2>400*16) { y2-=y2a; y2a=-y2a*5/8; } y1a+=9; la=a; a=(y2-y1)-400*16; if((a&0x8000)^(la&0x8000)) { y1a=y1a*5/8; } y1a+=a/20; y2a-=a/20; } if(frame>97) { if(y2>=399*16) { y2=400*16; halt=1; } y1=y2-400*16; } framey1[frame]=y1; framey2[frame]=y2; } _asm mov ax,13h _asm int 10h inittwk(); _asm { mov dx,3c0h mov al,11h out dx,al mov al,255 out dx,al mov al,20h out dx,al } readp(palette,-1,pic); for(y=0;y<400;y++) { readp(rowbuf,y,pic); memcpy(row[y],rowbuf+70,184); } setpalarea(palette,0,256); for(y=0;y<400;y++) lasty[y]=lasts[y]=-1; dis_waitb(); scrolly(400); dis_waitb(); for(y=0;y<400;y++) { linezoom(vram+y*80,row[y],184); } a=64; y=400*64; while(y>0) { y-=a; a+=6; if(y<0) y=0; scrolly(y/64); dis_waitb(); } storea=a; dis_waitb(); doit(); //_asm mov ax,3 //_asm int 10h //printf("%i\n",storea); return(0); }
beg_main() { char far *vram=MK_FP(0x0a000,0); int a,b,c,y; unsigned char al; dis_partstart(); outp(0x3c4,2); outp(0x3c5,15); memset(vram,15,32768); memset(vram+32768,15,32768); //_asm mov ax,80h+13h //_asm int 10h for(a=0;a<32;a++) dis_waitb(); outp(0x3c8,0); for(a=0;a<255;a++) { outp(0x3c9,63); outp(0x3c9,63); outp(0x3c9,63); } outp(0x3c9,0); outp(0x3c9,0); outp(0x3c9,0); inp(0x3da); outp(0x3c0,0x11); outp(0x3c0,255); outp(0x3c0,0x20); //inittwk(); outport(0x3D4, 0x000C); outport(0x3D4, 0x000D); outp(0x3D4, 9); al = inp(0x3D5); al &= ~0x80; al &= ~31; outp(0x3D5, al); outp(0x3C0, 0x11); outp(0x3C0, 0); outp(0x3C0, 32); outp(0x3C0, 0x11); outp(0x3C0, 255); outp(0x3C0, 0x20); readp(palette,-1,pic); for(y=0;y<400;y++) { readp(rowbuf,y,pic); lineblit(vram+(unsigned)y*80U,rowbuf); } for(c=0;c<=128;c++) { for(a=0;a<768-3;a++) pal2[a]=((128-c)*63+palette[a]*c)/128; dis_waitb(); setpalarea(pal2,0,254); } setpalarea(palette,0,254); }
void plot( /* plot meta-file */ FILE *infp ) { PRIMITIVE nextp; do { readp(&nextp, infp); while (isprim(nextp.com)) { doprim(&nextp); readp(&nextp, infp); } } while (doglobal(&nextp)); }
static PyObject* evaluate(PyObject* self, PyObject *args){ ri = 0; oi = 0; if (!PyArg_ParseTuple(args, "s#|d", &input_buffer, &ibl, &timeout)) { return NULL; } timeout = timeout * 1000; //convert to seconds readp(0); return PyUnicode_DecodeLatin1(output_buffer, oi, NULL); }
int main() { readp(a); readp(b); int n = 0; for (int i = 0; i < 1001; i++) { a[i] += b[i]; if (a[i] != 0) { n++; } } printf("%d", n); for (int i = 1000; i >= 0; i--) { if (a[i] != 0) { printf(" %d %.1lf", i, a[i]); } } putchar('\n'); return 0; }
main() { int a,b,c,y; dis_partstart(); _asm mov ax,13h _asm int 10h inittwk(); _asm { mov dx,3c0h mov al,11h out dx,al mov al,255 out dx,al mov al,20h out dx,al } readp(palette,-1,pic); for(y=0;y<400;y++) { readp(rowbuf,y,pic); lineblit(vram+(unsigned)y*80U,rowbuf); } for(c=0;c<=128;c++) { for(a=0;a<768-3;a++) pal2[a]=((128-c)*63+palette[a]*c)/128; dis_waitb(); setpalarea(pal2,0,255); } for(a=0;a<300 && !dis_exit();a++) { dis_waitb(); if(dis_muscode(0xf0)==0xf0) break; } }
void readp(cell *p){ int cmd = input_buffer[ri++]; if( cmd == '!' || cmd<0 ){ cell m; m.p=m.n=0; m.v=0; mp=&m; start = clock(); run(); } else{ cell c; c.p = p; c.n=0; c.v=cmd; if(p) p->n = &c; else ip = &c; readp(&c); } }
void plot4( /* put a file into its place on page */ FILE *fp ) { static int nplts = 0; PRIMITIVE curp; pglob(POPEN, 0, SEGNAME); while (readp(&curp, fp)) if (curp.com == PEOP) { pglob(PCLOSE, 0200, NULL); doseg(nplts++ % 4); pglob(POPEN, 0, SEGNAME); } else writep(&curp, pout); pglob(PCLOSE, 0200, NULL); }
void sort( /* sort primitives according to pcmp */ FILE *infp, int (*pcmp)() /* compares pointers to pointers to primitives! */ ) { PRIMITIVE *prims[PBSIZE]; /* pointers to primitives */ PLIST primlist; /* our primitives list */ int nprims; short done; do { for (nprims = 0; nprims < PBSIZE; nprims++) { /* read to global */ if ((prims[nprims] = palloc()) == NULL) error(SYSTEM, "memory exhausted in sort"); readp(prims[nprims], infp); if (isglob(prims[nprims]->com)) break; } qsort(prims, nprims, sizeof(*prims), pcmp); /* sort pointer array */ if (nprims < PBSIZE) /* tack on global if one */ nprims++; order(prims, nprims, &primlist); /* make array into list */ sendsort(&primlist, pcmp); /* send to merge sorter */ done = primlist.pbot->com == PEOF; plfree(&primlist); /* free up array */ } while (!done); }
main() { int a,b,x,y; int zimz; initvideo(); readp(palette,-1,hzpic); for(y=0;y<256;y++) { readp(rowbuf,y,hzpic); lineblit(y+64,rowbuf); } for(y=0;y<32;y++) { readp(font[y],y+300,hzpic); for(a=0;a<640;a++) { switch(font[y][a]) { case 0x40 : b=0xc0; break; case 0x41 : b=0x80; break; case 0x42 : b=0x40; break; default : b=0; } font[y][a]=b; } } for(y=0;y<768;y+=3) { if(y<64*3) ; else if(y<128*3) { palette2[y+0]=palette[0x42*3+0]; palette2[y+1]=palette[0x42*3+1]; palette2[y+2]=palette[0x42*3+2]; } else if(y<192*3) { palette2[y+0]=palette[0x41*3+0]; palette2[y+1]=palette[0x41*3+1]; palette2[y+2]=palette[0x41*3+2]; } else { palette2[y+0]=palette[0x40*3+0]; palette2[y+1]=palette[0x40*3+1]; palette2[y+2]=palette[0x40*3+2]; } } for(y=192;y<768;y++) { palette[y]=palette[y-192]; } for(x=0;x<64;x++) { for(y=0;y<576;y++) { fade1[x][y]=(palette2[y+192]*x+palette[y+192]*(63-x))/63; fade2[x][y]=(palette2[y+192]*x)/63; } } for(x=0;x<640 && *fonaorder;) { while(x<640) { for(y=0;y<32;y++) if(font[y][x]) break; if(y!=32) break; x++; } b=x; while(x<640) { for(y=0;y<32;y++) if(font[y][x]) break; if(y==32) break; x++; } //printf("%c: %i %i\n",*fonaorder,b,x-b); fonap[*fonaorder]=b; fonaw[*fonaorder]=x-b; fonaorder++; } fonap[32]=640-20; fonaw[32]=16; setpalarea(fade2[0],64,192); for(;;) { prtc(160,140,"A"); prtc(160,180,"Future Crew"); prtc(160,220,"production"); dofade2(300); if(kbhit()) break; prtc(160,140,"First presented at"); prtc(160,220,"Assembly NoNumbers"); dofade2(300); if(kbhit()) break; dofadef(); if(kbhit()) break; prtc(100,140,"Graphics"); prtc(100,200,"Pixel"); prtc(100,240,"Marvel"); dofade(300); if(kbhit()) break; prtc(100,140,"Music"); prtc(100,200,"Purple Motioon"); prtc(100,240,"Skaven"); dofade(300); if(kbhit()) break; prtc(100,140,"Code"); prtc(100,200,"Trug"); prtc(100,240,"Wildfire"); prtc(100,280,"Psi"); dofade(300); if(kbhit()) break; } getch(); deinitvideo(); }
main() { int a,b,c,y; dis_partstart(); outp(0x3c4,2); outp(0x3c5,15); memset(vram,15,32768); memset(vram+32768,15,32768); //_asm mov ax,80h+13h //_asm int 10h for(a=0;a<32;a++) dis_waitb(); outp(0x3c8,0); for(a=0;a<255;a++) { outp(0x3c9,63); outp(0x3c9,63); outp(0x3c9,63); } outp(0x3c9,0); outp(0x3c9,0); outp(0x3c9,0); inp(0x3da); outp(0x3c0,0x11); outp(0x3c0,255); outp(0x3c0,0x20); //inittwk(); _asm { mov dx,3d4h mov ax,000ch out dx,ax mov ax,000dh out dx,ax mov al,9 out dx,al inc dx in al,dx and al,not 80h and al,not 31 out dx,al mov dx,3c0h mov al,11h out dx,al mov al,0 out dx,al mov al,32 out dx,al } _asm { mov dx,3c0h mov al,11h out dx,al mov al,255 out dx,al mov al,20h out dx,al } readp(palette,-1,pic); for(y=0;y<400;y++) { readp(rowbuf,y,pic); lineblit(vram+(unsigned)y*80U,rowbuf); } for(c=0;c<=128;c++) { for(a=0;a<768-3;a++) pal2[a]=((128-c)*63+palette[a]*c)/128; dis_waitb(); setpalarea(pal2,0,254); } setpalarea(palette,0,254); }
void pmergesort( /* merge sorted files with list */ FILE *fi[], /* array of input files */ int nf, /* number of input files */ PLIST *pl, /* sorted list */ int (*pcmp)(), /* comparison function, takes primitive handles */ FILE *ofp /* output file */ ) { PRIMITIVE *plp; /* position in list */ PRIMITIVE *pp[NFILES]; /* input primitives */ int minf = 0; PRIMITIVE *minp; register int i; if (pl == NULL) plp = NULL; /* initialize list */ else plp = pl->ptop; for (i = 0; i < nf; i++) { /* initialize input files */ if ((pp[i] = palloc()) == NULL) error(SYSTEM, "memory exhausted in pmergesort"); readp(pp[i], fi[i]); } for ( ; ; ) { if (plp != NULL && isprim(plp->com)) minp = plp; else minp = NULL; for (i = 0; i < nf; i++) if (isprim(pp[i]->com) && (minp == NULL || (*pcmp)(&pp[i], &minp) < 0)) minp = pp[minf=i]; if (minp == NULL) break; writep(minp, ofp); if (minp == plp) plp = plp->pnext; else { fargs(pp[minf]); readp(pp[minf], fi[minf]); } } if (plp != NULL && plp->com != PEOF) writep(plp, ofp); for (i = 0; i < nf; i++) { if (pp[i]->com != PEOF) writep(pp[i], ofp); pfree(pp[i]); } }