[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 |
|
---|
[6262b5c] | 14 | #include "all.h"
|
---|
[f40a309] | 15 |
|
---|
[7258c6a] | 16 | extern void vputc(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t c, uint16_t attrib);
|
---|
[f40a309] | 17 |
|
---|
| 18 | /*
|
---|
| 19 | =============================================================================
|
---|
| 20 | vputs(sbase, row, col, str, attrib)
|
---|
| 21 |
|
---|
| 22 | Write string str to video RAM object pointed to by sbase
|
---|
| 23 | at (row,col) with attrib used for all characters.
|
---|
| 24 | =============================================================================
|
---|
| 25 | */
|
---|
| 26 |
|
---|
[7258c6a] | 27 | void vputs(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t attrib, int8_t *str)
|
---|
[f40a309] | 28 | {
|
---|
[7258c6a] | 29 | uint16_t c;
|
---|
[f40a309] | 30 |
|
---|
| 31 | while (c = *str++) {
|
---|
| 32 |
|
---|
| 33 | vputc(sbase, row, col, c, attrib);
|
---|
| 34 |
|
---|
| 35 | if (++col GE 64) {
|
---|
| 36 |
|
---|
| 37 | col = 0;
|
---|
| 38 |
|
---|
| 39 | if (++row GE 25)
|
---|
| 40 | row = 0;
|
---|
| 41 | }
|
---|
| 42 | }
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | /* |
---|
| 46 | */
|
---|
| 47 |
|
---|
| 48 | /*
|
---|
| 49 | =============================================================================
|
---|
| 50 | vputsa(sbase, row, col, str, attrib)
|
---|
| 51 |
|
---|
| 52 | Write string str in video RAM pointed to by sbase starting
|
---|
| 53 | at (row, col) using attributes from the words pointed to by attrib.
|
---|
| 54 | =============================================================================
|
---|
| 55 | */
|
---|
[7258c6a] | 56 |
|
---|
[f40a309] | 57 | void vputsa(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t *attrib, int8_t *str)
|
---|
[7258c6a] | 58 | {
|
---|
[f40a309] | 59 | uint16_t c;
|
---|
| 60 |
|
---|
| 61 | while (c = *str++) {
|
---|
| 62 |
|
---|
| 63 | vputc(sbase, row, col, c, *attrib++);
|
---|
| 64 |
|
---|
| 65 | if (++col GE 64) {
|
---|
| 66 |
|
---|
| 67 | col = 0;
|
---|
| 68 |
|
---|
| 69 | if (++row GE 25)
|
---|
| 70 | row = 0;
|
---|
| 71 | }
|
---|
| 72 | }
|
---|
[6262b5c] | 73 | }
|
---|
| 74 |
|
---|