#include <defs.inc>
#include <frag_mac.inc>
#include <patchproc.inc>

uvard saOrderWindows, 8

patchproc anyflagset, dopatch

begincodefragments
codefragment OrderWindowElemList, -14	// If this number is at least +1, or ...
	dw 11,319

endcodefragments


%macro StoreWin 0
	mov [ebx], edi
	add ebx, 4
	//inc edi			// ... if I uncomment this, it works properly.
%endmacro

dopatch:
	mov ebx, saOrderWindows
	multipatchcode OrderWindowElemList,,8, {StoreWin}
	ret
