- Timestamp:
- 07/15/2017 10:03:02 AM (7 years ago)
- Branches:
- master
- Children:
- bf89cfb
- Parents:
- 6a37d5b
- Location:
- vlib
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
vlib/vbfill4.c
r6a37d5b r09d1345 10 10 #include "ram.h" 11 11 12 static int16_t fm[] = { /* fill masks */12 static uint16_t fm[] = { /* fill masks */ 13 13 14 14 0x000F, … … 60 60 wp = fwp; 61 61 fwp += obwidth; 62 *wp++ = (*wp & ~lmask) | (color & lmask); 63 64 for (j = 0; j < mw; j++) 65 *wp++ = color; 66 67 *wp = (*wp & ~rmask) | (color & rmask); 68 } 69 70 } else { 71 72 rmask = fm[width & 3]; 73 74 for (i = 0; i < nl; i++) { 75 76 wp = fwp; 77 fwp += obwidth; 78 *wp++ = (*wp & ~lmask) | (color & lmask); 62 *wp = (*wp & ~lmask) | (color & lmask); 63 wp++; 64 65 for (j = 0; j < mw; j++) 66 *wp++ = color; 67 68 *wp = (*wp & ~rmask) | (color & rmask); 69 } 70 71 } else { 72 73 rmask = fm[width & 3]; 74 75 for (i = 0; i < nl; i++) { 76 77 wp = fwp; 78 fwp += obwidth; 79 *wp = (*wp & ~lmask) | (color & lmask); 80 wp++; 79 81 *wp = (*wp & ~rmask) | (color & rmask); 80 82 } … … 112 114 wp = fwp; 113 115 fwp += obwidth; 114 *wp++ = (*wp & ~lmask) | (color & lmask); 115 116 for (j = 0; j < mw; j++) 117 *wp++ = color; 118 119 *wp = (*wp & ~rmask) | (color & rmask); 120 } 121 122 } else { 123 124 rmask = fm[width & 3]; 125 126 for (i = 0; i < nl; i++) { 127 128 wp = fwp; 129 fwp += obwidth; 130 *wp++ = (*wp & ~lmask) | (color & lmask); 116 *wp = (*wp & ~lmask) | (color & lmask); 117 wp++; 118 119 for (j = 0; j < mw; j++) 120 *wp++ = color; 121 122 *wp = (*wp & ~rmask) | (color & rmask); 123 } 124 125 } else { 126 127 rmask = fm[width & 3]; 128 129 for (i = 0; i < nl; i++) { 130 131 wp = fwp; 132 fwp += obwidth; 133 *wp = (*wp & ~lmask) | (color & lmask); 134 wp++; 131 135 *wp = (*wp & ~rmask) | (color & rmask); 132 136 } … … 164 168 wp = fwp; 165 169 fwp += obwidth; 166 *wp++ = (*wp & ~lmask) | (color & lmask); 167 168 for (j = 0; j < mw; j++) 169 *wp++ = color; 170 171 *wp = (*wp & ~rmask) | (color & rmask); 172 } 173 174 } else { 175 176 rmask = fm[width & 3]; 177 178 for (i = 0; i < nl; i++) { 179 180 wp = fwp; 181 fwp += obwidth; 182 *wp++ = (*wp & ~lmask) | (color & lmask); 170 *wp = (*wp & ~lmask) | (color & lmask); 171 wp++; 172 173 for (j = 0; j < mw; j++) 174 *wp++ = color; 175 176 *wp = (*wp & ~rmask) | (color & rmask); 177 } 178 179 } else { 180 181 rmask = fm[width & 3]; 182 183 for (i = 0; i < nl; i++) { 184 185 wp = fwp; 186 fwp += obwidth; 187 *wp = (*wp & ~lmask) | (color & lmask); 188 wp++; 183 189 *wp = (*wp & ~rmask) | (color & rmask); 184 190 } … … 216 222 wp = fwp; 217 223 fwp += obwidth; 218 *wp++ = (*wp & ~lmask) | (color & lmask); 224 *wp = (*wp & ~lmask) | (color & lmask); 225 wp++; 219 226 220 227 for (j = 0; j < mw; j++) … … 232 239 wp = fwp; 233 240 fwp += obwidth; 234 *wp++ = (*wp & ~lmask) | (color & lmask); 241 *wp = (*wp & ~lmask) | (color & lmask); 242 wp++; 235 243 *wp = (*wp & ~rmask) | (color & rmask); 236 244 } -
vlib/vclrs.c
r6a37d5b r09d1345 6 6 7 7 vclrs(obase, row, col, nc, ch, atr) 8 unsigned int obase[];9 int row, col, nc, ch, atr;10 8 11 9 Clear 'nc' characters in the text object 'obase' to 'ch', … … 24 22 */ 25 23 26 void vclrs(uint16_t obase[], int16_t row, int16_t col, int16_t nc, int16_t ch, int16_t atr)24 void vclrs(uint16_t *obase, int16_t row, int16_t col, int16_t nc, int16_t ch, uint16_t attr) 27 25 { 28 26 while (nc--) 29 vputc(obase, row, col++, ch, at r);27 vputc(obase, row, col++, ch, attr); 30 28 } -
vlib/vclrs.x
r6a37d5b r09d1345 15 15 */ 16 16 17 extern void vclrs(uint16_t obase[], int16_t row, int16_t col, int16_t nc, int16_t ch, int16_t atr);17 extern void vclrs(uint16_t *obase, int16_t row, int16_t col, int16_t nc, int16_t ch, uint16_t attr); -
vlib/vmput.c
r6a37d5b r09d1345 4 4 Version 3 -- 1987-03-30 -- D.N. Lynx Crowe 5 5 (c) Copyright 1987 -- D.N. Lynx Crowe 6 7 vmput(sbase, row, col, ms, ma)8 uint *sbase, rwo, col, ma;9 char *ms[];10 11 Copies lines from ms, with attribute ma, to sbase at (row,col).12 13 vmputa(sbase, row, col, ms, ma)14 uint *sbase, row, col, *ma;15 char *ms[];16 17 Copies lines from ms, with attributes from ma, to sbase at (row,col).18 6 ============================================================================= 19 7 */ … … 23 11 /* 24 12 ============================================================================= 25 vmput( sbase, row, col, ms, ma) -- put a menu item in a screen image.26 Copies lines from ms, with attribute ma, to sbase at (row,col).13 vmput(obase, row, col, ms, ma) -- put a menu item in a screen image. 14 Copies lines from ms, with attribute ma, to obase at (row,col). 27 15 ============================================================================= 28 16 */ 29 17 30 void vmput(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *ms[], uint16_t ma)18 void vmput(uint16_t *obase, int16_t row, int16_t col, int8_t *ms[], uint16_t ma) 31 19 { 32 register uint16_t c, tc, tr;20 register int16_t c, tc, tr; 33 21 int8_t *cp; 34 22 … … 40 28 41 29 while (c = *cp++) 42 vputc( sbase, tr, tc++, c, ma);30 vputc(obase, tr, tc++, c, ma); 43 31 44 32 tr++; … … 48 36 /* 49 37 ============================================================================= 50 vmputa( sbase, row, col, ms, ma) -- put a menu item in a screen image.51 Copies lines from ms, with attributes from ma, to sbase at (row,col).38 vmputa(obase, row, col, ms, ma) -- put a menu item in a screen image. 39 Copies lines from ms, with attributes from ma, to obase at (row,col). 52 40 ============================================================================= 53 41 */ 54 42 55 void vmputa(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *ms[], uint16_t *ma[])43 void vmputa(uint16_t *obase, int16_t row, int16_t col, int8_t *ms[], uint16_t *ma[]) 56 44 { 57 register uint16_t c, tc, tr;45 register int16_t c, tc, tr; 58 46 uint16_t *tm; 59 47 int8_t *cp; … … 67 55 68 56 while (c = *cp++) 69 vputc( sbase, tr, tc++, c, *tm++);57 vputc(obase, tr, tc++, c, *tm++); 70 58 71 59 tr++; -
vlib/vmput.x
r6a37d5b r09d1345 15 15 */ 16 16 17 extern void vmput(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *ms[], uint16_t ma);18 extern void vmputa(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *ms[], uint16_t *ma[]);17 extern void vmput(uint16_t *obase, int16_t row, int16_t col, int8_t *ms[], uint16_t ma); 18 extern void vmputa(uint16_t *obase, int16_t row, int16_t col, int8_t *ms[], uint16_t *ma[]); -
vlib/vobjfns.c
r6a37d5b r09d1345 69 69 op = &v_obtab[obj]; 70 70 71 newbank = ((op->obank & 0x0001 ) << 8) | ((op->obank & 0x0002) << 6);71 newbank = ((op->obank & 0x0001u) << 8) | ((op->obank & 0x0002u) << 6); 72 72 73 73 v_nobj = obj; … … 109 109 setipl(7); /* disable interrupts */ 110 110 111 vi_ctl |= (1 << pri); /* set unblank bit */111 vi_ctl |= (1u << pri); /* set unblank bit */ 112 112 113 113 if (*((int32_t *)0x000064) NE &VIint) /* make sure VI vector is set */ … … 124 124 */ 125 125 126 void SetObj(int16_t obj, int16_t type, int16_t bank, uint16_t *base, int16_t xpix, int16_t ypix, int16_t x0, int16_t y0, int16_t flags, int16_t pri)126 void SetObj(int16_t obj, int16_t type, int16_t bank, uint16_t *base, int16_t xpix, int16_t ypix, int16_t x0, int16_t y0, uint16_t flags, int16_t pri) 127 127 { 128 128 register struct octent *op; … … 148 148 if (type) { /* character objects */ 149 149 150 op->odtw0 = (flags & 0xF9FF ) | V_CTYPE;150 op->odtw0 = (flags & 0xF9FFu) | V_CTYPE; 151 151 152 152 switch (V_RES3 & op->odtw0) { … … 179 179 } else { /* bitmap objects */ 180 180 181 op->odtw0 = (flags & 0x0E37 ) | (V_BTYPE | ((bank & 3) << 6));181 op->odtw0 = (flags & 0x0E37u) | (V_BTYPE | (((uint16_t)bank & 3u) << 6)); 182 182 183 183 switch (V_RES3 & op->odtw0) { … … 201 201 } 202 202 203 op->odtw1 = (( x0 >> 1) & 0x03FF) | (0xFC00 & (wsize << 10));203 op->odtw1 = (((uint16_t)x0 >> 1) & 0x03FFu) | (0xFC00u & ((uint16_t)wsize << 10)); 204 204 205 205 if (pri < 0) … … 219 219 */ 220 220 221 void CpyObj(uint16_t *from, uint16_t *to, uint16_t w, uint16_t h, uint16_t sw)221 void CpyObj(uint16_t *from, uint16_t *to, int16_t w, int16_t h, int16_t sw) 222 222 { 223 223 register uint16_t *tp; 224 register uint16_t i, j;224 register int16_t i, j; 225 225 226 226 for (i = h; i--; ) { -
vlib/vobjfns.x
r6a37d5b r09d1345 25 25 */ 26 26 27 extern void CpyObj(uint16_t *from, uint16_t *to, uint16_t w, uint16_t h, uint16_t sw);27 extern void CpyObj(uint16_t *from, uint16_t *to, int16_t w, int16_t h, int16_t sw); 28 28 extern void SelObj(int16_t obj); 29 extern void SetObj(int16_t obj, int16_t type, int16_t bank, uint16_t *base, int16_t xpix, int16_t ypix, int16_t x0, int16_t y0, int16_t flags, int16_t pri);29 extern void SetObj(int16_t obj, int16_t type, int16_t bank, uint16_t *base, int16_t xpix, int16_t ypix, int16_t x0, int16_t y0, uint16_t flags, int16_t pri); 30 30 extern void SetPri(int16_t obj, int16_t pri); -
vlib/vputs.c
r6a37d5b r09d1345 16 16 /* 17 17 ============================================================================= 18 vputs( sbase, row, col, str, attrib)18 vputs(obase, row, col, str, attrib) 19 19 20 Write string str to video RAM object pointed to by sbase21 at (row,col) with attr ibused for all characters.20 Write string str to video RAM object pointed to by obase 21 at (row,col) with attr used for all characters. 22 22 ============================================================================= 23 23 */ 24 24 25 void vputs(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib)25 void vputs(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t attr) 26 26 { 27 uint16_t c;27 int16_t c; 28 28 29 29 while (c = *str++) { 30 30 31 vputc( sbase, row, col, c, attrib);31 vputc(obase, row, col, c, attr); 32 32 33 33 if (++col GE 64) { … … 43 43 /* 44 44 ============================================================================= 45 vputsa( sbase, row, col, str, attrib)45 vputsa(obase, row, col, str, attrib) 46 46 47 Write string str in video RAM pointed to by sbase starting48 at (row, col) using attributes from the words pointed to by attr ib.47 Write string str in video RAM pointed to by obase starting 48 at (row, col) using attributes from the words pointed to by attr. 49 49 ============================================================================= 50 50 */ 51 51 52 void vputsa(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib)52 void vputsa(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t *attr) 53 53 { 54 uint16_t c;54 int16_t c; 55 55 56 56 while (c = *str++) { 57 57 58 vputc( sbase, row, col, c, *attrib++);58 vputc(obase, row, col, c, *attr++); 59 59 60 60 if (++col GE 64) { -
vlib/vputs.x
r6a37d5b r09d1345 15 15 */ 16 16 17 extern void vputs(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib);18 extern void vputsa(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib);17 extern void vputs(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t attr); 18 extern void vputsa(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t *attr); -
vlib/vputsv.c
r6a37d5b r09d1345 16 16 /* 17 17 ============================================================================= 18 vputsv( sbase, row, col, str, attrib, len)18 vputsv(obase, row, col, str, attr, len) 19 19 20 Write string str to video RAM object pointed to by sbase21 at (row,col) with attr ibused for all characters. Line length is len.20 Write string str to video RAM object pointed to by obase 21 at (row,col) with attr used for all characters. Line length is len. 22 22 ============================================================================= 23 23 */ 24 24 25 void vputsv(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib, uint16_t len)25 void vputsv(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t attr, int16_t len) 26 26 { 27 uint16_t c;27 int16_t c; 28 28 29 29 while (c = *str++) { 30 30 31 vputcv( sbase, row, col, c, attrib, len);31 vputcv(obase, row, col, c, attr, len); 32 32 33 33 if (++col GE 64) { … … 43 43 /* 44 44 ============================================================================= 45 vputsav( sbase, row, col, str, attrib, len)45 vputsav(obase, row, col, str, attr, len) 46 46 47 Write string str in video RAM pointed to by sbase starting48 at (row, col) using attributes from the words pointed to by attr ib.47 Write string str in video RAM pointed to by obase starting 48 at (row, col) using attributes from the words pointed to by attr. 49 49 Line length is len. 50 50 ============================================================================= 51 51 */ 52 52 53 void vputsav(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib, uint16_t len)53 void vputsav(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t *attr, int16_t len) 54 54 { 55 uint16_t c;55 int16_t c; 56 56 57 57 while (c = *str++) { 58 58 59 vputcv( sbase, row, col, c, *attrib++, len);59 vputcv(obase, row, col, c, *attr++, len); 60 60 61 61 if (++col GE 64) { -
vlib/vputsv.x
r6a37d5b r09d1345 15 15 */ 16 16 17 extern void vputsav(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib, uint16_t len);18 extern void vputsv(uint16_t * sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib, uint16_t len);17 extern void vputsav(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t *attr, int16_t len); 18 extern void vputsv(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t attr, int16_t len); -
vlib/vsetpal.c
r6a37d5b r09d1345 43 43 */ 44 44 45 void vsetpal( uint16_t slot, uint16_t red, uint16_t grn, uint16_t blu)45 void vsetpal(int16_t slot, int16_t red, int16_t grn, int16_t blu) 46 46 { 47 register uint16_t palval;47 register int16_t palval; 48 48 uint16_t *pal; 49 49 … … 55 55 ((blu & 1) << 3) | ((blu & 2) >> 1); 56 56 57 *pal = palval ^ 0x003F;57 *pal = (uint16_t)palval ^ 0x003F; 58 58 } 59 59 -
vlib/vsetpal.x
r6a37d5b r09d1345 23 23 */ 24 24 25 extern void vsetpal( uint16_t slot, uint16_t red, uint16_t grn, uint16_t blu);25 extern void vsetpal(int16_t slot, int16_t red, int16_t grn, int16_t blu); 26 26 extern void vsndpal(int16_t pp[16][3]); -
vlib/vtext.c
r6a37d5b r09d1345 10 10 #include "ram.h" 11 11 12 static int16_t msk[] = { 0xFF00, 0x00FF };12 static uint16_t msk[] = { 0xFF00, 0x00FF }; 13 13 14 void vtext(uint16_t *obj, uint16_t nc, uint16_t row, uint16_t col, int8_t *ip)14 void vtext(uint16_t *obj, int16_t nc, int16_t row, int16_t col, int8_t *ip) 15 15 { 16 16 register uint16_t *op; … … 20 20 op = obj + ((nc >> 1) * row) + (col >> 1); 21 21 22 *op = (*op & (uint16_t)msk[col & 1]) |23 (( *ip++ & 0x00FF) << ((col & 1) ? 8 : 0));22 *op = (*op & msk[col & 1]) | 23 ((uint16_t)(*ip++ & 0x00FF) << ((col & 1) ? 8 : 0)); 24 24 25 25 col++; -
vlib/vtext.x
r6a37d5b r09d1345 15 15 */ 16 16 17 extern void vtext(uint16_t *obj, uint16_t nc, uint16_t row, uint16_t col, int8_t *ip);17 extern void vtext(uint16_t *obj, int16_t nc, int16_t row, int16_t col, int8_t *ip);
Note:
See TracChangeset
for help on using the changeset viewer.