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 | extern void vputcv(uint16_t *adr, uint16_t row, uint16_t col, uint8_t chr, uint16_t atr, uint16_t cols);
|
---|
17 |
|
---|
18 | /*
|
---|
19 | =============================================================================
|
---|
20 | vputsv(sbase, row, col, str, attrib, len)
|
---|
21 |
|
---|
22 | Write string str to video RAM object pointed to by sbase
|
---|
23 | at (row,col) with attrib used for all characters. Line length is len.
|
---|
24 | =============================================================================
|
---|
25 | */
|
---|
26 |
|
---|
27 | void vputsv(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib, uint16_t len)
|
---|
28 | {
|
---|
29 | uint16_t c;
|
---|
30 |
|
---|
31 | while (c = *str++) {
|
---|
32 |
|
---|
33 | vputcv(sbase, row, col, c, attrib, len);
|
---|
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 | vputsav(sbase, row, col, str, attrib, len)
|
---|
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 | Line length is len.
|
---|
55 | =============================================================================
|
---|
56 | */
|
---|
57 |
|
---|
58 | void vputsav(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib, uint16_t len)
|
---|
59 | {
|
---|
60 | uint16_t c;
|
---|
61 |
|
---|
62 | while (c = *str++) {
|
---|
63 |
|
---|
64 | vputcv(sbase, row, col, c, *attrib++, len);
|
---|
65 |
|
---|
66 | if (++col GE 64) {
|
---|
67 |
|
---|
68 | col = 0;
|
---|
69 |
|
---|
70 | if (++row GE 25)
|
---|
71 | row = 0;
|
---|
72 | }
|
---|
73 | }
|
---|
74 | }
|
---|