]> 4ch.mooo.com Git - 16.git/blob - 16/xw__/mxcc.asm
having the palette in the game code may help. also i added wolf3d's palette for exama...
[16.git] / 16 / xw__ / mxcc.asm
1 .387
2                 PUBLIC  XSUBCLIPLINE
3                 EXTRN   MX_CLIPY1:BYTE
4                 EXTRN   MX_CLIPY2:BYTE
5                 EXTRN   MX_CLIPX2:BYTE
6                 EXTRN   MX_CLIPX1:BYTE
7                 EXTRN   MX_VIDEOSEGMENT:BYTE
8                 EXTRN   MX_BYTESPERLINE:BYTE
9 MX_TEXT         SEGMENT PARA PUBLIC USE16 'CODE'
10                 ASSUME CS:MX_TEXT, DS:DGROUP, SS:DGROUP
11 L$1:
12         or              al,byte ptr [bx+si]
13 L$2:
14     DW  offset L$3
15         or              al,byte ptr [bx+si]
16     DW  offset L$4
17         or              word ptr [bx+si],ax
18     DW  offset L$5
19         ????
20         inc             word ptr [bx+si]
21         add             byte ptr [bp+si],cl
22         add             byte ptr 0a00H[bx+si],al
23         add             byte ptr 900H[bp],dl
24         add             byte ptr -100H[si],ch
25         inc             word ptr [bx+si]
26         add             byte ptr ds:[0c000H],al
27         add             byte ptr ds:[0ce00H],al
28         add             byte ptr [di],al
29         add             ah,bl
30         add             bh,bh
31         inc             word ptr [bx+si]
32         add             bh,bh
33         inc             word ptr [bx+si]
34         add             bh,bh
35         inc             word ptr [bx+si]
36         add             bh,bh
37         inc             word ptr [bx+si]
38         add             bh,bh
39         inc             word ptr [bx+si]
40     DB  0
41 L$3:
42     DW  offset MX_TEXT+0ecH
43     DW  offset MX_TEXT+0eeH
44     DW  offset MX_TEXT+0f1H
45     DW  offset MX_TEXT+0eaH
46     DW  offset MX_TEXT+0f4H
47     DW  offset MX_TEXT+0f7H
48     DW  offset MX_TEXT+104H
49     DW  offset MX_TEXT+0eaH
50     DW  offset MX_TEXT+111H
51     DW  offset MX_TEXT+114H
52     DW  offset MX_TEXT+121H
53 L$4:
54     DW  offset MX_TEXT+132H
55     DW  offset MX_TEXT+0eaH
56     DW  offset MX_TEXT+135H
57     DW  offset MX_TEXT+0eaH
58     DW  offset MX_TEXT+13bH
59     DW  offset MX_TEXT+0eaH
60     DW  offset MX_TEXT+148H
61     DW  offset L$7
62     DW  offset L$10
63     DW  offset L$7
64     DW  offset L$11
65 L$5:
66     DW  offset L$14
67     DW  offset L$15
68     DW  offset L$7
69     DW  offset L$7
70     DW  offset L$16
71     DW  offset L$17
72     DW  offset L$7
73     DW  offset L$7
74     DW  offset L$18
75     DW  offset L$19
76     DW  offset L$22
77     DW  offset L$23
78     DW  offset L$24
79     DW  offset L$7
80     DW  offset L$7
81     DW  offset L$7
82     DW  offset L$7
83     DW  offset L$7
84     DW  offset L$25
85     DW  offset L$26
86     DW  offset L$27
87     DW  offset L$30
88     DW  offset L$7
89     DW  offset L$31
90     DW  offset L$7
91     DW  offset L$7
92     DW  offset L$7
93     DW  offset L$7
94     DW  offset L$7
95     DW  offset L$32
96     DW  offset L$7
97     DW  offset L$33
98     DW  offset L$36
99     DW  offset L$37
100     DW  offset L$7
101     DW  offset L$7
102     DW  offset L$7
103     DW  offset L$7
104     DW  offset L$7
105     DW  offset L$7
106     DW  offset L$38
107     DW  offset L$39
108     DW  offset L$43
109     DW  offset L$44
110     DW  offset L$45
111     DW  offset L$7
112     DW  offset L$46
113     DW  offset L$47
114     DW  offset L$48
115     DW  offset L$51
116     DW  offset L$7
117     DW  offset L$52
118     DW  offset L$7
119     DW  offset L$53
120     DW  offset L$7
121     DW  offset L$54
122     DW  offset L$58
123     DW  offset L$59
124     DW  offset L$7
125     DW  offset L$7
126     DW  offset L$60
127     DW  offset L$61
128 L$6:
129         clc
130         ret
131 L$7:
132         stc
133         ret
134         clc
135         ret
136         jmp             near ptr L$67
137         jmp             near ptr L$68
138         jmp             near ptr L$70
139         call            near ptr L$67
140         cmp             si,word ptr cs:MX_CLIPY1
141         jge             L$6
142         jmp             near ptr L$70
143         call            near ptr L$68
144         cmp             si,word ptr cs:MX_CLIPY1
145         jge             L$6
146         jmp             near ptr L$70
147         jmp             near ptr L$69
148         call            near ptr L$67
149         cmp             si,word ptr cs:MX_CLIPY2
150         jle             L$6
151         jmp             near ptr L$69
152         call            near ptr L$68
153         cmp             si,word ptr cs:MX_CLIPY2
154         jle             L$6
155         jmp             near ptr L$69
156 L$8:
157         stc
158         ret
159 L$9:
160         clc
161         ret
162         jmp             near ptr L$63
163         call            near ptr L$63
164         jmp             near ptr L$68
165         call            near ptr L$63
166         cmp             bx,word ptr cs:MX_CLIPY1
167         jl              L$8
168         jmp             near ptr L$70
169         call            near ptr L$63
170         cmp             bx,word ptr cs:MX_CLIPY1
171         jl              L$8
172         call            near ptr L$70
173         cmp             cx,word ptr cs:MX_CLIPX2
174         jle             L$9
175         jmp             near ptr L$68
176 L$10:
177         call            near ptr L$63
178         cmp             bx,word ptr cs:MX_CLIPY2
179         jg              L$8
180         jmp             near ptr L$69
181 L$11:
182         call            near ptr L$63
183         cmp             bx,word ptr cs:MX_CLIPY2
184         jg              L$8
185         call            near ptr L$69
186         cmp             cx,word ptr cs:MX_CLIPX2
187         jle             L$9
188         jmp             near ptr L$68
189 L$12:
190         clc
191         ret
192 L$13:
193         stc
194         ret
195 L$14:
196         jmp             near ptr L$64
197 L$15:
198         call            near ptr L$64
199         jmp             near ptr L$67
200 L$16:
201         call            near ptr L$64
202         cmp             bx,word ptr cs:MX_CLIPY1
203         jl              L$13
204         jmp             near ptr L$70
205 L$17:
206         call            near ptr L$64
207         cmp             bx,word ptr cs:MX_CLIPY1
208         jl              L$13
209         call            near ptr L$70
210         cmp             cx,word ptr cs:MX_CLIPX1
211         jge             L$12
212         jmp             near ptr L$67
213 L$18:
214         call            near ptr L$64
215         cmp             bx,word ptr cs:MX_CLIPY2
216         jg              L$13
217         jmp             near ptr L$69
218 L$19:
219         call            near ptr L$64
220         cmp             bx,word ptr cs:MX_CLIPY2
221         jg              L$13
222         call            near ptr L$69
223         cmp             cx,word ptr cs:MX_CLIPX1
224         jge             L$12
225         jmp             near ptr L$67
226 L$20:
227         clc
228         ret
229 L$21:
230         stc
231         ret
232 L$22:
233         jmp             near ptr L$66
234 L$23:
235         call            near ptr L$66
236         cmp             di,word ptr cs:MX_CLIPX1
237         jl              L$21
238         call            near ptr L$67
239         cmp             si,word ptr cs:MX_CLIPY1
240         jge             L$20
241         jmp             near ptr L$70
242 L$24:
243         call            near ptr L$66
244         cmp             di,word ptr cs:MX_CLIPX2
245         jg              L$21
246         jmp             near ptr L$68
247 L$25:
248         call            near ptr L$66
249         jmp             near ptr L$69
250 L$26:
251         call            near ptr L$66
252         cmp             di,word ptr cs:MX_CLIPX1
253         jl              L$21
254         call            near ptr L$67
255         cmp             si,word ptr cs:MX_CLIPY2
256         jle             L$20
257         jmp             near ptr L$69
258 L$27:
259         call            near ptr L$66
260         cmp             di,word ptr cs:MX_CLIPX2
261         jg              L$21
262         call            near ptr L$68
263         cmp             si,word ptr cs:MX_CLIPY2
264         jle             L$20
265         jmp             near ptr L$69
266 L$28:
267         clc
268         ret
269 L$29:
270         stc
271         ret
272 L$30:
273         call            near ptr L$63
274         cmp             bx,word ptr cs:MX_CLIPY1
275         jge             L$28
276         jmp             near ptr L$66
277 L$31:
278         call            near ptr L$68
279         cmp             si,word ptr cs:MX_CLIPY1
280         jl              L$29
281         call            near ptr L$66
282         cmp             di,word ptr cs:MX_CLIPX1
283         jge             L$28
284         jmp             near ptr L$63
285 L$32:
286         call            near ptr L$69
287         cmp             cx,word ptr cs:MX_CLIPX1
288         jl              L$29
289         call            near ptr L$66
290         cmp             di,word ptr cs:MX_CLIPX1
291         jge             L$28
292         jmp             near ptr L$63
293 L$33:
294         call            near ptr L$63
295         cmp             bx,word ptr cs:MX_CLIPY2
296         jg              L$29
297         call            near ptr L$68
298         cmp             bx,word ptr cs:MX_CLIPY1
299         jl              L$29
300         cmp             si,word ptr cs:MX_CLIPY2
301         jle             L$28
302         jmp             near ptr L$69
303 L$34:
304         clc
305         ret
306 L$35:
307         stc
308         ret
309 L$36:
310         call            near ptr L$64
311         cmp             bx,word ptr cs:MX_CLIPY1
312         jge             L$34
313         jmp             near ptr L$66
314 L$37:
315         call            near ptr L$67
316         cmp             si,word ptr cs:MX_CLIPY2
317         jl              L$35
318         call            near ptr L$66
319         cmp             di,word ptr cs:MX_CLIPX2
320         jle             L$34
321         jmp             near ptr L$64
322 L$38:
323         call            near ptr L$69
324         cmp             cx,word ptr cs:MX_CLIPX2
325         jg              L$35
326         call            near ptr L$64
327         cmp             bx,word ptr cs:MX_CLIPY1
328         jge             L$34
329         jmp             near ptr L$66
330 L$39:
331         call            near ptr L$67
332         cmp             si,word ptr cs:MX_CLIPY1
333         jl              L$35
334         call            near ptr L$64
335         cmp             bx,word ptr cs:MX_CLIPY2
336         jg              L$35
337         cmp             si,word ptr cs:MX_CLIPY2
338         jle             L$40
339         call            near ptr L$69
340 L$40:
341         cmp             bx,word ptr cs:MX_CLIPY1
342         jge             L$34
343         jmp             near ptr L$66
344 L$41:
345         clc
346         ret
347 L$42:
348         stc
349         ret
350 L$43:
351         jmp             near ptr L$65
352 L$44:
353         call            near ptr L$65
354         cmp             di,word ptr cs:MX_CLIPX1
355         jl              L$42
356         jmp             near ptr L$67
357 L$45:
358         call            near ptr L$65
359         cmp             di,word ptr cs:MX_CLIPX2
360         jg              L$42
361         jmp             near ptr L$68
362 L$46:
363         call            near ptr L$65
364         jmp             near ptr L$70
365 L$47:
366         call            near ptr L$65
367         cmp             di,word ptr cs:MX_CLIPX1
368         jl              L$42
369         call            near ptr L$67
370         cmp             si,word ptr cs:MX_CLIPY1
371         jge             L$42
372         jmp             near ptr L$70
373 L$48:
374         call            near ptr L$65
375         cmp             di,word ptr cs:MX_CLIPX2
376         jg              L$42
377         call            near ptr L$68
378         cmp             si,word ptr cs:MX_CLIPY1
379         jge             L$41
380         jmp             near ptr L$70
381 L$49:
382         clc
383         ret
384 L$50:
385         stc
386         ret
387 L$51:
388         call            near ptr L$63
389         cmp             bx,word ptr cs:MX_CLIPY2
390         jle             L$49
391         jmp             near ptr L$65
392 L$52:
393         call            near ptr L$68
394         cmp             si,word ptr cs:MX_CLIPY2
395         jg              L$50
396         call            near ptr L$65
397         cmp             di,word ptr cs:MX_CLIPX1
398         jge             L$49
399         jmp             near ptr L$63
400 L$53:
401         call            near ptr L$70
402         cmp             cx,word ptr cs:MX_CLIPX1
403         jl              L$50
404         call            near ptr L$63
405         cmp             bx,word ptr cs:MX_CLIPY2
406         jle             L$49
407         jmp             near ptr L$65
408 L$54:
409         call            near ptr L$63
410         cmp             bx,word ptr cs:MX_CLIPY1
411         jl              L$50
412         call            near ptr L$68
413         cmp             si,word ptr cs:MX_CLIPY2
414         jg              L$50
415         cmp             bx,word ptr cs:MX_CLIPY2
416         jle             L$55
417         call            near ptr L$65
418 L$55:
419         cmp             si,word ptr cs:MX_CLIPY1
420         jge             L$49
421         jmp             near ptr L$70
422 L$56:
423         clc
424         ret
425 L$57:
426         stc
427         ret
428 L$58:
429         call            near ptr L$64
430         cmp             bx,word ptr cs:MX_CLIPY2
431         jle             L$56
432         jmp             near ptr L$65
433 L$59:
434         call            near ptr L$67
435         cmp             si,word ptr cs:MX_CLIPY2
436         jg              L$57
437         call            near ptr L$65
438         cmp             di,word ptr cs:MX_CLIPX2
439         jle             L$56
440         jmp             L$64
441 L$60:
442         call            near ptr L$70
443         cmp             cx,word ptr cs:MX_CLIPX2
444         jg              L$57
445         call            near ptr L$64
446         cmp             bx,word ptr cs:MX_CLIPY2
447         jle             L$56
448         jmp             L$65
449 L$61:
450         call            near ptr L$67
451         cmp             si,word ptr cs:MX_CLIPY2
452         jg              L$57
453         call            near ptr L$64
454         cmp             bx,word ptr cs:MX_CLIPY1
455         jl              L$57
456         cmp             si,word ptr cs:MX_CLIPY1
457         jge             L$62
458         call            near ptr L$70
459 L$62:
460         cmp             bx,word ptr cs:MX_CLIPY2
461         jle             L$56
462         jmp             L$65
463 L$63:
464         mov             ax,si
465         sub             ax,bx
466         mov             dx,word ptr cs:MX_CLIPX1
467         sub             dx,di
468         imul            dx
469         mov             bp,cx
470         sub             bp,di
471         idiv            bp
472         add             bx,ax
473         mov             di,word ptr cs:MX_CLIPX1
474         clc
475         ret
476 L$64:
477         mov             ax,si
478         sub             ax,bx
479         mov             dx,word ptr cs:MX_CLIPX2
480         sub             dx,di
481         imul            dx
482         mov             bp,cx
483         sub             bp,di
484         idiv            bp
485         add             bx,ax
486         mov             di,word ptr cs:MX_CLIPX2
487         clc
488         ret
489 L$65:
490         mov             ax,cx
491         sub             ax,di
492         mov             dx,word ptr cs:MX_CLIPY2
493         sub             dx,bx
494         imul            dx
495         mov             bp,si
496         sub             bp,bx
497         idiv            bp
498         add             di,ax
499         mov             bx,word ptr cs:MX_CLIPY2
500         clc
501         ret
502 L$66:
503         mov             ax,cx
504         sub             ax,di
505         mov             dx,word ptr cs:MX_CLIPY1
506         sub             dx,bx
507         imul            dx
508         mov             bp,si
509         sub             bp,bx
510         idiv            bp
511         add             di,ax
512         mov             bx,word ptr cs:MX_CLIPY1
513         clc
514         ret
515 L$67:
516         mov             ax,bx
517         sub             ax,si
518         mov             dx,word ptr cs:MX_CLIPX1
519         sub             dx,cx
520         imul            dx
521         mov             bp,di
522         sub             bp,cx
523         idiv            bp
524         add             si,ax
525         mov             cx,word ptr cs:MX_CLIPX1
526         clc
527         ret
528 L$68:
529         mov             ax,bx
530         sub             ax,si
531         mov             dx,word ptr cs:MX_CLIPX2
532         sub             dx,cx
533         imul            dx
534         mov             bp,di
535         sub             bp,cx
536         idiv            bp
537         add             si,ax
538         mov             cx,word ptr cs:MX_CLIPX2
539         clc
540         ret
541 L$69:
542         mov             ax,di
543         sub             ax,cx
544         mov             dx,word ptr cs:MX_CLIPY2
545         sub             dx,si
546         imul            dx
547         mov             bp,bx
548         sub             bp,si
549         idiv            bp
550         add             cx,ax
551         mov             si,word ptr cs:MX_CLIPY2
552         clc
553         ret
554 L$70:
555         mov             ax,di
556         sub             ax,cx
557         mov             dx,word ptr cs:MX_CLIPY1
558         sub             dx,si
559         imul            dx
560         mov             bp,bx
561         sub             bp,si
562         idiv            bp
563         add             cx,ax
564         mov             si,word ptr cs:MX_CLIPY1
565         clc
566         ret
567 XSUBCLIPLINE:
568         push            bp
569         xor             si,si
570         cmp             dx,word ptr cs:MX_CLIPY2
571         jle             L$71
572         or              si,8
573         jmp             L$72
574 L$71:
575         cmp             dx,word ptr cs:MX_CLIPY1
576         jge             L$72
577         or              si,4
578 L$72:
579         cmp             cx,word ptr cs:MX_CLIPX2
580         jle             L$73
581         or              si,2
582         jmp             L$74
583 L$73:
584         cmp             cx,word ptr cs:MX_CLIPX1
585         jge             L$74
586         or              si,1
587 L$74:
588         cmp             bx,word ptr cs:MX_CLIPY2
589         jle             L$75
590         or              si,80H
591         jmp             L$76
592 L$75:
593         cmp             bx,word ptr cs:MX_CLIPY1
594         jge             L$76
595         or              si,40H
596 L$76:
597         cmp             ax,word ptr cs:MX_CLIPX2
598         jle             L$77
599         or              si,20H
600         jmp             L$78
601 L$77:
602         cmp             ax,word ptr cs:MX_CLIPX1
603         jge             L$78
604         or              si,10H
605 L$78:
606         mov             di,si
607         and             di,0fH
608         and             si,0f0H
609         shr             si,1
610         shr             si,1
611         cmp             di,word ptr cs:L$1[si]
612         jg              L$79
613         mov             si,word ptr cs:L$2[si]
614         shl             di,1
615         add             si,di
616         mov             di,ax
617         mov             si,word ptr cs:[si]
618         xchg            si,dx
619         call            dx
620         mov             ax,di
621         mov             dx,si
622         pop             bp
623         ret
624 L$79:
625         pop             bp
626         stc
627         ret
628 MX_TEXT         ENDS
629                 END