[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | vputs.c -- video display string put functions
|
---|
| 4 | Version 2 -- 1987-03-30 -- D.N. Lynx Crowe
|
---|
| 5 | (c) Copyright 1987 -- D.N. Lynx Crowe
|
---|
| 6 |
|
---|
| 7 | These functions drive the video character write function vputc()
|
---|
| 8 | which puts characters into a 82716 video RAM character object.
|
---|
| 9 |
|
---|
| 10 | Full attribute format is assumed.
|
---|
| 11 | =============================================================================
|
---|
| 12 | */
|
---|
| 13 |
|
---|
| 14 | #include <stddefs.h>
|
---|
| 15 |
|
---|
| 16 | typedef unsigned int uint;
|
---|
| 17 |
|
---|
[0580615] | 18 | extern void vputc(unsigned *sbase, unsigned row, unsigned col, unsigned c, unsigned attrib);
|
---|
[f40a309] | 19 |
|
---|
| 20 | /*
|
---|
| 21 | =============================================================================
|
---|
| 22 | vputs(sbase, row, col, str, attrib)
|
---|
| 23 |
|
---|
| 24 | Write string str to video RAM object pointed to by sbase
|
---|
| 25 | at (row,col) with attrib used for all characters.
|
---|
| 26 | =============================================================================
|
---|
| 27 | */
|
---|
| 28 |
|
---|
[0580615] | 29 | void vputs(uint *sbase, uint row, uint col, uint attrib, char *str)
|
---|
[f40a309] | 30 | {
|
---|
| 31 | uint c;
|
---|
| 32 |
|
---|
| 33 | while (c = *str++) {
|
---|
| 34 |
|
---|
| 35 | vputc(sbase, row, col, c, attrib);
|
---|
| 36 |
|
---|
| 37 | if (++col GE 64) {
|
---|
| 38 |
|
---|
| 39 | col = 0;
|
---|
| 40 |
|
---|
| 41 | if (++row GE 25)
|
---|
| 42 | row = 0;
|
---|
| 43 | }
|
---|
| 44 | }
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | /* |
---|
| 48 | */
|
---|
| 49 |
|
---|
| 50 | /*
|
---|
| 51 | =============================================================================
|
---|
| 52 | vputsa(sbase, row, col, str, attrib)
|
---|
| 53 |
|
---|
| 54 | Write string str in video RAM pointed to by sbase starting
|
---|
| 55 | at (row, col) using attributes from the words pointed to by attrib.
|
---|
| 56 | =============================================================================
|
---|
| 57 | */
|
---|
[0580615] | 58 |
|
---|
[f40a309] | 59 | void vputsa(uint *sbase, uint row, uint col, uint *attrib, char *str)
|
---|
| 60 | {
|
---|
| 61 | uint c;
|
---|
| 62 |
|
---|
| 63 | while (c = *str++) {
|
---|
| 64 |
|
---|
| 65 | vputc(sbase, row, col, c, *attrib++);
|
---|
| 66 |
|
---|
| 67 | if (++col GE 64) {
|
---|
| 68 |
|
---|
| 69 | col = 0;
|
---|
| 70 |
|
---|
| 71 | if (++row GE 25)
|
---|
| 72 | row = 0;
|
---|
| 73 | }
|
---|
| 74 | }
|
---|
| 75 | }
|
---|