|
|
1.1 ! root 1: #include <stdio.h> ! 2: #include <libc.h> ! 3: #include "3610op.h" ! 4: ! 5: minit(cold) ! 6: { ! 7: msnare(); ! 8: mcmd(INI); ! 9: mcmd(WRMSKL); mlong(0xffffffff); ! 10: mcmd(WRBANK); mbyte(15); ! 11: mcmd(SELRES); mbyte(0xc0); mbyte(0); /* 8-bit mode */ ! 12: mcmd(MOVP1); mword(0); mword(0); /* blank screen */ ! 13: mcmd(MOVP2); mword(1279); mword(1023); ! 14: mcmd(SETCLL); mbyte(0); mbyte(255); mbyte(255); mbyte(255); ! 15: mcmd(FFILL); ! 16: } ! 17: ! 18: colmap(maxi,mapr,mapg,mapb) ! 19: int maxi; ! 20: int mapr[],mapg[],mapb[]; /* colors, 0 through maxi */ ! 21: { ! 22: int i; ! 23: mcmd(CMSEL); mbyte(0); mbyte(0); /* write in cmap buffer 0 */ ! 24: mcmd(CMFILL);mword(0);mword(256); /* initialize map to black */ ! 25: mbyte(0);mbyte(0);mbyte(0);mbyte(0); ! 26: mcmd(CMLDM); mword(0);mword(maxi+1); /* load entries at loc. 0 */ ! 27: for(i=0; i<=maxi; i++){ ! 28: mbyte(mapr[i]); mbyte(mapg[i]); mbyte(mapb[i]); ! 29: } ! 30: if((maxi+1)&1) mbyte(0); ! 31: mcmd(CMACT); /* make current buffer active */ ! 32: mflush(); ! 33: } ! 34: ! 35: image(in, x0, y0, x1, y1) ! 36: char *in; ! 37: { ! 38: int around=0; ! 39: int y2; ! 40: long n, saved, m; ! 41: if(((int)in)&1){ error("odd address\n"); } ! 42: n=(x1-x0+1)*(y1-y0+1); ! 43: mcmd(MOVP1); mword(x0); mword(1023-y1); /* upper left */ ! 44: mcmd(MOVP2); mword(x1); mword(1023-y0); /* lower right */ ! 45: mcmd(WRR); ! 46: mflush(); ! 47: Write(mfd, in, n); ! 48: if(n&1) mbyte(0); ! 49: } ! 50: ! 51: zoom(fact) ! 52: int fact; ! 53: { ! 54: mcmd(ZOOM);mbyte(fact); ! 55: } ! 56: ! 57: pan(x,y) ! 58: int x, y; /* upper left corner */ ! 59: { ! 60: mcmd(MOVP1);mword(x);mword(1023-y); ! 61: mcmd(PPAN); ! 62: mflush(); ! 63: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.