write out character (and attribute) */
| 317 | |
| 318 | /* write out character (and attribute) */ |
| 319 | void txt_xputc(char ch, int attr) |
| 320 | { |
| 321 | #ifdef PC9800 |
| 322 | union REGS regs; |
| 323 | |
| 324 | regs.h.dl = attr98[attr]; |
| 325 | regs.h.ah = SETATT; |
| 326 | regs.h.cl = DIRECT_CON_IO; |
| 327 | |
| 328 | (void) int86(DOS_EXT_FUNC, ®s, ®s); |
| 329 | |
| 330 | if (ch == '\n') { |
| 331 | regs.h.dl = '\r'; |
| 332 | regs.h.ah = PUTCHAR; |
| 333 | regs.h.cl = DIRECT_CON_IO; |
| 334 | |
| 335 | (void) int86(DOS_EXT_FUNC, ®s, ®s); |
| 336 | } |
| 337 | regs.h.dl = ch; |
| 338 | regs.h.ah = PUTCHAR; |
| 339 | regs.h.cl = DIRECT_CON_IO; |
| 340 | |
| 341 | (void) int86(DOS_EXT_FUNC, ®s, ®s); |
| 342 | #else |
| 343 | #ifdef SCREEN_BIOS |
| 344 | union REGS regs; |
| 345 | #endif |
| 346 | int col, row; |
| 347 | |
| 348 | txt_get_cursor(&col, &row); |
| 349 | switch (ch) { |
| 350 | case '\n': |
| 351 | #if 0 |
| 352 | col = 0; |
| 353 | ++row; |
| 354 | #endif |
| 355 | break; |
| 356 | default: |
| 357 | #ifdef SCREEN_DJGPPFAST |
| 358 | ScreenPutChar((int) ch, attr, col, row); |
| 359 | #endif |
| 360 | #ifdef SCREEN_BIOS |
| 361 | regs.h.ah = PUTCHARATT; /* write att & character */ |
| 362 | regs.h.al = ch; /* character */ |
| 363 | regs.h.bh = 0; /* display page */ |
| 364 | regs.h.bl = (char) attr; /* BL = attribute */ |
| 365 | regs.x.cx = 1; /* one character */ |
| 366 | (void) int86(VIDEO_BIOS, ®s, ®s); |
| 367 | #endif |
| 368 | if (col < (CO - 1)) |
| 369 | ++col; |
| 370 | break; |
| 371 | } /* end switch */ |
| 372 | txt_gotoxy(col, row); |
| 373 | #endif /* PC9800 */ |
| 374 | } |
| 375 | |
| 376 | /* |
no test coverage detected