Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

el_Acorn.i

Go to the documentation of this file.
00001 /*
00002  *  el_Acorn.i
00003  *  somewhat faster (on Acorn) versions of the el_-functions of VIC.cc
00004  */
00005 
00006 
00007 #ifdef GLOBAL_VARS
00008 static inline void el_std_text(uint8 *p, uint8 *q, uint8 *r)
00009 #else
00010 inline void MOS6569::el_std_text(uint8 *p, uint8 *q, uint8 *r)
00011 #endif
00012 {
00013         register uint32 *lp = (uint32 *)p, *t;
00014         uint8 *cp = color_line;
00015         uint8 *mp = matrix_line;
00016         uint32 *tab = (uint32*)&TextColorTable[0][b0c][0][0];
00017 
00018         // Loop for 40 characters
00019         for (int i=0; i<40; i++) {
00020                 uint8 data = r[i] = q[mp[i] << 3];
00021 
00022                 t = tab + ((cp[i] & 15) << 13) + (data << 1);
00023                 *lp++ = *t++; *lp++ = *t++;
00024         }
00025 }
00026 
00027 
00028 #ifdef GLOBAL_VARS
00029 static inline void el_mc_text(uint8 *p, uint8 *q, uint8 *r)
00030 #else
00031 inline void MOS6569::el_mc_text(uint8 *p, uint8 *q, uint8 *r)
00032 #endif
00033 {
00034         register uint32 *wp = (uint32 *)p, *t;
00035         uint32 *tab = (uint32*)&TextColorTable[0][b0c][0][0];
00036         uint8 *cp = color_line;
00037         uint8 *mp = matrix_line;
00038         uint8 *lookup = (uint8*)mc_color_lookup;
00039 
00040         // Loop for 40 characters
00041         for (int i=0; i<40; i++) {
00042                 register uint32 color = cp[i];
00043                 uint8 data = q[mp[i] << 3];
00044 
00045                 if (color & 8) {
00046                         r[i] = (data & 0xaa) | (data & 0xaa) >> 1;
00047                         lookup[6] = colors[color & 7];
00048                         color = lookup[(data & 0xc0) >> 5] | (lookup[(data & 0x30) >> 3] << 16);
00049                         *wp++ = color | (color << 8);
00050                         color = lookup[(data & 0x0c) >> 1] | (lookup[(data & 0x03) << 1] << 16);
00051                         *wp++ = color | (color << 8);
00052 
00053                 } else { // Standard mode in multicolor mode
00054                         r[i] = data;
00055                         color = cp[i]; t = tab + (color << 13) + (data << 1);
00056                         *wp++ = *t++; *wp++ = *t++;
00057                 }
00058         }
00059 }
00060 
00061 
00062 #ifdef GLOBAL_VARS
00063 static inline void el_std_bitmap(uint8 *p, uint8 *q, uint8 *r)
00064 #else
00065 inline void MOS6569::el_std_bitmap(uint8 *p, uint8 *q, uint8 *r)
00066 #endif
00067 {
00068         register uint32 *lp = (uint32 *)p, *t;
00069         uint8 *mp = matrix_line;
00070 
00071         // Loop for 40 characters
00072         for (int i=0; i<40; i++, q+=8) {
00073                 uint8 data = r[i] = *q;
00074                 uint8 h = mp[i];
00075 
00076                 t = (uint32*)&TextColorTable[h >> 4][h & 15][data][0];
00077                 *lp++ = *t++; *lp++ = *t++;
00078         }
00079 }
00080 
00081 
00082 #ifdef GLOBAL_VARS
00083 static inline void el_mc_bitmap(uint8 *p, uint8 *q, uint8 *r)
00084 #else
00085 inline void MOS6569::el_mc_bitmap(uint8 *p, uint8 *q, uint8 *r)
00086 #endif
00087 {
00088         uint8 lookup[4];
00089         register uint32 *wp = (uint32 *)p;
00090         uint8 *cp = color_line;
00091         uint8 *mp = matrix_line;
00092 
00093         lookup[0] = b0c_color;
00094 
00095         // Loop for 40 characters
00096         for (int i=0; i<40; i++, q+=8) {
00097                 uint8 data = *q;
00098                 register uint32 h = mp[i];
00099 
00100                 lookup[1] = colors[h >> 4];
00101                 lookup[2] = colors[h];
00102                 lookup[3] = colors[cp[i]];
00103 
00104                 r[i] = (data & 0xaa) | (data & 0xaa) >> 1;
00105 
00106                 h = lookup[data >> 6] | (lookup[(data >> 4) & 3] << 16); *wp++ = h | (h << 8);
00107                 h = lookup[(data >> 2) & 3] | (lookup[data & 3] << 16);  *wp++ = h | (h << 8);
00108         }
00109 }
00110 
00111 
00112 #ifdef GLOBAL_VARS
00113 static inline void el_ecm_text(uint8 *p, uint8 *q, uint8 *r)
00114 #else
00115 inline void MOS6569::el_ecm_text(uint8 *p, uint8 *q, uint8 *r)
00116 #endif
00117 {
00118         register uint32 *lp = (uint32 *)p, *t;
00119         uint8 *cp = color_line;
00120         uint8 *mp = matrix_line;
00121         uint8 *bcp = &b0c;
00122 
00123         // Loop for 40 characters
00124         for (int i=0; i<40; i++) {
00125                 uint8 data = r[i] = mp[i];
00126 
00127                 t = (uint32*)&TextColorTable[cp[i]][bcp[(data >> 6) & 3]][q[(data & 0x3f) << 3]][0];
00128                 *lp++ = *t++; *lp++ = *t++;
00129         }
00130 }
00131 
00132 
00133 #ifdef GLOBAL_VARS
00134 static inline void el_std_idle(uint8 *p, uint8 *r)
00135 #else
00136 inline void MOS6569::el_std_idle(uint8 *p, uint8 *r)
00137 #endif
00138 {
00139         uint8 data = *get_physical(ctrl1 & 0x40 ? 0x39ff : 0x3fff);
00140         uint32 *lp = (uint32 *)p;
00141         uint32 conv0 = TextColorTable[0][b0c][data][0].b;
00142         uint32 conv1 = TextColorTable[0][b0c][data][1].b;
00143 
00144         for (int i=0; i<40; i++) {
00145                 *lp++ = conv0;
00146                 *lp++ = conv1;
00147                 *r++ = data;
00148         }
00149 }
00150 
00151 
00152 #ifdef GLOBAL_VARS
00153 static inline void el_mc_idle(uint8 *p, uint8 *r)
00154 #else
00155 inline void MOS6569::el_mc_idle(uint8 *p, uint8 *r)
00156 #endif
00157 {
00158         uint8 data = *get_physical(0x3fff);
00159         register uint8 c0 = b0c_color, c1 = colors[0];
00160         register uint32 *lp = (uint32 *)p;
00161         register uint32 conv0, conv1;
00162 
00163         conv0 = (((data & 0xc0) == 0) ? c0 : c1) | (((data & 0x30) == 0) ? c0<<16 : c1<<16);
00164         conv1 = (((data & 0x0c) == 0) ? c0 : c1) | (((data & 0x03) == 0) ? c0<<16 : c1<<16);
00165         conv0 |= (conv0 << 8); conv1 |= (conv1 << 8);
00166 
00167         for (int i=0; i<40; i++) {
00168                 *lp++ = conv0;
00169                 *lp++ = conv1;
00170                 *r++ = data;
00171         }
00172 }

Generated on Tue Feb 8 04:07:53 2005 for E32frodo by doxygen 1.3.3