source: buchla-68k/vlib/vputs.c

Last change on this file was 8c8b4e5, checked in by Thomas Lopatic <thomas@…>, 7 years ago

More volatile hardware accesses.

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[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 =============================================================================
[09d1345]18 vputs(obase, row, col, str, attrib)
[f40a309]19
[09d1345]20 Write string str to video RAM object pointed to by obase
21 at (row,col) with attr used for all characters.
[f40a309]22 =============================================================================
23*/
24
[8c8b4e5]25void vputs(volatile uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t attr)
[f40a309]26{
[09d1345]27 int16_t c;
[f40a309]28
[bf89cfb]29 while ((c = *str++)) {
[f40a309]30
[09d1345]31 vputc(obase, row, col, c, attr);
[f40a309]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 =============================================================================
[09d1345]45 vputsa(obase, row, col, str, attrib)
[f40a309]46
[09d1345]47 Write string str in video RAM pointed to by obase starting
48 at (row, col) using attributes from the words pointed to by attr.
[f40a309]49 =============================================================================
50*/
51
[8c8b4e5]52void vputsa(volatile uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t *attr)
[f40a309]53{
[09d1345]54 int16_t c;
[f40a309]55
[bf89cfb]56 while ((c = *str++)) {
[f40a309]57
[09d1345]58 vputc(obase, row, col, c, *attr++);
[f40a309]59
60 if (++col GE 64) {
61
62 col = 0;
63
64 if (++row GE 25)
65 row = 0;
66 }
67 }
68}
[6262b5c]69
Note: See TracBrowser for help on using the repository browser.