[109c83b] | 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 | .text
|
---|
| 29 | *
|
---|
| 30 | .xdef _objclr,_objoff,_objon
|
---|
| 31 | *
|
---|
| 32 | .xref _v_actab
|
---|
| 33 | *
|
---|
| 34 | SCSIZE .equ 350 * Screen height
|
---|
| 35 | *
|
---|
| 36 | OBJ .equ 8 * Object number argument offset
|
---|
| 37 | LINE .equ 10 * Beginning line argument offset
|
---|
| 38 | NUM .equ 12 * Object height argument offset
|
---|
| 39 | * ------------------------------------------------------------------------------
|
---|
| 40 | .page
|
---|
| 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 | .page
|
---|
| 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 | .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 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 | .end
|
---|