Changeset 4f508e6 in buchla-68k for vlib/vputa.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/vputa.s
rf40a309 r4f508e6 1 *------------------------------------------------------------------------------2 *vputa.s -- store character attributes in video RAM3 *Version 1 -- 1988-03-14 -- D.N. Lynx Crowe4 *(c) Copyright 1988 -- D.N. Lynx Crowe5 *------------------------------------------------------------------------------6 * 7 *vputa(sbase, row, col, attrib)8 * unsigned int *sbase, row, col, attrib;9 * 10 *Stores attribute value 'attrib' for the character11 *located at ('row','col') in VSDD RAM starting at 'sbase'.12 *Assumes a 64 character line and full character attributes.13 *------------------------------------------------------------------------------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 14 .text 15 * 15 16 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 pointer24 clr.l d0 *Clear out d025 move.w ROW(a6),d0 *Get row26 lsl.l #6,d0 *Multiply by 64 (shift left 6)27 move.w COL(a6),d1 *Get col28 andi.l # $0000003F,d1 *Mask down to 6 bits29 or.l d1,d0 *OR into d0 to get char. #30 move.w 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 SBASE(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 vputa1 *Jump if so39 * 40 move.w ATTR(a6),2(a0) *Store new attribute word in video RAM41 * 42 vputax: unlk a6 *Unlink the stack frame43 rts *Done -- return to caller44 * 45 vputa1: move.w ATTR(a6),4(a0) *Store new attribute word in video RAM46 bra vputax *Done -- go return to caller47 * 17 18 SBASE = 8 | LONG - 'sbase' 19 ROW = 12 | WORD - 'row' 20 COL = 14 | WORD - 'col' 21 ATTR = 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 #0x0000003F,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 #0xFFFFFFFE,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 48 .end
Note:
See TracChangeset
for help on using the changeset viewer.