home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 16
/
CD_ASCQ_16_0994.iso
/
news
/
vr386
/
renderer
/
rendmem.inc
< prev
next >
Wrap
Text File
|
1993-12-22
|
702b
|
39 lines
extrn _nvalloc:DWORD ; pointer to alloc-down vertex area
extrn _npalloc:DWORD ; pointer to alloc-up poly area
; alloc new vertex
; returns new vertex in ES:BX
; BX only affected
ALLOCVTX MACRO
les bx,_nvalloc
sub bx, SIZE NVERTEX
mov WORD PTR _nvalloc,bx
mov BYTE PTR es:[bx].NV_persp,0
ENDM
; alloc new poly
; returns new poly in ES:BX
; BX only affected
ALLOCPOLY MACRO
les bx,_npalloc
add bx, SIZE NPOLY
mov WORD PTR_npalloc,bx
sub bx, SIZE NPOLY
ENDM
CHECKMEM MACRO num_vertex
mov ax,num_vertex
imul ax,SIZE NVERTEX
add ax,200
add ax,WORD PTR _npalloc
neg ax
add ax,WORD PTR _nvalloc ; carry clear if out of memory
ENDM