…Show last 177 lines
61 case 31: /* fg color red */
62 ansi.attr&=0xf8;
63 ansi.attr|=0x4;
64 break;
65 case 32: /* fg color green */
66 ansi.attr&=0xf8;
67 ansi.attr|=0x2;
68 break;
69 case 33: /* fg color yellow */
70 ansi.attr&=0xf8;
71 ansi.attr|=0x6;
72 break;
73 case 34: /* fg color blue */
74 ansi.attr&=0xf8;
75 ansi.attr|=0x1;
76 break;
77 case 35: /* fg color magenta */
78 ansi.attr&=0xf8;
79 ansi.attr|=0x5;
80 break;
81 case 36: /* fg color cyan */
82 ansi.attr&=0xf8;
83 ansi.attr|=0x3;
84 break;
85 case 37: /* fg color white */
86 ansi.attr&=0xf8;
87 ansi.attr|=0x7;
88 break;
89 case 40:
90 ansi.attr&=0x8f;
91 ansi.attr|=0x0;
92 break;
93 case 41:
94 ansi.attr&=0x8f;
95 ansi.attr|=0x40;
96 break;
97 case 42:
98 ansi.attr&=0x8f;
99 ansi.attr|=0x20;
100 break;
101 case 43:
102 ansi.attr&=0x8f;
103 ansi.attr|=0x60;
104 break;
105 case 44:
106 ansi.attr&=0x8f;
107 ansi.attr|=0x10;
108 break;
109 case 45:
110 ansi.attr&=0x8f;
111 ansi.attr|=0x50;
112 break;
113 case 46:
114 ansi.attr&=0x8f;
115 ansi.attr|=0x30;
116 break;
117 case 47:
118 ansi.attr&=0x8f;
119 ansi.attr|=0x70;
120 break;
121 default:
122 break;
123 }
124 }
125 ClearAnsi();
126 break;
127 case 'f':
128 case 'H':/* Cursor Pos*/
129 if(!ansi.warned) { //Inform the debugger that ansi is used.
130 ansi.warned = true;
131 LOG(LOG_IOCTL,LOG_WARN)("ANSI SEQUENCES USED");
132 }
133 /* Turn them into positions that are on the screen */
134 if(ansi.data[0] == 0) ansi.data[0] = 1;
135 if(ansi.data[1] == 0) ansi.data[1] = 1;
136 if(ansi.data[0] > ansi.nrows) ansi.data[0] = (Bit8u)ansi.nrows;
137 if(ansi.data[1] > ansi.ncols) ansi.data[1] = (Bit8u)ansi.ncols;
138 Real_INT10_SetCursorPos(--(ansi.data[0]),--(ansi.data[1]),page); /*ansi=1 based, int10 is 0 based */
139 ClearAnsi();
140 break;
141 /* cursor up down and forward and backward only change the row or the col not both */
142 case 'A': /* cursor up*/
143 col=CURSOR_POS_COL(page) ;
144 row=CURSOR_POS_ROW(page) ;
145 tempdata = (ansi.data[0]? ansi.data[0] : 1);
146 if(tempdata > row) { row=0; }
147 else { row-=tempdata;}
148 Real_INT10_SetCursorPos(row,col,page);
149 ClearAnsi();
150 break;
151 case 'B': /*cursor Down */
152 col=CURSOR_POS_COL(page) ;
153 row=CURSOR_POS_ROW(page) ;
154 tempdata = (ansi.data[0]? ansi.data[0] : 1);
155 if(tempdata + static_cast<Bitu>(row) >= ansi.nrows)
156 { row = ansi.nrows - 1;}
157 else { row += tempdata; }
158 Real_INT10_SetCursorPos(row,col,page);
159 ClearAnsi();
160 break;
161 case 'C': /*cursor forward */
162 col=CURSOR_POS_COL(page);
163 row=CURSOR_POS_ROW(page);
164 tempdata=(ansi.data[0]? ansi.data[0] : 1);
165 if(tempdata + static_cast<Bitu>(col) >= ansi.ncols)
166 { col = ansi.ncols - 1;}
167 else { col += tempdata;}
168 Real_INT10_SetCursorPos(row,col,page);
169 ClearAnsi();
170 break;
171 case 'D': /*Cursor Backward */
172 col=CURSOR_POS_COL(page);
173 row=CURSOR_POS_ROW(page);
174 tempdata=(ansi.data[0]? ansi.data[0] : 1);
175 if(tempdata > col) {col = 0;}
176 else { col -= tempdata;}
177 Real_INT10_SetCursorPos(row,col,page);
178 ClearAnsi();
179 break;
180 case 'J': /*erase screen and move cursor home*/
181 if(ansi.data[0]==0) ansi.data[0]=2;
182 if(ansi.data[0]!=2) {/* every version behaves like type 2 */
183 LOG(LOG_IOCTL,LOG_NORMAL)("ANSI: esc[%dJ called : not supported handling as 2",ansi.data[0]);
184 }
185 INT10_ScrollWindow(0,0,255,255,0,ansi.attr,page);
186 ClearAnsi();
187 Real_INT10_SetCursorPos(0,0,page);
188 break;
189 case 'h': /* SET MODE (if code =7 enable linewrap) */
190 case 'I': /* RESET MODE */
191 LOG(LOG_IOCTL,LOG_NORMAL)("ANSI: set/reset mode called(not supported)");
192 ClearAnsi();
193 break;
194 case 'u': /* Restore Cursor Pos */
195 Real_INT10_SetCursorPos(ansi.saverow,ansi.savecol,page);
196 ClearAnsi();
197 break;
198 case 's': /* SAVE CURSOR POS */
199 ansi.savecol=CURSOR_POS_COL(page);
200 ansi.saverow=CURSOR_POS_ROW(page);
201 ClearAnsi();
202 break;
203 case 'K': /* erase till end of line (don't touch cursor) */
204 col = CURSOR_POS_COL(page);
205 row = CURSOR_POS_ROW(page);
206 INT10_WriteChar(' ',ansi.attr,page,ansi.ncols-col,true); //Real_WriteChar(ansi.ncols-col,row,page,' ',ansi.attr,true);
207
208 //for(i = col;i<(Bitu) ansi.ncols; i++) INT10_TeletypeOutputAttr(' ',ansi.attr,true);
209 Real_INT10_SetCursorPos(row,col,page);
210 ClearAnsi();
211 break;
212 case 'M': /* delete line (NANSI) */
213 col = CURSOR_POS_COL(page);
214 row = CURSOR_POS_ROW(page);
215 INT10_ScrollWindow(row,0,ansi.nrows-1,ansi.ncols-1,ansi.data[0]? -ansi.data[0] : -1,ansi.attr,0xFF);
216 ClearAnsi();
217 break;
218 case 'l':/* (if code =7) disable linewrap */
219 case 'p':/* reassign keys (needs strings) */
220 case 'i':/* printer stuff */
221 default:
222 LOG(LOG_IOCTL,LOG_NORMAL)("ANSI: unhandled char %c in esc[",data[count]);
223 ClearAnsi();
224 break;
225 }
226 count++;
227 }
228 *size=count;
229 return true;
230}
231
232bool device_CON::Seek(Bit32u * pos,Bit32u type) {
233 // seek is valid
234 *pos = 0;
235 return true;
236}