| 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 "ram.h"
 | 
|---|
| 15 | 
 | 
|---|
| 16 | /*
 | 
|---|
| 17 |    =============================================================================
 | 
|---|
| 18 |         vputsv(sbase, row, col, str, attrib, len)
 | 
|---|
| 19 | 
 | 
|---|
| 20 |         Write string str to video RAM object pointed to by sbase
 | 
|---|
| 21 |         at (row,col) with attrib used for all characters. Line length is len.
 | 
|---|
| 22 |    =============================================================================
 | 
|---|
| 23 | */
 | 
|---|
| 24 | 
 | 
|---|
| 25 | void vputsv(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib, uint16_t len)
 | 
|---|
| 26 | {
 | 
|---|
| 27 |         uint16_t        c;
 | 
|---|
| 28 | 
 | 
|---|
| 29 |         while (c = *str++) {
 | 
|---|
| 30 | 
 | 
|---|
| 31 |                 vputcv(sbase, row, col, c, attrib, len);
 | 
|---|
| 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 |         vputsav(sbase, row, col, str, attrib, len)
 | 
|---|
| 46 | 
 | 
|---|
| 47 |         Write string str in video RAM pointed to by sbase starting
 | 
|---|
| 48 |         at (row, col) using attributes from the words pointed to by attrib.
 | 
|---|
| 49 |         Line length is len.
 | 
|---|
| 50 |    =============================================================================
 | 
|---|
| 51 | */
 | 
|---|
| 52 | 
 | 
|---|
| 53 | void vputsav(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib, uint16_t len)
 | 
|---|
| 54 | {
 | 
|---|
| 55 |         uint16_t        c;
 | 
|---|
| 56 | 
 | 
|---|
| 57 |         while (c = *str++) {
 | 
|---|
| 58 | 
 | 
|---|
| 59 |                 vputcv(sbase, row, col, c, *attrib++, len);
 | 
|---|
| 60 | 
 | 
|---|
| 61 |                 if (++col GE 64) {
 | 
|---|
| 62 | 
 | 
|---|
| 63 |                         col = 0;
 | 
|---|
| 64 | 
 | 
|---|
| 65 |                         if (++row GE 25)
 | 
|---|
| 66 |                                 row = 0;
 | 
|---|
| 67 |                 }
 | 
|---|
| 68 |         }
 | 
|---|
| 69 | }
 | 
|---|
| 70 | 
 | 
|---|