source: buchla-68k/vlib/viint.s@ 5c977dd

Last change on this file since 5c977dd was 8325447, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Removed _ prefix.

  • Property mode set to 100644
File size: 7.1 KB
RevLine 
[4f508e6]1| ------------------------------------------------------------------------------
2| viint.s -- VSDD Vertical Interval interrupt handler for the Buchla 700
3| Version 17 -- 1989-12-19 -- D.N. Lynx Crowe
4
5| VIint
6
7| VSDD Vertical Interval interrupt handler. Enables display of
8| any object whose bit is set in vi_ctl. Bit 0 = object 0, etc.
9
10| SetPri() uses BIOS(B_SETV, 25, VIint) to set the interrupt
11| vector and lets VIint() enable the object. If vi_dis
12| is set, SetPri() won't enable the interrupt or set the vector
13| so that several objects can be started up at once.
14
15| This routine also sets the base address and scroll offset
16| for the score display object if vi_sadr is non-zero,
17| after a delay for VSDD FRAMESTOP synchronization.
18| ------------------------------------------------------------------------------
[f40a309]19 .text
[4f508e6]20
[8325447]21 .xdef VIint | Vertical Interval int. handler
[4f508e6]22
[8325447]23 .xdef vi_sadr | score object base address
24 .xdef vi_scrl | score object scroll offset
[4f508e6]25 .xdef lclsadr | local scroll address
26 .xdef lclscrl | local scroll offset
27 .xdef vdelay | VSDD scroll delay
28
29 .xdef VIct1 | VSDD interrupt R11
30 .xdef VIct2 | VSDD interrupt R11
31 .xdef VIct3 | VSDD interrupt R11
32 .xdef VIct4 | VSDD interrupt R11
33
[8325447]34 .xref v_regs | VSDD registers
35 .xref v_odtab | VSDD object descriptor table
[4f508e6]36
[8325447]37 .xref vi_clk | scroll delay timer
38 .xref vi_ctl | unblank control word
39 .xref vi_tag | VSDD 'needs service' tag
[4f508e6]40
[f40a309]41 .page
[4f508e6]42
43| Miscellaneous equates:
44| ----------------------
45
46DELAY = 17 | FRAMESTOP sync delay in Ms
47STACKSR = 32 | offset to sr on stack
48V_BLA = 4 | V_BLA (blank) bit number
[8325447]49VSDD_R5 = 10 | VSDD R5 byte offset in v_regs
50VSDD_R11 = 22 | VSDD R11 byte offset in v_regs
[4f508e6]51
52VT_BASE = 128 | word offset of VSDD Access Table
53
54VT_1 = VT_BASE+300 | high time
55VT_2 = VT_BASE+2 | low time
56| ------------------------------------------------------------------------------
57
58| Stack picture after movem.l at entry:
59| -------------------------------------
60
61| LONG PC +34
62| WORD SR +32 STACKSR
63| LONG A6 +28
64| LONG A2 +24
65| LONG A1 +20
66| LONG A0 +16
67| LONG D3 +12
68| LONG D2 +8
69| LONG D1 +4
70| LONG D0 +0
71
72| ------------------------------------------------------------------------------
73
[f40a309]74 .page
[4f508e6]75
[8325447]76| VIint -- Vertical interval interrupt handler
77| ----- -----------------------------------
78VIint: movem.l d0-d3/a0-a2/a6,-(a7) | save registers
[4f508e6]79 addi.w #0x0100,STACKSR(a7) | raise IPL in sr on the stack
80
[8325447]81 move.w v_regs+VSDD_R11,VIct1 | save the VSDD R11 value
[4f508e6]82
[8325447]83 tst.w vi_sadr | see if we should scroll
[4f508e6]84 beq viunbl | jump if not
85
86| ------------------------------------------------------------------------------
87| setup delayed scroll parameters
88| ------------------------------------------------------------------------------
[8325447]89 move.w v_regs+VSDD_R5,d0 | get VSDD R5
[4f508e6]90 move.w d0,d1 | save it for later
91 andi.w #0x0180,d0 | see if we're already in bank 0
92 beq dlyscrl | jump if so
93
[8325447]94 clr.w v_regs+VSDD_R5 | set bank 0
[4f508e6]95
[8325447]96 move.w v_regs+VSDD_R11,VIct2 | save the VSDD R11 value
[4f508e6]97
[8325447]98vw1a: cmp.w #VT_1,v_regs+VSDD_R11 | wait for FRAMESTOP
[4f508e6]99 bcc vw1a | ...
100
[8325447]101vw2a: cmp.w #VT_1,v_regs+VSDD_R11 | ...
[4f508e6]102 bcs vw2a | ...
103
[8325447]104vw3a: cmp.w #VT_1,v_regs+VSDD_R11 | ...
[4f508e6]105 bcc vw3a | ...
106
[8325447]107vw4a: cmp.w #VT_2,v_regs+VSDD_R11 | ...
[4f508e6]108 bcs vw4a | ...
109
[8325447]110dlyscrl: tst.w vi_tag | wait for previous scroll
[4f508e6]111 bne dlyscrl | ...
112
[8325447]113 move.w vi_sadr,lclsadr | save address for timeint
114 move.w vi_scrl,lclscrl | save offset for timeint
115 clr.w vi_sadr | reset for next time
116 clr.w vi_scrl | ...
117 move.w vdelay,vi_clk | set the scroll delay timer
118 st vi_tag | set the 'need service' tag
[4f508e6]119| ------------------------------------------------------------------------------
120| check for unblank requests
121| ------------------------------------------------------------------------------
[8325447]122 move.w vi_ctl,d2 | get the unblank control word
[4f508e6]123 beq viexit | exit if nothing to unblank
124
125 bra unblnk | go unblank some objects
126
[8325447]127viunbl: move.w vi_ctl,d2 | get the unblank control word
[4f508e6]128 beq vidone | exit if nothing to unblank
129
[8325447]130 move.w v_regs+VSDD_R5,d0 | get VSDD R5
[4f508e6]131 move.w d0,d1 | save it for later
132 andi.w #0x0180,d0 | see if we're already in bank 0
133 beq unblnk | jump if so
134
[8325447]135 clr.w v_regs+VSDD_R5 | set bank 0
[4f508e6]136
[8325447]137 move.w v_regs+VSDD_R11,VIct3 | save the VSDD R11 value
[4f508e6]138
[8325447]139vw1b: cmp.w #VT_1,v_regs+VSDD_R11 | wait for FRAMESTOP
[4f508e6]140 bcc vw1b | ...
141
[8325447]142vw2b: cmp.w #VT_1,v_regs+VSDD_R11 | ...
[4f508e6]143 bcs vw2b | ...
144
[8325447]145vw3b: cmp.w #VT_1,v_regs+VSDD_R11 | ...
[4f508e6]146 bcc vw3b | ...
147
[8325447]148vw4b: cmp.w #VT_2,v_regs+VSDD_R11 | ...
[4f508e6]149 bcs vw4b | ...
150
[f40a309]151 .page
[4f508e6]152
153| ------------------------------------------------------------------------------
[8325447]154| unblank objects indicated by contents of d2 (loaded earlier from vi_ctl)
[4f508e6]155| ------------------------------------------------------------------------------
156
157unblnk: clr.w d3 | clear the counter
[8325447]158 clr.w vi_ctl | clear the unblank control word
159 lea v_odtab,a1 | point at first object
[4f508e6]160
161vicheck: btst d3,d2 | check the object bit
162 beq vinext | go check next one if not set
163
164 move.w (a1),d0 | get v_odtab[obj][0]
165 bclr #V_BLA,d0 | clear the blanking bit
166 move.w d0,(a1) | set v_odtab[obj][0]
167
168vinext: cmpi.w #15,d3 | see if we're done
169 beq viexit | jump if so
170
171 addq.l #8,a1 | point at next object
172 addq.w #1,d3 | increment object counter
173 bra vicheck | go check next object
174
175| ------------------------------------------------------------------------------
176| switch back to the bank the interrupted code was using if we changed it
177| ------------------------------------------------------------------------------
178
179viexit: move.w d1,d0 | see if we were in bank 0
180 andi.w #0x0180,d0 | ...
181 beq vidone | jump if so
182
[8325447]183viwait: tst.w vi_tag | wait for timer to run out
[4f508e6]184 bne viwait | ... so timeint sees bank 0
185
[8325447]186 move.w d1,v_regs+VSDD_R5 | restore v_regs[5] to old bank
[4f508e6]187
[8325447]188 move.w v_regs+VSDD_R11,VIct4 | save the VSDD R11 value
[4f508e6]189
[8325447]190vw1c: cmp.w #VT_1,v_regs+VSDD_R11 | wait for FRAMESTOP
[4f508e6]191 bcc vw1c | ...
192
[8325447]193vw2c: cmp.w #VT_1,v_regs+VSDD_R11 | ...
[4f508e6]194 bcs vw2c | ...
195
[8325447]196vw3c: cmp.w #VT_1,v_regs+VSDD_R11 | ...
[4f508e6]197 bcc vw3c | ...
198
[8325447]199vw4c: cmp.w #VT_2,v_regs+VSDD_R11 | ...
[4f508e6]200 bcs vw4c | ...
201
202| ------------------------------------------------------------------------------
203| restore registers and return to interrupted code
204| ------------------------------------------------------------------------------
205
206vidone: movem.l (a7)+,d0-d3/a0-a2/a6 | restore registers
207 rte | return from interrupt
208
[f40a309]209 .page
[4f508e6]210
211| ------------------------------------------------------------------------------
[f40a309]212 .data
[4f508e6]213| ------------------------------------------------------------------------------
214
215vdelay: .dc.w DELAY | VSDD scroll delay
216
217| ------------------------------------------------------------------------------
[f40a309]218 .bss
[4f508e6]219| ------------------------------------------------------------------------------
220
[8325447]221vi_sadr: .ds.w 1 | score object base address
222vi_scrl: .ds.w 1 | score object scroll offset
[4f508e6]223
224lclsadr: .ds.w 1 | local copy of vi_sadr
225lclscrl: .ds.w 1 | local copy of vi_scrl
226
227VIct1: .ds.w 1 | VSDD R11 value at interrupt
228VIct2: .ds.w 1 | VSDD R11 value at interrupt
229VIct3: .ds.w 1 | VSDD R11 value at interrupt
230VIct4: .ds.w 1 | VSDD R11 value at interrupt
231
[f40a309]232 .end
Note: See TracBrowser for help on using the repository browser.