| 1198 | #endif /* __DJGPP__ */ |
| 1199 | |
| 1200 | static void |
| 1201 | positionbar(void) |
| 1202 | { |
| 1203 | char *posbar = (char *) pbar; |
| 1204 | int feature, ucol; |
| 1205 | int k, y, colour, row; |
| 1206 | char __far *pch; |
| 1207 | |
| 1208 | int startk, stopk; |
| 1209 | char volatile a; |
| 1210 | boolean nowhere = FALSE; |
| 1211 | int pixy = (PBAR_ROW * MAX_ROWS_PER_CELL); |
| 1212 | int tmp; |
| 1213 | |
| 1214 | if (!iflags.grmode || !iflags.tile_view) |
| 1215 | return; |
| 1216 | if ((clipx < 0) || (clipxmax <= 0) || (clipx >= clipxmax)) |
| 1217 | nowhere = TRUE; |
| 1218 | if (nowhere) { |
| 1219 | #ifdef DEBUG |
| 1220 | pline("Would have put bar using %d - %d.", clipx, clipxmax); |
| 1221 | #endif |
| 1222 | return; |
| 1223 | } |
| 1224 | #ifdef OLD_STYLE |
| 1225 | outportb(0x3ce, 5); |
| 1226 | outportb(0x3cf, 2); |
| 1227 | for (y = pixy; y < (pixy + MAX_ROWS_PER_CELL); ++y) { |
| 1228 | pch = screentable[y]; |
| 1229 | for (k = 0; k < SCREENBYTES; ++k) { |
| 1230 | if ((k < clipx) || (k > clipxmax)) { |
| 1231 | colour = PBAR_COLOR_OFF; |
| 1232 | } else |
| 1233 | colour = PBAR_COLOR_ON; |
| 1234 | outportb(0x3ce, 8); |
| 1235 | outportb(0x3cf, 255); |
| 1236 | a = READ_ABSOLUTE(pch); /* Must read , then write */ |
| 1237 | WRITE_ABSOLUTE(pch, (char) colour); |
| 1238 | ++pch; |
| 1239 | } |
| 1240 | } |
| 1241 | outportb(0x3ce, 5); |
| 1242 | outportb(0x3cf, 0); |
| 1243 | #else |
| 1244 | colour = PBAR_COLOR_ON; |
| 1245 | outportb(0x3ce, 5); |
| 1246 | outportb(0x3cf, 2); |
| 1247 | for (y = pixy, row = 0; y < (pixy + MAX_ROWS_PER_CELL); ++y, ++row) { |
| 1248 | pch = screentable[y]; |
| 1249 | if ((!row) || (row == (ROWS_PER_CELL - 1))) { |
| 1250 | startk = 0; |
| 1251 | stopk = SCREENBYTES; |
| 1252 | } else { |
| 1253 | startk = clipx; |
| 1254 | stopk = clipxmax; |
| 1255 | } |
| 1256 | for (k = 0; k < SCREENBYTES; ++k) { |
| 1257 | if ((k < startk) || (k > stopk)) |
no test coverage detected