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