1 | * ------------------------------------------------------------------------------
|
---|
2 | * vputa.s -- store character attributes in video RAM
|
---|
3 | * Version 1 -- 1988-03-14 -- D.N. Lynx Crowe
|
---|
4 | * (c) Copyright 1988 -- D.N. Lynx Crowe
|
---|
5 | * ------------------------------------------------------------------------------
|
---|
6 | *
|
---|
7 | * vputa(sbase, row, col, attrib)
|
---|
8 | * unsigned int *sbase, row, col, attrib;
|
---|
9 | *
|
---|
10 | * Stores attribute value 'attrib' for the character
|
---|
11 | * located at ('row','col') in VSDD RAM starting at 'sbase'.
|
---|
12 | * Assumes a 64 character line and full character attributes.
|
---|
13 | * ------------------------------------------------------------------------------
|
---|
14 | .text
|
---|
15 | *
|
---|
16 | .xdef _vputa
|
---|
17 | *
|
---|
18 | SBASE .equ 8 * LONG - 'sbase'
|
---|
19 | ROW .equ 12 * WORD - 'row'
|
---|
20 | COL .equ 14 * WORD - 'col'
|
---|
21 | ATTR .equ 16 * WORD - 'attrib'
|
---|
22 | *
|
---|
23 | _vputa: link a6,#0 * Link stack frame pointer
|
---|
24 | clr.l d0 * Clear out d0
|
---|
25 | move.w ROW(a6),d0 * Get row
|
---|
26 | lsl.l #6,d0 * Multiply by 64 (shift left 6)
|
---|
27 | move.w COL(a6),d1 * Get col
|
---|
28 | andi.l #$0000003F,d1 * Mask down to 6 bits
|
---|
29 | or.l d1,d0 * OR into d0 to get char. #
|
---|
30 | move.w d0,d1 * Develop cw = (cn/2)*6 in d1
|
---|
31 | andi.l #$FFFFFFFE,d1 * ...
|
---|
32 | move.l d1,d2 * ...
|
---|
33 | add.l d1,d1 * ...
|
---|
34 | add.l d2,d1 * ...
|
---|
35 | add.l SBASE(a6),d1 * Add sbase to cw
|
---|
36 | movea.l d1,a0 * a0 points at the word with the char.
|
---|
37 | btst.l #0,d0 * Odd char. location ?
|
---|
38 | bne vputa1 * Jump if so
|
---|
39 | *
|
---|
40 | move.w ATTR(a6),2(a0) * Store new attribute word in video RAM
|
---|
41 | *
|
---|
42 | vputax: unlk a6 * Unlink the stack frame
|
---|
43 | rts * Done -- return to caller
|
---|
44 | *
|
---|
45 | vputa1: move.w ATTR(a6),4(a0) * Store new attribute word in video RAM
|
---|
46 | bra vputax * Done -- go return to caller
|
---|
47 | *
|
---|
48 | .end
|
---|