]> 4ch.mooo.com Git - 16.git/blob - 16/xw__/mxpp.asm
16_ca needs huge amounts of work and I should remember what needs to be done soon...
[16.git] / 16 / xw__ / mxpp.asm
1 .387
2                 PUBLIC  MXGETPIXEL
3                 PUBLIC  MXPUTPIXEL
4                 EXTRN   MX_CLIPX1:BYTE
5                 EXTRN   MX_CLIPX2:BYTE
6                 EXTRN   MX_CLIPY1:BYTE
7                 EXTRN   MX_CLIPY2:BYTE
8                 EXTRN   MX_VIDEOSEGMENT:BYTE
9                 EXTRN   MX_BYTESPERLINE:BYTE
10 MX_TEXT         SEGMENT PARA PUBLIC USE16 'CODE'
11                 ASSUME CS:MX_TEXT, DS:DGROUP, SS:DGROUP
12 MXGETPIXEL:
13         push            bp
14         mov             bp,sp
15         sub             sp,0
16         push            ds
17         push            si
18         xor             ax,ax
19         mov             si,word ptr 8[bp]
20         cmp             si,word ptr cs:MX_CLIPX1
21         jl              L$1
22         cmp             si,word ptr cs:MX_CLIPX2
23         jg              L$1
24         mov             bx,word ptr 6[bp]
25         cmp             bx,word ptr cs:MX_CLIPY1
26         jl              L$1
27         cmp             bx,word ptr cs:MX_CLIPY2
28         jg              L$1
29         mov             al,4
30         mov             ah,byte ptr 8[bp]
31         and             ah,3
32         mov             dx,3ceH
33         out             dx,ax
34         mov             ds,word ptr cs:MX_VIDEOSEGMENT
35         mov             ax,bx
36         mul             word ptr cs:MX_BYTESPERLINE
37         shr             si,1
38         shr             si,1
39         add             si,ax
40         mov             al,byte ptr [si]
41         xor             ah,ah
42 L$1:
43         pop             si
44         pop             ds
45         mov             sp,bp
46         pop             bp
47         retf            4
48 MXPUTPIXEL:
49         push            bp
50         mov             bp,sp
51         sub             sp,0
52         push            ds
53         push            si
54         mov             si,word ptr 0aH[bp]
55         cmp             si,word ptr cs:MX_CLIPX1
56         jl              L$2
57         cmp             si,word ptr cs:MX_CLIPX2
58         jg              L$2
59         mov             ax,word ptr 8[bp]
60         cmp             ax,word ptr cs:MX_CLIPY1
61         jl              L$2
62         cmp             ax,word ptr cs:MX_CLIPY2
63         jg              L$2
64         mov             ds,word ptr cs:MX_VIDEOSEGMENT
65         mul             word ptr cs:MX_BYTESPERLINE
66         shr             si,1
67         shr             si,1
68         add             si,ax
69         mov             cl,byte ptr 0aH[bp]
70         and             cl,3
71         mov             ax,102H
72         shl             ah,cl
73         mov             dx,3c4H
74         out             dx,ax
75         mov             al,byte ptr 6[bp]
76         mov             byte ptr [si],al
77 L$2:
78         xor             ax,ax
79         pop             si
80         pop             ds
81         mov             sp,bp
82         pop             bp
83         retf            6
84 MX_TEXT         ENDS
85                 END