Repository navigation
Expand file tree
/
Copy pathtandyvec.asm
More file actions
108 lines (91 loc) · 5.09 KB
/
Copy pathtandyvec.asm
File metadata and controls
108 lines (91 loc) · 5.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
; =======================================================================
; TANDYVEC.ASM - vector table for TANDY_HI.BGI
;
; Tandy 1000 / PCjr 32K modes: 320x200x16 (BIOS 09h) and 640x200x4 (0Ah).
; Companion to TANDY_HI.C. Modelled on Borland's DEBVECT.ASM.
;
; Must be linked FIRST: the BGI macro has to land at image offset 0 and
; DDOVEC at 16h. (Verified: Borland's DEBUG.BGI, built from DEBVECT.ASM +
; DEBUG.C, has its first C function at 0x98 = 16h + 65 vector words.)
; =======================================================================
INCLUDE DEVICE.INC ; defines the BGI macro + $ddo
_TEXT SEGMENT PARA PUBLIC 'CODE'
_TEXT ENDS
_DATA segment word public 'DATA'
_DATA ENDS
_BSS segment word public 'BSS'
_BSS ENDS
_TEXT SEGMENT PARA PUBLIC 'CODE'
DGROUP group _DATA, _TEXT, _BSS
ASSUME DS:DGROUP, CS:DGROUP
; All near - tiny model. (Borland's own DEBVECT.ASM declares
; _getpix/_putpix NEAR while DEBUG.C defines those names as far
; functions; that mismatch is a bug in the sample. These all match
; near C functions in TANDY_HI.C.)
EXTRN _install : NEAR, _init : NEAR
EXTRN _clear : NEAR, _post : NEAR
EXTRN _move : NEAR, _draw : NEAR
EXTRN _vect : NEAR, _patbar : NEAR
EXTRN _palette : NEAR, _allpalette : NEAR
EXTRN _color : NEAR, _fillstyle : NEAR
EXTRN _linestyle : NEAR, _textstyle : NEAR
EXTRN _text : NEAR, _textsiz : NEAR
EXTRN _getpix : NEAR, _putpix : NEAR
EXTRN _bitmaputil : NEAR, _savebitmap : NEAR
EXTRN _restorebitmap : NEAR, _setclip : NEAR
EXTRN _color_query : NEAR
BGI TANDY_HI ; header block + EMULATE/NONE stubs
DDOVEC DW _install ; AL=0 install (CL=mode) -> ES:BX=DST
; AL=1 mode count -> CX
; AL=2 mode name (CX) -> ES:BX
DW _init ; ES:BX -> device information table
DW _clear
DW _post
DW _move ; CP = (AX,BX)
DW _draw ; line CP -> (AX,BX), updates CP
DW _vect ; line (AX,BX) -> (CX,DX)
DW EMULATE ; polygon - BGI.DOC wants EMULATE
DW EMULATE ; bar / 3-D bar
DW _patbar ; patterned rectangle, no outline
DW EMULATE ; arc
DW EMULATE ; pieslice
DW EMULATE ; filled ellipse
DW _palette ; single palette entry
DW _allpalette ; ES:BX -> struct palettetype
DW _color ; AL=draw colour AH=fill colour
DW _fillstyle ; AL=pattern, ES:BX if AL=FFh
DW _linestyle ; AL=style BX=pattern CX=width
DW _textstyle ; hardware font control
DW _text ; hardware text at CP
DW _textsiz ; hardware text extent
DW RESERVED ; $textinfo - contract undocumented
; Floodfill: NONE, so floodfill() is a no-op rather than a hang.
;
; This slot held EMULATE and that is what hung TANMIN. BGI.DOC lists
; exactly four emulated vectors - BAR, ARC, PIESLICE, FILLED_ELLIPSE -
; and floodfill is NOT among them. Putting EMULATE here sends the
; kernel's emulator a function code it has no case for.
;
; I had justified EMULATE from VGA256.BGI, which does the same. But
; VGA256 is an SDK *sample*: every Borland SHIPPED driver implements
; floodfill natively (CGA/EGAVGA/HERC/ATT/PC3270 all do), and the two
; drivers that do not - IBM8514.BGI and T1000.BGI - use NONE, not
; EMULATE. VGA256's slot was never exercised because BGIDEMO never
; calls floodfill. Sample code is not shipped code.
;
; NONE matches IBM8514.BGI and T1000.BGI, both of which work.
; ponytail: floodfill() now silently does nothing. Say the word and I
; will implement a real scanline boundary fill here, as the shipped
; Borland drivers do - it needs an explicit stack, since the driver
; runs on the caller's stack and cannot recurse.
DW NONE ; floodfill - NOT kernel-emulated
DW _getpix ; (AX,BX) -> DL
DW _putpix ; DL -> (AX,BX)
DW _bitmaputil ; -> ES:BX = utility table
DW _savebitmap ; ES:BX buffer, CX,DX = upper left
DW _restorebitmap ; ES:BX buffer, CX,DX, AL = op
DW _setclip ; (AX,BX)-(CX,DX)
DW _color_query ; AL=0 sizes, AL=1 default palette
DW 35 DUP (NONE) ; reserved for Borland
_TEXT ENDS
END