[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | vputsv.c -- video display string put functions
|
---|
| 4 | Version 1 -- 1988-10-06 -- D.N. Lynx Crowe
|
---|
| 5 | (c) Copyright 1988 -- 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 vputcv(unsigned *adr, unsigned row, unsigned col, unsigned char, unsigned atr, unsigned cols);
|
---|
[f40a309] | 19 |
|
---|
| 20 | /*
|
---|
| 21 | =============================================================================
|
---|
| 22 | vputsv(sbase, row, col, str, attrib, len)
|
---|
| 23 |
|
---|
| 24 | Write string str to video RAM object pointed to by sbase
|
---|
| 25 | at (row,col) with attrib used for all characters. Line length is len.
|
---|
| 26 | =============================================================================
|
---|
| 27 | */
|
---|
| 28 |
|
---|
[0580615] | 29 | void vputsv(uint *sbase, uint row, uint col, char *str, uint attrib, uint len)
|
---|
[f40a309] | 30 | {
|
---|
| 31 | uint c;
|
---|
| 32 |
|
---|
| 33 | while (c = *str++) {
|
---|
| 34 |
|
---|
| 35 | vputcv(sbase, row, col, c, attrib, len);
|
---|
| 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 | vputsav(sbase, row, col, str, attrib, len)
|
---|
| 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 | Line length is len.
|
---|
| 57 | =============================================================================
|
---|
| 58 | */
|
---|
[0580615] | 59 |
|
---|
[f40a309] | 60 | void vputsav(uint *sbase, uint row, uint col, char *str, uint *attrib, uint len)
|
---|
| 61 | {
|
---|
| 62 | uint c;
|
---|
| 63 |
|
---|
| 64 | while (c = *str++) {
|
---|
| 65 |
|
---|
| 66 | vputcv(sbase, row, col, c, *attrib++, len);
|
---|
| 67 |
|
---|
| 68 | if (++col GE 64) {
|
---|
| 69 |
|
---|
| 70 | col = 0;
|
---|
| 71 |
|
---|
| 72 | if (++row GE 25)
|
---|
| 73 | row = 0;
|
---|
| 74 | }
|
---|
| 75 | }
|
---|
| 76 | }
|
---|