source: buchla-68k/vlib/vtext.c@ 8c8b4e5

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

More volatile hardware accesses.

  • Property mode set to 100644
File size: 667 bytes
RevLine 
[f40a309]1/*
2 =============================================================================
3 vtext.c -- output a text string to the VSDD in 1 byte / character mode
4 Version 3 -- 1987-06-02 -- D.N. Lynx Crowe
5
6 Assumes VSDD is pointing at bank 0.
7 =============================================================================
8*/
9
[b28a12e]10#include "ram.h"
[6262b5c]11
[09d1345]12static uint16_t msk[] = { 0xFF00, 0x00FF };
[f40a309]13
[8c8b4e5]14void vtext(volatile uint16_t *obj, int16_t nc, int16_t row, int16_t col, int8_t *ip)
[f40a309]15{
[8c8b4e5]16 volatile uint16_t *op;
[f40a309]17
18 while (*ip) {
19
20 op = obj + ((nc >> 1) * row) + (col >> 1);
21
[09d1345]22 *op = (*op & msk[col & 1]) |
23 ((uint16_t)(*ip++ & 0x00FF) << ((col & 1) ? 8 : 0));
[f40a309]24
25 col++;
26 }
27}
Note: See TracBrowser for help on using the repository browser.