Changeset 4f508e6 in buchla-68k for vlib/vputcv.s
- Timestamp:
- 07/01/2017 02:34:46 PM (7 years ago)
- Branches:
- master
- Children:
- 08e1da1
- Parents:
- f40a309
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlib/vputcv.s
rf40a309 r4f508e6 1 *------------------------------------------------------------------------------2 *vputcv.s -- store a character and attributes in video RAM3 *Version 1 -- 1988-10-05 -- D.N. Lynx Crowe4 *(c) Copyright 1988 -- D.N. Lynx Crowe5 *------------------------------------------------------------------------------6 * 7 *vputcv(adr, row, col, chr, atr, cols)8 * unsigned int *adr, row, col, chr, atr, cols;9 * 10 *Stores character 'chr' at ('row', 'col') in the11 *full attribute text object at 'adr' with12 *attribute value 'atr' using a line length of 'len'.13 *------------------------------------------------------------------------------14 * 1 | ------------------------------------------------------------------------------ 2 | vputcv.s -- store a character and attributes in video RAM 3 | Version 1 -- 1988-10-05 -- D.N. Lynx Crowe 4 | (c) Copyright 1988 -- D.N. Lynx Crowe 5 | ------------------------------------------------------------------------------ 6 7 | vputcv(adr, row, col, chr, atr, cols) 8 | unsigned int |adr, row, col, chr, atr, cols; 9 10 | Stores character 'chr' at ('row', 'col') in the 11 | full attribute text object at 'adr' with 12 | attribute value 'atr' using a line length of 'len'. 13 | ------------------------------------------------------------------------------ 14 15 15 .text 16 * 16 17 17 .xdef _vputcv 18 * 19 P_ADR .equ820 P_ROW .equ1221 P_COL .equ1422 P_CHR .equ1623 P_ATR .equ1824 P_LEN .equ2025 * 18 19 P_ADR = 8 20 P_ROW = 12 21 P_COL = 14 22 P_CHR = 16 23 P_ATR = 18 24 P_LEN = 20 25 26 26 .page 27 * 28 _vputcv: link a6,#0 *Link stack frame pointer29 move.w P_ROW(a6),d0 *Get row30 mulu P_LEN(a6),d0 *Multiply by len31 clr.l d1 *Clear out d132 move.w P_COL(a6),d1 *Get col33 add.l d1,d0 *Add col into d0 to get char. #34 move.l d0,d1 * Develop cw = (cn/2)*6 in d135 andi.l # $FFFFFFFE,d1 *...36 move.l d1,d2 *...37 add.l d1,d1 *...38 add.l d2,d1 *...39 add.l P_ADR(a6),d1 *Add sbase to cw40 movea.l d1,a0 *a0 points at the word with the char.41 btst.l #0,d0 *Odd char. location ?42 bne vputcv1 *Jump if so43 * 44 move.w P_CHR(a6),d0 *Get chr45 andi.w # $00FF,d0 *Mask off garbage bits46 move.w (a0),d1 *Get word from video RAM47 andi.w # $FF00,d1 *Mask off old even character48 or.w d0,d1 *OR in the new character49 move.w d1,(a0)+ *Store the updated word in video RAM50 bra vputcvx *Done -- go return to caller51 * 52 vputcv1: move.w P_CHR(a6),d0 *Get chr53 lsl.w #8,d0 *Shift to high (odd) byte54 move.w (a0),d1 *Get word from video RAM55 andi.w # $00FF,d1 *Mask off old odd character56 or.w d0,d1 *OR in the new character57 move.w d1,(a0)+ *Store the updated word in video RAM58 addq.l #2,a0 *Point at the attribute word59 * 60 vputcvx: move.w P_ATR(a6),(a0) *Store new attributes in video RAM61 unlk a6 *Unlink the stack frame62 rts *Return to caller63 * 27 28 _vputcv: link a6,#0 | Link stack frame pointer 29 move.w P_ROW(a6),d0 | Get row 30 mulu P_LEN(a6),d0 | Multiply by len 31 clr.l d1 | Clear out d1 32 move.w P_COL(a6),d1 | Get col 33 add.l d1,d0 | Add col into d0 to get char. # 34 move.l d0,d1 | Develop cw = (cn/2)|6 in d1 35 andi.l #0xFFFFFFFE,d1 | ... 36 move.l d1,d2 | ... 37 add.l d1,d1 | ... 38 add.l d2,d1 | ... 39 add.l P_ADR(a6),d1 | Add sbase to cw 40 movea.l d1,a0 | a0 points at the word with the char. 41 btst.l #0,d0 | Odd char. location ? 42 bne vputcv1 | Jump if so 43 44 move.w P_CHR(a6),d0 | Get chr 45 andi.w #0x00FF,d0 | Mask off garbage bits 46 move.w (a0),d1 | Get word from video RAM 47 andi.w #0xFF00,d1 | Mask off old even character 48 or.w d0,d1 | OR in the new character 49 move.w d1,(a0)+ | Store the updated word in video RAM 50 bra vputcvx | Done -- go return to caller 51 52 vputcv1: move.w P_CHR(a6),d0 | Get chr 53 lsl.w #8,d0 | Shift to high (odd) byte 54 move.w (a0),d1 | Get word from video RAM 55 andi.w #0x00FF,d1 | Mask off old odd character 56 or.w d0,d1 | OR in the new character 57 move.w d1,(a0)+ | Store the updated word in video RAM 58 addq.l #2,a0 | Point at the attribute word 59 60 vputcvx: move.w P_ATR(a6),(a0) | Store new attributes in video RAM 61 unlk a6 | Unlink the stack frame 62 rts | Return to caller 63 64 64 .end
Note:
See TracChangeset
for help on using the changeset viewer.