Changeset 4f508e6 in buchla-68k for vlib/vsetcv.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/vsetcv.s
rf40a309 r4f508e6 1 *------------------------------------------------------------------------------2 *vsetcv.s -- set a character's colors in video RAM3 *Version 1 -- 1988-10-11 -- D.N. Lynx Crowe4 *(c) Copyright 1988 -- D.N. Lynx Crowe5 *------------------------------------------------------------------------------6 * 7 *vsetcv(adr, row, col, cfb, len)8 * unsigned int *adr, row, col, cfb, len;9 * 10 *Sets colors 'cfb' at ('row', 'col') in the11 *full attribute text object at 'adr'12 *using a line length of 'len'.13 *------------------------------------------------------------------------------1 | ------------------------------------------------------------------------------ 2 | vsetcv.s -- set a character's colors in video RAM 3 | Version 1 -- 1988-10-11 -- D.N. Lynx Crowe 4 | (c) Copyright 1988 -- D.N. Lynx Crowe 5 | ------------------------------------------------------------------------------ 6 7 | vsetcv(adr, row, col, cfb, len) 8 | unsigned int |adr, row, col, cfb, len; 9 10 | Sets colors 'cfb' at ('row', 'col') in the 11 | full attribute text object at 'adr' 12 | using a line length of 'len'. 13 | ------------------------------------------------------------------------------ 14 14 .text 15 * 15 16 16 .xdef _vsetcv 17 * 18 P_ADR .equ819 P_ROW .equ1220 P_COL .equ1421 P_CFB .equ1622 P_LEN .equ1823 * 24 _vsetcv: link a6,#0 *Link stack frame pointer25 move.w P_ROW(a6),d0 *Get row26 mulu P_LEN(a6),d0 *Multiply by len27 clr.l d1 *Clear out d128 move.w P_COL(a6),d1 *Get col29 add.l d1,d0 *Add col into d0 to get char. #30 move.l d0,d1 * Develop cw = (cn/2)*6 in d131 andi.l # $FFFFFFFE,d1 *...32 move.l d1,d2 *...33 add.l d1,d1 *...34 add.l d2,d1 *...35 add.l P_ADR(a6),d1 *Add sbase to cw36 movea.l d1,a0 *a0 points at the word with the char.37 btst.l #0,d0 *Odd char. location ?38 bne vsetcv1 *Jump if so39 * 40 addq.l #2,a0 *Point at the attribute word41 bra vsetcvx *Go set attribute42 * 43 vsetcv1: addq.l #4,a0 *Point at the attribute word44 * 45 vsetcvx: move.w (a0),d0 *Get old attributes46 andi.w # $FF00,d0 *Remove old colors47 or.w P_CFB(a6),d0 *Get new colors48 move.w d0,(a0) *Set new attributes in video RAM49 unlk a6 *Unlink the stack frame50 rts *Return to caller51 * 17 18 P_ADR = 8 19 P_ROW = 12 20 P_COL = 14 21 P_CFB = 16 22 P_LEN = 18 23 24 _vsetcv: link a6,#0 | Link stack frame pointer 25 move.w P_ROW(a6),d0 | Get row 26 mulu P_LEN(a6),d0 | Multiply by len 27 clr.l d1 | Clear out d1 28 move.w P_COL(a6),d1 | Get col 29 add.l d1,d0 | Add col into d0 to get char. # 30 move.l d0,d1 | Develop cw = (cn/2)|6 in d1 31 andi.l #0xFFFFFFFE,d1 | ... 32 move.l d1,d2 | ... 33 add.l d1,d1 | ... 34 add.l d2,d1 | ... 35 add.l P_ADR(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 vsetcv1 | Jump if so 39 40 addq.l #2,a0 | Point at the attribute word 41 bra vsetcvx | Go set attribute 42 43 vsetcv1: addq.l #4,a0 | Point at the attribute word 44 45 vsetcvx: move.w (a0),d0 | Get old attributes 46 andi.w #0xFF00,d0 | Remove old colors 47 or.w P_CFB(a6),d0 | Get new colors 48 move.w d0,(a0) | Set new attributes in video RAM 49 unlk a6 | Unlink the stack frame 50 rts | Return to caller 51 52 52 .end
Note:
See TracChangeset
for help on using the changeset viewer.