Changeset 4f508e6 in buchla-68k for vlib/acctrl.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/acctrl.s
rf40a309 r4f508e6 1 *------------------------------------------------------------------------------2 *acctrl.s -- VSDD access table control functions3 *Version 6 -- 1987-04-13 -- D.N. Lynx Crowe4 *(c) Copyright 1987 -- D.N. Lynx Crowe5 *------------------------------------------------------------------------------6 * 7 *objclr(obj)8 *unsigned int obj;9 * 10 *Clear bits in access table for object 'obj'.11 *Disables object 'obj'.12 * 13 *objoff(obj, line, num)14 *unsigned int obj, line, num;15 * 16 *Disable object obj at line thru line+num.17 * 18 *objon(obj, line, num)19 *unsigned int obj, line, num;20 * 21 *Enable object obj at line thru line+num.22 * 23 * 24 *Assumes VSDD is looking at bank 0.25 *Assumes a screen height of 350 lines.26 *No error checks are done, so beware.27 *------------------------------------------------------------------------------1 | ------------------------------------------------------------------------------ 2 | acctrl.s -- VSDD access table control functions 3 | Version 6 -- 1987-04-13 -- D.N. Lynx Crowe 4 | (c) Copyright 1987 -- D.N. Lynx Crowe 5 | ------------------------------------------------------------------------------ 6 7 | objclr(obj) 8 | unsigned int obj; 9 10 | Clear bits in access table for object 'obj'. 11 | Disables object 'obj'. 12 13 | objoff(obj, line, num) 14 | unsigned int obj, line, num; 15 16 | Disable object obj at line thru line+num. 17 18 | objon(obj, line, num) 19 | unsigned int obj, line, num; 20 21 | Enable object obj at line thru line+num. 22 23 24 | Assumes VSDD is looking at bank 0. 25 | Assumes a screen height of 350 lines. 26 | No error checks are done, so beware. 27 | ------------------------------------------------------------------------------ 28 28 .text 29 * 29 30 30 .xdef _objclr,_objoff,_objon 31 * 31 32 32 .xref _v_actab 33 * 34 SCSIZE .equ 350 *Screen height35 * 36 OBJ .equ 8 *Object number argument offset37 LINE .equ 10 *Beginning line argument offset38 NUM .equ 12 *Object height argument offset39 *------------------------------------------------------------------------------33 34 SCSIZE = 350 | Screen height 35 36 OBJ = 8 | Object number argument offset 37 LINE = 10 | Beginning line argument offset 38 NUM = 12 | Object height argument offset 39 | ------------------------------------------------------------------------------ 40 40 .page 41 *------------------------------------------------------------------------------42 * 43 *objclr(obj)44 *unsigned int obj;45 * 46 *Disables object obj in access table by turning on47 *its bit in all words of the access table.48 *------------------------------------------------------------------------------49 _objclr: link a6,#0 *Link stack frames50 move.w OBJ(a6),d1 *Get object bit number in d151 lea _v_actab,a0 *Get base of object table in a052 move.w #SCSIZE-1,d2 *Put line count in d253 * 54 objclr1: move.w (a0),d0 *Get access table word55 bset.l d1,d0 *Set the bit56 move.w d0,(a0)+ *Update word in access table57 dbf d2,objclr1 *Loop until done58 * 59 unlk a6 *Unlink stack frame60 rts *Return to caller61 * 41 | ------------------------------------------------------------------------------ 42 43 | objclr(obj) 44 | unsigned int obj; 45 46 | Disables object obj in access table by turning on 47 | its bit in all words of the access table. 48 | ------------------------------------------------------------------------------ 49 _objclr: link a6,#0 | Link stack frames 50 move.w OBJ(a6),d1 | Get object bit number in d1 51 lea _v_actab,a0 | Get base of object table in a0 52 move.w #SCSIZE-1,d2 | Put line count in d2 53 54 objclr1: move.w (a0),d0 | Get access table word 55 bset.l d1,d0 | Set the bit 56 move.w d0,(a0)+ | Update word in access table 57 dbf d2,objclr1 | Loop until done 58 59 unlk a6 | Unlink stack frame 60 rts | Return to caller 61 62 62 .page 63 *------------------------------------------------------------------------------64 *objoff(obj, line, num)65 *unsigned int obj, line, num;66 * 67 *Turn on access table bits for object 'obj' at68 *lines 'line' through 'line'+'num'. Disables the object.69 *Assumes object bits were set at those locations.70 *------------------------------------------------------------------------------71 _objoff: link a6,#0 *Link stack frames72 move.w OBJ(a6),d1 *Get object bit number into d173 move.w LINE(a6),d2 *Get top line number74 add.w d2,d2 *Convert to word offset75 lea _v_actab,a0 *Get base address of access table76 move.w 0(a0,d2),d0 *Get top line access word77 bset.l d1,d0 *Set object bit78 move.w d0,0(a0,d2) *Update word in access table79 tst.w NUM(a6) *Number of lines = 0 ?80 beq objoff1 *Done if so81 * 82 move.w NUM(a6),d2 *Get object depth83 add.w LINE(a6),d2 *Add to top line number84 cmpi.w #SCSIZE,d2 *Bottom line >= screen height ?85 bge objoff1 *Done if so86 * 87 add.w d2,d2 *Convert to word offset88 move.w 0(a0,d2),d0 *Get bottom line access word89 bset.l d1,d0 *Set object bit90 move.w d0,0(a0,d2) *Update word in access table91 * 92 objoff1: unlk a6 *Unlink stack frame93 rts *Return to caller94 * 63 | ------------------------------------------------------------------------------ 64 | objoff(obj, line, num) 65 | unsigned int obj, line, num; 66 67 | Turn on access table bits for object 'obj' at 68 | lines 'line' through 'line'+'num'. Disables the object. 69 | Assumes object bits were set at those locations. 70 | ------------------------------------------------------------------------------ 71 _objoff: link a6,#0 | Link stack frames 72 move.w OBJ(a6),d1 | Get object bit number into d1 73 move.w LINE(a6),d2 | Get top line number 74 add.w d2,d2 | Convert to word offset 75 lea _v_actab,a0 | Get base address of access table 76 move.w 0(a0,d2),d0 | Get top line access word 77 bset.l d1,d0 | Set object bit 78 move.w d0,0(a0,d2) | Update word in access table 79 tst.w NUM(a6) | Number of lines = 0 ? 80 beq objoff1 | Done if so 81 82 move.w NUM(a6),d2 | Get object depth 83 add.w LINE(a6),d2 | Add to top line number 84 cmpi.w #SCSIZE,d2 | Bottom line >= screen height ? 85 bge objoff1 | Done if so 86 87 add.w d2,d2 | Convert to word offset 88 move.w 0(a0,d2),d0 | Get bottom line access word 89 bset.l d1,d0 | Set object bit 90 move.w d0,0(a0,d2) | Update word in access table 91 92 objoff1: unlk a6 | Unlink stack frame 93 rts | Return to caller 94 95 95 .page 96 *------------------------------------------------------------------------------97 *objon(obj, line, num)98 *unsigned int obj, line, num;99 * 100 *Turn off access table bits for object 'obj'101 *at 'line' thru 'line'+'num'. Enables the object.102 *------------------------------------------------------------------------------103 _objon: link a6,#0 *Link stack frames104 move.w OBJ(a6),d1 *Get object bit number into d1105 move.w LINE(a6),d2 *Get top line number106 add.w d2,d2 *Convert to word offset107 lea _v_actab,a0 *Get base address of access table108 move.w 0(a0,d2),d0 *Get top line access word109 bclr.l d1,d0 *Clear object bit110 move.w d0,0(a0,d2) *Update word in access table111 tst.w NUM(a6) *Number of lines = 0 ?112 beq objon1 *Done if so113 * 114 move.w NUM(a6),d2 *Get object depth115 add.w LINE(a6),d2 *Add top line number116 cmpi.w #SCSIZE,d2 *Bottom line >= screen height ?117 bge objon1 *Done if so118 * 119 add.w d2,d2 *Convert to word offset120 move.w 0(a0,d2),d0 *Get bottom line access word121 bclr.l d1,d0 *Clear object bit122 move.w d0,0(a0,d2) *Update word in access table123 * 124 objon1: unlk a6 *Unlink stack frame125 rts *Return to caller126 * 96 | ------------------------------------------------------------------------------ 97 | objon(obj, line, num) 98 | unsigned int obj, line, num; 99 100 | Turn off access table bits for object 'obj' 101 | at 'line' thru 'line'+'num'. Enables the object. 102 | ------------------------------------------------------------------------------ 103 _objon: link a6,#0 | Link stack frames 104 move.w OBJ(a6),d1 | Get object bit number into d1 105 move.w LINE(a6),d2 | Get top line number 106 add.w d2,d2 | Convert to word offset 107 lea _v_actab,a0 | Get base address of access table 108 move.w 0(a0,d2),d0 | Get top line access word 109 bclr.l d1,d0 | Clear object bit 110 move.w d0,0(a0,d2) | Update word in access table 111 tst.w NUM(a6) | Number of lines = 0 ? 112 beq objon1 | Done if so 113 114 move.w NUM(a6),d2 | Get object depth 115 add.w LINE(a6),d2 | Add top line number 116 cmpi.w #SCSIZE,d2 | Bottom line >= screen height ? 117 bge objon1 | Done if so 118 119 add.w d2,d2 | Convert to word offset 120 move.w 0(a0,d2),d0 | Get bottom line access word 121 bclr.l d1,d0 | Clear object bit 122 move.w d0,0(a0,d2) | Update word in access table 123 124 objon1: unlk a6 | Unlink stack frame 125 rts | Return to caller 126 127 127 .end
Note:
See TracChangeset
for help on using the changeset viewer.