Changeset bf89cfb in buchla-68k
- Timestamp:
- 07/15/2017 11:15:58 AM (7 years ago)
- Branches:
- master
- Children:
- c80943f
- Parents:
- 09d1345
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
include/glcdefs.h
r09d1345 rbf89cfb 10 10 #include "stdint.h" 11 11 12 #define G_INIT (int8_t)0x4013 #define G_MWRITE (int8_t)0x4214 #define G_MREAD (int8_t)0x4315 #define G_SETSAD (int8_t)0x4416 #define G_CRSWR (int8_t)0x4617 #define G_CRSRD (int8_t)0x4718 #define G_CRSMRT (int8_t)0x4C19 #define G_CRSMLT (int8_t)0x4D20 #define G_CRSMUP (int8_t)0x4E21 #define G_CRSMDN (int8_t)0x4F22 #define G_ERASE (int8_t)0x5223 #define G_SLEEP (int8_t)0x5324 #define G_DSPCTL (int8_t)0x5825 #define G_HSCRL (int8_t)0x5A26 #define G_OVRLAY (int8_t)0x5B27 #define G_CGRAM (int8_t)0x5C28 #define G_CRSFRM (int8_t)0x5D12 #define G_INIT 0x40 13 #define G_MWRITE 0x42 14 #define G_MREAD 0x43 15 #define G_SETSAD 0x44 16 #define G_CRSWR 0x46 17 #define G_CRSRD 0x47 18 #define G_CRSMRT 0x4C 19 #define G_CRSMLT 0x4D 20 #define G_CRSMUP 0x4E 21 #define G_CRSMDN 0x4F 22 #define G_ERASE 0x52 23 #define G_SLEEP 0x53 24 #define G_DSPCTL 0x58 25 #define G_HSCRL 0x5A 26 #define G_OVRLAY 0x5B 27 #define G_CGRAM 0x5C 28 #define G_CRSFRM 0x5D 29 29 30 30 #define LCD_WC lcd_a1 … … 33 33 #define LCD_RD lcd_a1 34 34 35 #define G_PLANE1 (uint16_t)0x000036 #define G_PLANE2 (uint16_t)0x200035 #define G_PLANE1 0x0000 36 #define G_PLANE2 0x2000 37 37 38 38 #define G_OFF 0 /* off */ -
include/instdsp.h
r09d1345 rbf89cfb 110 110 111 111 struct pflent *nextpf; /* next entry pointer */ 112 uint16_tpftrig; /* trigger number */113 uint16_tpfvpval; /* voice / parameter number */112 int16_t pftrig; /* trigger number */ 113 int16_t pfvpval; /* voice / parameter number */ 114 114 int32_t d1reg; /* D1 register contents */ 115 115 int32_t d2reg; /* D2 register contents */ -
include/objdefs.h
r09d1345 rbf89cfb 19 19 int32_t F_Res1; /* Reserved area #1 */ 20 20 int32_t F_Res2; /* Reserved area #2 -- text origin */ 21 uint16_tF_Res3; /* Reserved area #3 -- flag word */21 int16_t F_Res3; /* Reserved area #3 -- flag word */ 22 22 23 23 /* data origin - long */ … … 25 25 }; 26 26 27 #define F_R_C 0x601A /* Magic for contiguous file */28 #define F_R_D 0x601B /* Magic for discontiguous file */27 #define F_R_C 0x601Au /* Magic for contiguous file */ 28 #define F_R_D 0x601Bu /* Magic for discontiguous file */ 29 29 30 30 struct SYMBOL { /* Symbol table entry -- 14 bytes */ … … 35 35 }; 36 36 37 #define S_Def 0x8000 /* Defined */38 #define S_Equ 0x4000 /* Equated */39 #define S_Glb 0x2000 /* Global */40 #define S_Reg 0x1000 /* Equated register */41 #define S_Ext 0x0800 /* External reference */42 #define S_Data 0x0400 /* Data based relocatable */43 #define S_Text 0x0200 /* Text based relocatable */44 #define S_BSS 0x0100 /* BSS based relocatable */37 #define S_Def 0x8000u /* Defined */ 38 #define S_Equ 0x4000u /* Equated */ 39 #define S_Glb 0x2000u /* Global */ 40 #define S_Reg 0x1000u /* Equated register */ 41 #define S_Ext 0x0800u /* External reference */ 42 #define S_Data 0x0400u /* Data based relocatable */ 43 #define S_Text 0x0200u /* Text based relocatable */ 44 #define S_BSS 0x0100u /* BSS based relocatable */ -
include/smdefs.h
r09d1345 rbf89cfb 14 14 struct sment *nxt; 15 15 struct sment *prv; 16 uint16_tvp;17 uint16_tsm;16 int16_t vp; 17 int16_t sm; 18 18 }; 19 19 -
libsm/memset.c
r09d1345 rbf89cfb 11 11 #include "ram.h" 12 12 13 void *memset(void *vp, int8_t c, int16_t n)13 void *memset(void *vp, uint8_t c, int16_t n) 14 14 { 15 int8_t *cp = vp;15 uint8_t *cp = vp; 16 16 17 17 while (--n >= 0) -
libsm/memset.x
r09d1345 rbf89cfb 15 15 */ 16 16 17 extern void *memset(void *vp, int8_t c, int16_t n);17 extern void *memset(void *vp, uint8_t c, int16_t n); -
libsm/memsetw.c
r09d1345 rbf89cfb 11 11 #include "ram.h" 12 12 13 void *memsetw(void *vp, int16_t s, int16_t n)13 void *memsetw(void *vp, uint16_t s, int16_t n) 14 14 { 15 int16_t *sp = vp;15 uint16_t *sp = vp; 16 16 17 17 while (--n >= 0) -
libsm/memsetw.x
r09d1345 rbf89cfb 15 15 */ 16 16 17 extern void *memsetw(void *vp, int16_t s, int16_t n);17 extern void *memsetw(void *vp, uint16_t s, int16_t n); -
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.