- Timestamp:
- 07/15/2017 11:15:58 AM (7 years ago)
- Branches:
- master
- Children:
- c80943f
- Parents:
- 09d1345
- Location:
- vlib
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
vlib/glcinit.c
r09d1345 rbf89cfb 9 9 Initializes the GLC. 10 10 11 unsigned12 11 GLCcrc(row, col) 13 unsigned row, col;14 12 15 13 Positions the GLC cursor at ('row', 'col') preparatory 16 14 to writing text. Returns the calculated cursor address. 17 15 18 unsigned19 16 GLCcxy(x, y) 20 unsigned x, y;21 17 22 18 Positions the GLC cursor at ('x', 'y') preparatory to … … 26 22 27 23 GLCwrts(s) 28 char *s;29 24 30 25 Writes the character string pointed to by 's' at the … … 34 29 35 30 GLCtext(row, col, s) 36 unsigned row, col;37 char *s;38 31 39 32 Sets the GLC cursor to ('row', 'col'), then writes the … … 43 36 44 37 GLCdisp(dsp, crs, blk1, blk2, blk3) 45 short dsp, crs, blk1, blk2, blk3;46 38 47 39 Sets the overall display, cursor and block status values. 48 40 49 41 GLCcurs(crs) 50 short crs;51 42 52 43 Turns the cursor on or off. … … 56 47 #include "ram.h" 57 48 58 uint16_tlcdbase; /* LCD graphics base address */59 uint16_tlcdbit; /* LCD graphics pixel bit mask */60 uint16_tlcdcol; /* LCD text column */61 uint16_tlcdctl1; /* LCD display control -- command */62 uint16_tlcdctl2; /* LCD display control -- data */63 uint16_tlcdcurs; /* LCD graphics pixel byte address */64 uint16_tlcdrow; /* LCD text row */65 uint16_tlcdx; /* LCD graphics x */66 uint16_tlcdy; /* LCD graphics y */49 int32_t lcdbase; /* LCD graphics base address */ 50 int16_t lcdbit; /* LCD graphics pixel bit mask */ 51 int16_t lcdcol; /* LCD text column */ 52 int16_t lcdctl1; /* LCD display control -- command */ 53 int16_t lcdctl2; /* LCD display control -- data */ 54 int32_t lcdcurs; /* LCD graphics pixel byte address */ 55 int16_t lcdrow; /* LCD text row */ 56 int16_t lcdx; /* LCD graphics x */ 57 int16_t lcdy; /* LCD graphics y */ 67 58 68 59 /* GLC initialization values */ 69 60 70 int8_t glc_is1[] = { 0x12, 0x05, 0x07, 0x54, 0x58, 0x3F, 0x55, 0x00 };71 int8_t glc_is2[] = { 0x00, 0x00, 0x3F, 0x00, 0x20, 0x3F, 0x00, 0x00 };61 uint8_t glc_is1[] = { 0x12, 0x05, 0x07, 0x54, 0x58, 0x3F, 0x55, 0x00 }; 62 uint8_t glc_is2[] = { 0x00, 0x00, 0x3F, 0x00, 0x20, 0x3F, 0x00, 0x00 }; 72 63 73 64 /* … … 88 79 lcdctl2 = val; 89 80 90 LCD_WC = lcdctl1;91 LCD_WD = lcdctl2;81 LCD_WC = (uint8_t)lcdctl1; 82 LCD_WD = (uint8_t)lcdctl2; 92 83 93 84 } … … 103 94 lcdctl2 = (crs & 3) | (lcdctl2 & ~3); 104 95 105 LCD_WC = lcdctl1;106 LCD_WD = lcdctl2;96 LCD_WC = (uint8_t)lcdctl1; 97 LCD_WD = (uint8_t)lcdctl2; 107 98 } 108 99 … … 118 109 register int16_t i; 119 110 register int32_t ic; 120 register int8_t *gp;111 register uint8_t *gp; 121 112 122 113 lcdbase = G_PLANE2; /* set defaults for graphics variables */ … … 135 126 136 127 for (i = 0; i < 8; i++) 137 LCD_WD = *gp++;128 LCD_WD = *gp++; 138 129 139 130 LCD_WC = G_SETSAD; /* setup scroll registers */ … … 184 175 */ 185 176 186 uint16_t GLCcrc(uint16_t row, uint16_t col)187 { 188 uint16_t curad;177 int16_t GLCcrc(int16_t row, int16_t col) 178 { 179 int16_t curad; 189 180 190 181 curad = col + (row * 85); /* calculate cursor location */ 191 182 192 183 LCD_WC = G_CRSWR; /* send cursor address to GLC */ 193 LCD_WD = curad & 0xFF;194 LCD_WD = ( curad >> 8) & 0xFF;184 LCD_WD = (uint8_t)(curad & 0xFF); 185 LCD_WD = (uint8_t)((curad >> 8) & 0xFF); 195 186 196 187 lcdrow = row; /* set text cursor variables */ … … 210 201 */ 211 202 212 uint16_t GLCcxy(uint16_t x, uint16_t y)213 { 214 register uint16_t curad, xby6;203 int16_t GLCcxy(int16_t x, int16_t y) 204 { 205 register int32_t curad, xby6; 215 206 216 207 /* calculate cursor address */ … … 223 214 224 215 LCD_WC = G_CRSWR; 225 LCD_WD = curad & 0xFF;226 LCD_WD = ( curad >> 8) & 0xFF;216 LCD_WD = (uint8_t)(curad & 0xFF); 217 LCD_WD = (uint8_t)((curad >> 8) & 0xFF); 227 218 228 219 /* set graphics variables */ … … 256 247 while (*s) { /* write string to GLC */ 257 248 258 LCD_WD = *s++;249 LCD_WD = (uint8_t)*s++; 259 250 lcdcol++; /* keep column variable up to date */ 260 251 } … … 271 262 */ 272 263 273 void GLCtext( uint16_t row, uint16_t col, int8_t *s)274 { 275 register uint16_t curad;264 void GLCtext(int16_t row, int16_t col, int8_t *s) 265 { 266 register int16_t curad; 276 267 277 268 curad = col + (row * 85); /* calculate cursor address */ 278 269 279 270 LCD_WC = G_CRSWR; /* send cursor address to GLC */ 280 LCD_WD = curad & 0xFF;281 LCD_WD = ( curad >> 8) & 0xFF;271 LCD_WD = (uint8_t)(curad & 0xFF); 272 LCD_WD = (uint8_t)((curad >> 8) & 0xFF); 282 273 283 274 lcdrow = row; /* set GLC text cursor variables */ … … 290 281 while (*s) { /* write string to GLC */ 291 282 292 LCD_WD = *s++;283 LCD_WD = (uint8_t)*s++; 293 284 lcdcol++; /* keep cursor column up to date */ 294 285 } -
vlib/glcinit.x
r09d1345 rbf89cfb 15 15 */ 16 16 17 extern int8_t glc_is1[];18 extern int8_t glc_is2[];19 extern uint16_tlcdbase;20 extern uint16_tlcdbit;21 extern uint16_tlcdcol;22 extern uint16_tlcdctl1;23 extern uint16_tlcdctl2;24 extern uint16_tlcdcurs;25 extern uint16_tlcdrow;26 extern uint16_tlcdx;27 extern uint16_tlcdy;17 extern uint8_t glc_is1[]; 18 extern uint8_t glc_is2[]; 19 extern int32_t lcdbase; 20 extern int16_t lcdbit; 21 extern int16_t lcdcol; 22 extern int16_t lcdctl1; 23 extern int16_t lcdctl2; 24 extern int32_t lcdcurs; 25 extern int16_t lcdrow; 26 extern int16_t lcdx; 27 extern int16_t lcdy; 28 28 29 29 /* … … 33 33 */ 34 34 35 extern uint16_t GLCcrc(uint16_t row, uint16_t col);35 extern int16_t GLCcrc(int16_t row, int16_t col); 36 36 extern void GLCcurs(int16_t crs); 37 extern uint16_t GLCcxy(uint16_t x, uint16_t y);37 extern int16_t GLCcxy(int16_t x, int16_t y); 38 38 extern void GLCdisp(int16_t dsp, int16_t crs, int16_t blk1, int16_t blk2, int16_t blk3); 39 39 extern void GLCinit(void); 40 extern void GLCtext( uint16_t row, uint16_t col, int8_t *s);40 extern void GLCtext(int16_t row, int16_t col, int8_t *s); 41 41 extern void GLCwrts(int8_t *s); -
vlib/vhinit.c
r09d1345 rbf89cfb 18 18 #include "ram.h" 19 19 20 #define VREG(h, v) ((h<<10)|v)20 #define VREG(h, v) (h * 1024u + v) 21 21 22 22 struct octent v_obtab[16]; /* object control table */ … … 29 29 /* initialized variables */ 30 30 31 int16_t vr_data[] = {31 uint16_t vr_data[] = { 32 32 33 33 0x825B, /* R0 -- Mode word 0 */ -
vlib/vhinit.x
r09d1345 rbf89cfb 20 20 extern int16_t v_obpri; 21 21 extern struct octent v_obtab[16]; 22 extern int16_tvr_data[];22 extern uint16_t vr_data[]; 23 23 24 24 /* -
vlib/vmput.c
r09d1345 rbf89cfb 23 23 tr = row; 24 24 25 while ( cp = *ms++) {25 while ((cp = *ms++)) { 26 26 27 27 tc = col; 28 28 29 while ( c = *cp++)29 while ((c = *cp++)) 30 30 vputc(obase, tr, tc++, c, ma); 31 31 … … 49 49 tr = row; 50 50 51 while ( cp = *ms++) {51 while ((cp = *ms++)) { 52 52 53 53 tc = col; 54 54 tm = *ma++; 55 55 56 while ( c = *cp++)56 while ((c = *cp++)) 57 57 vputc(obase, tr, tc++, c, *tm++); 58 58 -
vlib/vobjfns.c
r09d1345 rbf89cfb 6 6 7 7 SelObj(obj) 8 int obj;9 8 10 9 Select 'obj' as the current working object. 11 10 12 11 SetPri(obj, pri) 13 int obj, pri;14 12 15 13 Display object 'obj' with priority 'pri'. 16 14 17 15 SetObj(obj, type, bank, base, xpix, ypix, x0, y0, flags, pri) 18 int obj, type, bank, xpix, ypix, x0, y0, flags, pri;19 unsigned int *base;20 16 21 17 Setup object 'obj' of type 'type' at 'base' in bank 'bank' … … 27 23 28 24 CpyObj(from, to, w, h, sw) 29 unsigned int *from, *to;30 int w, h, sw;31 25 32 26 Copy a 'w'-word by 'h'-line object from 'from' to 'to' with … … 51 45 #include "ram.h" 52 46 47 typedef void (**intvec)(void); 48 53 49 int16_t wsize; /* object width calculated by SetObj() */ 54 50 int16_t vi_dis; /* disable use of VIint */ … … 96 92 97 93 op = &v_obtab[obj]; /* point at the object table */ 98 op->opri = pri;/* set the priority */94 op->opri = (int8_t)pri; /* set the priority */ 99 95 100 96 v_odtab[pri][0] = op->odtw0 | V_BLA; /* start object as blanked */ 101 97 v_odtab[pri][1] = op->odtw1; 102 v_odtab[pri][2] = ( (int32_t)op->obase >> 1) & 0xFFFF;98 v_odtab[pri][2] = (uint16_t)(((int32_t)op->obase >> 1) & 0xFFFF); 103 99 104 100 objon(pri, op->objy, op->ysize); /* enable access table bits */ … … 111 107 vi_ctl |= (1u << pri); /* set unblank bit */ 112 108 113 if (*( (int32_t *)0x000064)NE &VIint) /* make sure VI vector is set */109 if (*(intvec)0x000064 NE &VIint) /* make sure VI vector is set */ 114 110 BIOS(B_SETV, 25, VIint); 115 111 … … 142 138 op->objy = y0; 143 139 op->obase = base; 144 op->opri = pri;140 op->opri = (int8_t)pri; 145 141 op->obank = bank & 3; 146 142 -
vlib/vputs.c
r09d1345 rbf89cfb 27 27 int16_t c; 28 28 29 while ( c = *str++) {29 while ((c = *str++)) { 30 30 31 31 vputc(obase, row, col, c, attr); … … 54 54 int16_t c; 55 55 56 while ( c = *str++) {56 while ((c = *str++)) { 57 57 58 58 vputc(obase, row, col, c, *attr++);
Note:
See TracChangeset
for help on using the changeset viewer.