source: buchla-68k/orig/DOC/VLIB.TXT@ f806726

Last change on this file since f806726 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 16.6 KB
Line 
1VSDD Functions in vlib
2----------------------
3
4 CpyObj(from, to, w, h, sw)
5
6 SelObj(obj)
7 SetObj(obj, type, bank, base, xpix, ypix, x0, y0, flags, pri)
8 SetPri(obj, pri)
9
10 VHinit()
11 VIint()
12 VSinit()
13
14 lseg(x1, y1, x2, y2, t)
15
16 objclr(obj)
17 objoff(obj, line, num)
18 objon(obj, line, num)
19
20 tsplot4(obase, nw, fg, row, col, str, pitch)
21
22 vbank(b)
23 vbfill4(obj, obwidth, xmin, ymin, xmax, ymax, color)
24 vclrav(adr, row, col, atr, len)
25 vclrs(obase, row, col, nc, ch, atr)
26 vcputs(obase, nw, fg, bg, row, col, str)
27 vcputsv(obase, nw, fg, bg, row, col, str, pitch)
28 vfwait()
29 vmput(sbase, row, col, ms, ma)
30 vmputa(sbase, row, col, ms, ma)
31 vputa(sbase, row, col, attrib)
32 vputc(sbase, row, col, c, attrib)
33 vputcv(adr, row, col, chr, atr, cols)
34 vputp(octad, xloc, yloc, val)
35 vputs(sbase, row, col, str, attrib)
36 vputsa(sbase, row, col, str, attrib)
37 vputsav(sbase, row, col, str, attrib, len)
38 vputsv(sbase, row, col, str, attrib, len)
39 vsetav(adr, row, col, atr, len)
40 vsetcv(adr, row, col, cfb, len)
41 vsetpal(slot, red, grn, blu)
42 vsndpal(pp)
43 vsplot4(obase, nw, fg, row, col, str, pitch, ht, cgtab)
44 vspray4(vobj, vwid, fg, ml, vb, pitch)
45 vtext(obj, nc, row, col, ip)
46 vvputsv(obase, nw, fg, bg, row, col, str, pitch, ht, cgtab)
47 vwputm(obase, nw, fg, bg, row, col, ml)
48 vwputp(octad, xloc, yloc, val)
49 vwputs(obase, nw, fg, bg, row, col, str)
50
51
52Text string display functions
53-----------------------------
54
551 byte per character, no attributes
56
57 vtext(obj, nc, row, col, ip)
58
593 byte per character, full attributes
60
61 vclrs(obase, row, col, nc, ch, atr)
62 vputc(sbase, row, col, c, attrib)
63 vputcv(adr, row, col, chr, atr, cols)
64 vputs(sbase, row, col, str, attrib)
65 vputsa(sbase, row, col, str, attrib)
66 vputsav(sbase, row, col, str, attrib, len)
67
682 bit per pixel graphics
69
70 vwputm(obase, nw, fg, bg, row, col, ml)
71 vwputs(obase, nw, fg, bg, row, col, str)
72
734 bit per pixel graphics
74
75 vcputs(obase, nw, fg, bg, row, col, str)
76 vcputsv(obase, nw, fg, bg, row, col, str, pitch)
77 vputsv(sbase, row, col, str, attrib, len)
78 vmput(sbase, row, col, ms, ma)
79 vmputa(sbase, row, col, ms, ma)
80 vsplot4(obase, nw, fg, row, col, str, pitch, ht, cgtab)
81 vspray4(vobj, vwid, fg, ml, vb, pitch)
82 vvputsv(obase, nw, fg, bg, row, col, str, pitch, ht, cgtab)
83
84
85Graphics display functions
86--------------------------
87
88General
89
90 lseg(x1, y1, x2, y2, t)
91
922 bit per pixel
93
94 vwputp(octad, xloc, yloc, val)
95
964 bit per pixel
97
98 vbfill4(obj, obwidth, xmin, ymin, xmax, ymax, color)
99 vputp(octad, xloc, yloc, val)
100
101
102Control functions
103-----------------
104
105General
106
107 CpyObj(from, to, w, h, sw)
108
109 VHinit()
110 VIint()
111 VSinit()
112
113 vbank(b)
114 vfwait()
115
116Object control
117
118 SelObj(obj)
119 SetObj(obj, type, bank, base, xpix, ypix, x0, y0, flags, pri)
120 SetPri(obj, pri)
121
122 objclr(obj)
123 objoff(obj, line, num)
124 objon(obj, line, num)
125
126Character attributes
127
128 vclrav(adr, row, col, atr, len)
129 vputa(sbase, row, col, attrib)
130 vsetav(adr, row, col, atr, len)
131 vsetcv(adr, row, col, cfb, len)
132
133Palette
134
135 vsetpal(slot, red, grn, blu)
136 vsndpal(pp)
137
138
139VSDD Software Object Control Table Entry Structure
140--------------------------------------------------
141
142 struct octent {
143
144 uint ysize,
145 xsize;
146
147 int objx,
148 objy;
149
150 uint *obase;
151
152 char opri,
153 obank;
154
155 uint odtw0,
156 odtw1;
157 };
158
159
160
161VSDD Functions by module
162------------------------
163
164acctrl.s objclr(obj)
165 objoff(obj, line, num)
166 objon(obj, line, num)
167
168lseg.c lseg(x1, y1, x2, y2, t)
169
170tsplot4.s tsplot4(obase, nw, fg, row, col, str, pitch)
171
172vbfill4.c vbfill4(obj, obwidth, xmin, ymin, xmax, ymax, color)
173
174vclrav.s vclrav(adr, row, col, atr, len)
175
176vclrs.c vclrs(obase, row, col, nc, ch, atr)
177
178vcputs.s vcputs(obase, nw, fg, bg, row, col, str)
179
180vcputsv.s vcputsv(obase, nw, fg, bg, row, col, str. pitch)
181
182vctrl.c vbank(b)
183 vfwait()
184
185vhinit.c VHinit()
186
187vmput.c vmput(sbase, row, col, ms, ma)
188 vmputa(sbase, row, col, ms, ma)
189
190vobjfns.c SelObj(obj)
191 SetPri(obj, pri)
192 SetObj(obj, type, bank, base, xpix, ypix, x0, y0, flags, pri)
193 CpyObj(from, to, w, h, sw)
194
195vputa.s vputa(sbase, row, col, attrib)
196
197vputc.s vputc(sbase, row, col, c, attrib)
198
199vputcv.s vputcv(adr, row, col, chr, atr, cols)
200
201vputp.s vputp(octad, xloc, yloc, val)
202
203vputs.c vputs(sbase, row, col, str, attrib)
204 vputsa(sbase, row, col, str, attrib)
205
206vputsv.c vputsv(sbase, row, col, str, attrib, len)
207 vputsav(sbase, row, col, str, attrib, len)
208
209
210
211VSDD Functions by module -- continued
212------------------------
213
214vsetav.s vsetav(adr, row, col, atr, len)
215
216vsetcv.s vsetcv(adr, row, col, cfb, len)
217
218vsetpal.c vsetpal(slot, red, grn, blu)
219 vsndpal(pp)
220
221vsinit.c VSinit()
222
223vsplot4.s vsplot4(obase, nw, fg, row, col, str, pitch, ht, cgtab)
224
225vspray4.c vspray4(vobj, vwid, fg, ml, vb, pitch)
226
227vtext.c vtext(obj, nc, row, col, ip)
228
229vvputsv.s vvputsv(obase, nw, fg, bg, row, col, str, pitch, ht, cgtab)
230
231vwputm.c vwputm(obase, nw, fg, bg, row, col, ml)
232
233vwputp.s vwputp(octad, xloc, yloc, val)
234
235vwputs.s vwputs(obase, nw, fg, bg, row, col, str)
236
237
238 CpyObj(from, to, w, h, sw)
239 unsigned int *from, *to;
240 int w, h, sw;
241
242 Copy a 'w'-word by 'h'-line object from 'from' to 'to' with
243 a destination width of 'sw' words.
244
245 SelObj(obj)
246 int obj;
247
248 Select 'obj' as the current working object.
249
250 SetObj(obj, type, bank, base, xpix, ypix, x0, y0, flags, pri)
251 int obj, type, bank, xpix, ypix, x0, y0, flags, pri;
252 unsigned int *base;
253
254 Setup object 'obj' of type 'type' at 'base' in bank 'bank'
255 with height 'ypix' and width 'xpix' at initial location
256 'x0','y0', with flags 'flags'. Assumes HRS EQ 1.
257 If 'pri' >= 0, display the object at priority level 'pri'.
258 Define a bitmap object if 'type' EQ 0, or a character object
259 if 'type' NE 0.
260
261 SetPri(obj, pri)
262 int obj, pri;
263
264 Display object 'obj' with priority 'pri'.
265
266
267 VHinit()
268
269 Setup VSDD registers, clear access table, clear object table,
270 load character generator, set color lookup table defaults.
271 Defines major video system variables, since the linker isn't
272 smart enough to let me put them in a separate file.
273
274 VIint()
275
276 VSDD Vertical Interval interrupt handler. Enables display of
277 any object whose bit is set in vi_ctl. Bit 0 = object 0, etc.
278
279 SetPri() uses BIOS(B_SETV, 25, VIint) to set the interrupt
280 vector and lets VIint() enable the object. If vi_dis
281 is set, SetPri() won't enable the interrupt or set the vector
282 so that several objects can be started up at once.
283
284 This routine also sets the base address and scroll offset
285 for the score display object if vi_sadr is non-zero,
286 after a delay for VSDD FRAMESTOP synchronization.
287
288 VSinit()
289
290 Initialize VSDD software support variables.
291
292
293 lseg(x1, y1, x2, y2, t)
294 short x1, y1, x2, y2, t;
295
296 Draws a line from ('x1', 'y1') to ('x2', 'y2')
297 in drawing mode 't'.
298
299 All coordinates are short integers in whatever plotting units the
300 'point' function expects. No clipping or scaling is done, as this is
301 the lowest level 'line' primitive in the drawing code, and coordinates
302 are expected to have already been checked and found to be on screen.
303
304 The 'point' variable must be initialized to point at the
305 pixel plotting function before this function is called. The pixel
306 plotting function is passed 3 arguments: the x coordinate, the y
307 coordinate, and the plotting mode. It is declared here as type 'short',
308 but any value it returns will be ignored.
309
310 The register variable assignments were chosen based on the Alcyon C
311 compiler for the Atari 1040ST and reflect the capabilities of that
312 compiler. Other compilers may require different optimizations based
313 on their use of register variables.
314
315 objclr(obj)
316 unsigned int obj;
317
318 Clear bits in access table for object 'obj'.
319 Disables object 'obj'.
320
321 objoff(obj, line, num)
322 unsigned int obj, line, num;
323
324 Disable object obj at line thru line+num.
325
326 objon(obj, line, num)
327 unsigned int obj, line, num;
328
329 Enable object obj at line thru line+num.
330
331 Assumes VSDD is looking at bank 0.
332 Assumes a screen height of 350 lines.
333 No error checks are done, so beware.
334
335
336 tsplot4(obase, nw, fg, row, col, str, pitch)
337 int *obase, nw, fg, row, col, pitch;
338 char *str;
339
340 Outputs characters from the string at 'str' to an 'nw'
341 character wide 4-bit per pixel graphics window at 'obase'
342 at ('row','col'), using 'fg' as the foreground color.
343 Uses cgtable[][256] as the VSDD formatted character
344 generator table. Assumes 12 bit high characters in the
345 cgtable. Uses 'pitch' as the vertical spacing between
346 character rows. No error checks are done.
347 The string must fit the output area (no overlaps, single line).
348
349 unsigned
350 vbank(b)
351 unsigned b;
352
353 Set VSDD Data Segment bank to b.
354 Return old bank select value.
355
356 vbfill4(obj, obwidth, xmin, ymin, xmax, ymax, color)
357 unsigned *obj;
358 short obwidth, xmin, ymin, xmax, ymax;
359 register unsigned color;
360
361 Video block fill blitter for 4 bit per pixel objects
362 Fills an area with a color. Coded for speed, not space.
363
364 vclrav(adr, row, col, atr, len)
365 unsigned int *adr, row, col, atr, len;
366
367 Clears attribute 'atr' at ('row', 'col') in the
368 full attribute text object at 'adr'
369 using a line length of 'len'.
370
371
372 vclrs(obase, row, col, nc, ch, atr)
373 unsigned int obase[];
374 int row, col, nc, ch, atr;
375
376 Clear 'nc' characters in the text object 'obase' to 'ch',
377 using atrributes 'atr', starting at ('row','col');
378
379 No error checking is done, so beware.
380
381 vcputs(obase, nw, fg, bg, row, col, str)
382 int *obase, nw, fg, bg, row, col;
383 char *str;
384
385 Outputs characters from the string at 'str' to an 'nw'
386 character wide 4-bit per pixel graphics window at 'obase'
387 at ('row','col'), using 'fg' as the foreground color, and
388 'bg' as the background color. Uses cgtable[][256] as the
389 VSDD formatted character generator table.
390 No error checks are done.
391
392 vcputsv(obase, nw, fg, bg, row, col, str. pitch)
393 int *obase, nw, fg, bg, row, col, pitch;
394 char *str;
395
396 Outputs characters from the string at 'str' to an 'nw'
397 character wide 4-bit per pixel graphics window at 'obase'
398 at ('row','col'), using 'fg' as the foreground color, and
399 'bg' as the background color. Uses cgtable[][256] as the
400 VSDD formatted character generator table. Assumes 12 bit
401 high characters in the cgtable. Uses 'pitch' as the vertical
402 spacing between character rows. No error checks are done.
403 The string must fit the output area (no overlaps, single line).
404
405 vfwait()
406
407 Wait for a FRAMESTOP update to transpire.
408
409 vmput(sbase, row, col, ms, ma)
410 uint *sbase, rwo, col, ma;
411 char *ms[];
412
413 Copies lines from ms, with attribute ma, to sbase at (row,col).
414
415
416 vmputa(sbase, row, col, ms, ma)
417 uint *sbase, row, col, *ma;
418 char *ms[];
419
420 Copies lines from ms, with attributes from ma, to sbase at (row,col).
421
422 vputa(sbase, row, col, attrib)
423 unsigned int *sbase, row, col, attrib;
424
425 Stores attribute value 'attrib' for the character
426 located at ('row','col') in VSDD RAM starting at 'sbase'.
427 Assumes a 64 character line and full character attributes.
428
429 vputc(sbase, row, col, c, attrib)
430 unsigned int *sbase, row, col, c, attrib;
431
432 Stores character c at (row,col) in sbase with
433 attribute value attrib.
434
435 vputcv(adr, row, col, chr, atr, cols)
436 unsigned int *adr, row, col, chr, atr, cols;
437
438 Stores character 'chr' at ('row', 'col') in the
439 full attribute text object at 'adr' with
440 attribute value 'atr' using a line length of 'len'.
441
442 int
443 vputp(octad, xloc, yloc, val)
444 struct octent *octad;
445 int xloc, yloc;
446
447 Puts the pixel value 'val' at ('xloc','yloc') in the
448 4-bit per pixel bitmap object described by 'octad'.
449
450 vputs(sbase, row, col, str, attrib)
451 uint *sbase, row, col, attrib;
452 char *str;
453
454 Write string str to video RAM object pointed to by sbase
455 at (row,col) with attrib used for all characters.
456 Full attribute format is assumed.
457
458 vputsa(sbase, row, col, str, attrib)
459 uint *sbase, row, col, *attrib;
460 char *str;
461
462 Write string str in video RAM pointed to by sbase starting
463 at (row, col) using attributes from the words pointed to
464 by attrib. Full attribute format is assumed.
465
466
467 vputsav(sbase, row, col, str, attrib, len)
468 uint *sbase, row, col;
469 char *str;
470 uint *attrib, len;
471
472 Write string str in video RAM pointed to by sbase starting
473 at (row, col) using attributes from the words pointed to
474 by attrib. Line length is len. Full attribute format
475 is assumed.
476
477 vputsv(sbase, row, col, str, attrib, len)
478 uint *sbase, row, col;
479 char *str;
480 uint attrib, len;
481
482 Write string str to video RAM object pointed to by sbase
483 at (row,col) with attrib used for all characters.
484 Line length is len. Full attribute format is assumed.
485
486 vsetav(adr, row, col, atr, len)
487 unsigned int *adr, row, col, atr, len;
488
489 Sets attribute 'atr' at ('row', 'col') in the
490 full attribute text object at 'adr'
491 using a line length of 'len'.
492
493 vsetcv(adr, row, col, cfb, len)
494 unsigned int *adr, row, col, cfb, len;
495
496 Sets colors 'cfb' at ('row', 'col') in the
497 full attribute text object at 'adr'
498 using a line length of 'len'.
499
500 vsetpal(slot, red, grn, blu)
501 register unsigned slot, red, grn, blu;
502
503 Set a palette RAM entry to a specific color
504
505 slot 0..15 color entry number
506 red 0..3 red value
507 grn 0..3 green value
508 blu 0..3 blue value
509
510
511 vsndpal(pp)
512 short pp[16][3];
513
514 Send a palette table to the video palette RAM
515
516 pp pointer to a short [16][3] array,
517
518 where:
519 pp[n][0] = blue value
520 pp[n][1] = green value
521 pp[n][2] = red value
522
523 n = slot number (0..15)
524
525 vsplot4(obase, nw, fg, row, col, str, pitch, ht, cgtab)
526 uint *obase, nw, fg, row, col, pitch, ht, cgtab[][256];
527 char *str;
528
529 Outputs characters from the string at 'str' to an 'nw'
530 character wide 4-bit per pixel graphics window at 'obase'
531 at ('row','col'), using 'fg' as the foreground color.
532 Uses cgtab[][256] as the VSDD formatted character
533 generator table. Assumes 'ht' bit high characters in the
534 cgtable. Uses 'pitch' as the vertical spacing between
535 character rows. No error checks are done.
536 The string must fit the output area (no overlaps, single line).
537 This function leaves the zero pixels alone and just sets the
538 one pixels to the foreground color, allowing overlapping
539 character cells.
540
541 vspray4(vobj, vwid, fg, ml, vb, pitch)
542 unsigned *vobj;
543 short vwid, fg, vb, pitch;
544 char *ml[];
545
546 Spray a pattern on the screen.
547
548 Uses 'vobj' of width 'vwid' as the screen, 'fg' as the color,
549 'vb' as the bank, 'pitch' as the vertical pitch, and 'ml' as
550 the pattern.
551
552 If 'vb' EQ -1, the bank is not set. The color in 'fg' will
553 be taken from the lower 4 bits.
554
555 The list 'ml' points at pairs of counts and characters.
556 The last count is -1, and the list terminates with a
557 null pointer.
558
559
560 vtext(obj, nc, row, col, ip)
561 register unsigned *obj, nc, row, col;
562 register char *ip;
563
564 Output a text string to the VSDD in 1 byte / character mode.
565 Assumes VSDD is pointing at bank 0.
566
567 vvputsv(obase, nw, fg, bg, row, col, str, pitch, ht, cgtab)
568 uint *obase, nw, fg, bg, row, col, pitch, ht, cgtab[][256];
569 char *str;
570
571 Outputs characters from the string at 'str' to an 'nw'
572 character wide 4-bit per pixel graphics window at 'obase'
573 at ('row','col'), using 'fg' as the foreground color, and
574 'bg' as the background color. Uses cgtab[][256] as the
575 VSDD formatted character generator table. Assumes 'ht' line
576 high characters in the cg table. Uses 'pitch' as the vertical
577 spacing between character rows. No error checks are done.
578 The string must fit the output area (no overlaps, single line).
579
580 vwputm(obase, nw, fg, bg, row, col, ml)
581 unsigned int *obase;
582 int nw, fg, bg;
583 char *ml[];
584
585 Put a menu in a 2-bit per pixel graphics window.
586
587 Writes the menu described by the list 'ml' in the
588 'nw' character wide bitmap 'obase', using 'fg' for
589 the foreground color and 'bg' for the background.
590 The menu is at ('row','col') in the bitmap.
591
592 int
593 vwputp(octad, xloc, yloc, val)
594 struct octent *octad;
595 int xloc, yloc;
596
597 Writes the pixel value 'val' into the 2-bit per pixel
598 bitmap object described by 'octad' at ('xloc','yloc').
599 Upper left corner of screen is (0,0) origin.
600
601 vwputs(obase, nw, fg, bg, row, col, str)
602 int *obase, nw, fg, bg, row, col;
603 char *str;
604
605 Outputs characters from the string at 'str' to an 'nw'
606 character wide 2-bit per pixel graphics window at 'obase'
607 at ('row','col'), using 'fg' as the foreground color, and
608 'bg' as the background color. Uses cgtable[][256] as the
609 VSDD formatted character generator table.
610 No error checks are done.
Note: See TracBrowser for help on using the repository browser.