1 ; Catacomb Armageddon Source Code
\r
2 ; Copyright (C) 1993-2014 Flat Rock Software
\r
4 ; This program is free software; you can redistribute it and/or modify
\r
5 ; it under the terms of the GNU General Public License as published by
\r
6 ; the Free Software Foundation; either version 2 of the License, or
\r
7 ; (at your option) any later version.
\r
9 ; This program is distributed in the hope that it will be useful,
\r
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 ; GNU General Public License for more details.
\r
14 ; You should have received a copy of the GNU General Public License along
\r
15 ; with this program; if not, write to the Free Software Foundation, Inc.,
\r
16 ; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 include "ID_ASM.EQU"
\r
23 ;===========================================================================
\r
27 ;===========================================================================
\r
44 ;=========================================================================
\r
50 EXTRN screenseg:WORD
\r
51 EXTRN linewidth:WORD
\r
57 labcount = labcount + 1
\r
63 ;==================================================
\r
65 ; void scaleline (int scale, unsigned picseg, unsigned maskseg,
\r
66 ; unsigned screen, unsigned width)
\r
68 ;==================================================
\r
70 PROC ScaleLine pixels:word, scaleptr:dword, picptr:dword, screen:word
\r
75 ; modify doline procedure for proper width
\r
83 mov bx,[endtable+bx]
\r
84 push [cs:bx] ;save the code that will be modified over
\r
85 mov [WORD cs:bx],0d18eh ;mov ss,cx
\r
86 push [cs:bx+2] ;save the code that will be modified over
\r
87 mov [WORD cs:bx+2],90c3h ;ret / nop
\r
92 mov di,[WORD screen]
\r
95 mov si,[WORD scaleptr]
\r
96 mov ds,[WORD scaleptr+2]
\r
98 mov bx,[WORD picptr]
\r
99 mov ax,[WORD picptr+2] ;will be moved into ss after call
\r
107 ; restore doline to regular state
\r
109 pop bx ;address of modified code
\r
121 ; Big unwound scaling routine
\r
123 ; ds:si = scale table
\r
125 ; es:di = screen location
\r
132 mov ss,ax ;can't call a routine with ss used...
\r
139 labcount = labcount + 1
\r
141 lodsb ; get scaled pixel number
\r
142 xlat [ss:bx] ; look it up in the picture
\r
143 xchg [es:di],al ; load latches and write pixel to screen
\r
144 add di,dx ; down to next line
\r