	SECTION _TEXT align=1 CLASS=CODE USE32
	SECTION _DATA align=16 CLASS=DATA USE32
	SECTION _BSS align=16 CLASS=BSS USE32
	SECTION _CONST align=16 CLASS=CONST USE32
	SECTION _STRING align=4 CLASS=STRING USE32
	SECTION cstartup align=4 CLASS=INITDATA USE32
	SECTION crundown align=4 CLASS=EXITDATA USE32
	SECTION cppinit  align=4 CLASS=CPPINIT USE32
	SECTION cppexit  align=4 CLASS=CPPEXIT USE32
	GROUP DGROUP _DATA _BSS _CONST _STRING

SECTION _TEXT
[GLOBAL	_MessageBoxProc]
;
; Line 11:	int MessageBoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_MessageBoxProc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EBX,DWORD [EBP+010H]
	MOV	ESI,DWORD [EBP+08H]
	MOV	EDI,DWORD [EBP+0CH]
L_2:
;
; Line 12:	{
;
;
; Line 13:	switch (msg)    {
;
	CMP	EDI,BYTE 03H
	JE	SHORT	L_5
	CMP	EDI,BYTE 015H
	JE	SHORT	L_6
	JMP	SHORT	L_4
L_5:
;
; Line 15:	GetClass(wnd) = MESSAGEBOX;
;
	MOV	DWORD [ESI+00H],012H
;
; Line 16:	InitWindowColors(wnd);
;
	PUSH	ESI
	CALL	_InitWindowColors
	POP	ECX
;
; Line 17:	ClearAttribute(wnd, CONTROLBOX);
;
	AND	DWORD [ESI+054H],0FFFFFDFFH
;
; Line 18:	break;
;
	JMP	SHORT	L_3
L_6:
;
; Line 20:	if (p1 == '\r' || p1 == ESC)
;
	CMP	EBX,BYTE 0DH
	JE	SHORT	L_9
	CMP	EBX,BYTE 01BH
	JNE	SHORT	L_7
L_9:
;
; Line 21:	ReturnValue = (int)p1;
;
	MOV	DWORD [_ReturnValue],EBX
L_7:
;
; Line 22:	break;
;
	JMP	SHORT	L_3
L_4:
;
; Line 24:	break;
;
	JMP	SHORT	L_3
L_3:
;
; Line 26:	return BaseWndProc(MESSAGEBOX, wnd, msg, p1, p2);
;
	PUSH	DWORD [EBP+014H]
	PUSH	EBX
	MOV	EAX,EDI
	MOVSX	EAX,AX
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [_classdefs+0D8H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_1:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_YesNoBoxProc]
;
; Line 29:	int YesNoBoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_YesNoBoxProc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EDI,DWORD [EBP+010H]
L_11:
;
; Line 30:	{
;
;
; Line 31:	switch (msg)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,BYTE 03H
	JE	SHORT	L_14
	CMP	EAX,BYTE 015H
	JE	SHORT	L_15
	JMP	SHORT	L_13
L_14:
;
; Line 33:	GetClass(wnd) = MESSAGEBOX;
;
	MOV	DWORD [ESI+00H],012H
;
; Line 34:	InitWindowColors(wnd);
;
	PUSH	ESI
	CALL	_InitWindowColors
	POP	ECX
;
; Line 35:	ClearAttribute(wnd, CONTROLBOX);
;
	AND	DWORD [ESI+054H],0FFFFFDFFH
;
; Line 36:	break;
;
	JMP	SHORT	L_12
L_15:
;
; Line 38:	int c = tolower((int)p1);
;
	PUSH	EDI
	CALL	_tolower
	POP	ECX
	MOV	EBX,EAX
;
; Line 39:	if (c == 'y')
;
	CMP	EBX,BYTE 079H
	JNE	SHORT	L_16
;
; Line 40:	SendMessage(wnd, COMMAND, ID_OK, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 034H
	PUSH	BYTE 02H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_17
L_16:
;
; Line 41:	else if (c == 'n')
;
	CMP	EBX,BYTE 06EH
	JNE	SHORT	L_18
;
; Line 42:	SendMessage(wnd, COMMAND, ID_CANCEL, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 035H
	PUSH	BYTE 02H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
L_18:
L_17:
;
; Line 43:	break;
;
	JMP	SHORT	L_12
L_13:
;
; Line 46:	break;
;
	JMP	SHORT	L_12
L_12:
;
; Line 48:	return BaseWndProc(MESSAGEBOX, wnd, msg, p1, p2);
;
	PUSH	DWORD [EBP+014H]
	PUSH	EDI
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [_classdefs+0D8H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_10:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_ErrorBoxProc]
;
; Line 51:	int ErrorBoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_ErrorBoxProc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EBX,DWORD [EBP+010H]
	MOV	ESI,DWORD [EBP+08H]
	MOV	EDI,DWORD [EBP+0CH]
L_21:
;
; Line 52:	{
;
;
; Line 53:	switch (msg)    {
;
	CMP	EDI,BYTE 03H
	JE	SHORT	L_24
	CMP	EDI,BYTE 015H
	JE	SHORT	L_25
	JMP	SHORT	L_23
L_24:
;
; Line 55:	GetClass(wnd) = ERRORBOX;
;
	MOV	DWORD [ESI+00H],011H
;
; Line 56:	InitWindowColors(wnd);
;
	PUSH	ESI
	CALL	_InitWindowColors
	POP	ECX
;
; Line 57:	break;
;
	JMP	SHORT	L_22
L_25:
;
; Line 59:	if (p1 == '\r' || p1 == ESC)
;
	CMP	EBX,BYTE 0DH
	JE	SHORT	L_28
	CMP	EBX,BYTE 01BH
	JNE	SHORT	L_26
L_28:
;
; Line 60:	ReturnValue = (int)p1;
;
	MOV	DWORD [_ReturnValue],EBX
L_26:
;
; Line 61:	break;
;
	JMP	SHORT	L_22
L_23:
;
; Line 63:	break;
;
	JMP	SHORT	L_22
L_22:
;
; Line 65:	return BaseWndProc(ERRORBOX, wnd, msg, p1, p2);
;
	PUSH	DWORD [EBP+014H]
	PUSH	EBX
	MOV	EAX,EDI
	MOVSX	EAX,AX
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [_classdefs+0CCH]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_20:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_CancelBoxProc]
;
; Line 68:	int CancelBoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_CancelBoxProc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EBX,DWORD [EBP+08H]
	MOV	ESI,DWORD [EBP+010H]
	MOV	EDI,DWORD [EBP+014H]
L_30:
;
; Line 69:	{
;
;
; Line 70:	switch (msg)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,BYTE 02H
	JE	SHORT	L_34
	CMP	EAX,BYTE 03H
	JE	SHORT	L_33
	CMP	EAX,BYTE 07H
	JE	SHORT	L_35
	JMP	SHORT	L_32
L_33:
;
; Line 72:	CancelWnd = wnd;
;
	MOV	DWORD [_CancelWnd],EBX
;
; Line 73:	SendMessage(wnd, CAPTURE_MOUSE, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 02EH
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 74:	SendMessage(wnd, CAPTURE_KEYBOARD, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 016H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 75:	break;
;
	JMP	SHORT	L_31
L_34:
;
; Line 77:	if ((int) p1 == ID_CANCEL && (int) p2 == 0)
;
	CMP	ESI,BYTE 035H
	JNE	SHORT	L_36
	TEST	EDI,EDI
	JNE	SHORT	L_36
;
; Line 78:	SendMessage(GetParent(wnd), msg, p1, p2);
;
	PUSH	EDI
	PUSH	ESI
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	DWORD [EBX+03CH]
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
L_36:
;
; Line 79:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_29
L_35:
;
; Line 81:	CancelWnd = NULL;
;
	MOV	DWORD [_CancelWnd],00H
;
; Line 82:	SendMessage(wnd, RELEASE_MOUSE, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 02FH
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 83:	SendMessage(wnd, RELEASE_KEYBOARD, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 017H
	PUSH	EBX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 84:	p1 = TRUE;
;
	MOV	ESI,01H
;
; Line 85:	break;
;
	JMP	SHORT	L_31
L_32:
;
; Line 87:	break;
;
	JMP	SHORT	L_31
L_31:
;
; Line 89:	return BaseWndProc(MESSAGEBOX, wnd, msg, p1, p2);
;
	PUSH	EDI
	PUSH	ESI
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	EBX
	MOV	EAX,DWORD [_classdefs+0D8H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_29:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_CloseCancelBox]
;
; Line 92:	void CloseCancelBox(void)
;
_CloseCancelBox:
L_39:
;
; Line 93:	{
;
;
; Line 94:	if (CancelWnd != NULL)
;
	CMP	DWORD [_CancelWnd],BYTE 00H
	JE	SHORT	L_40
;
; Line 95:	SendMessage(CancelWnd, CLOSE_WINDOW, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 07H
	PUSH	DWORD [_CancelWnd]
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
L_40:
;
; Line 96:	}
;
L_38:
	RET
[GLOBAL	_InputBoxProc]
;
; Line 101:	int InputBoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_InputBoxProc:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EBX,DWORD [EBP+010H]
	MOV	EDI,DWORD [EBP+014H]
L_43:
;
; Line 102:	{
;
;
; Line 104:	switch (msg)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,BYTE 02H
	JE	NEAR	L_47
	CMP	EAX,BYTE 03H
	JE	SHORT	L_46
	JMP	NEAR	L_45
L_46:
;
; Line 106:	rtn = DefaultWndProc(wnd, msg, p1, p2);
;
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CMP	DWORD [EAX+04H+_classdefs+00H],BYTE 00H
	JNE	SHORT	L_48
	PUSH	EDI
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	MOV	EAX,DWORD [EAX+_classdefs+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_49
L_48:
	PUSH	EDI
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_49:
	MOV	DWORD [EBP-04H],EAX
;
; Line 107:	SendMessage(ControlWindow(&InputBoxDB,ID_INPUTTEXT),
;
	PUSH	BYTE 00H
	PUSH	DWORD [_TextLength]
	PUSH	BYTE 03BH
	PUSH	BYTE 051H
	PUSH	DWORD _InputBoxDB
	CALL	_ControlWindow
	ADD	ESP,BYTE 08H
	PUSH	EAX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 109:	SendMessage(ControlWindow(&InputBoxDB,ID_INPUTTEXT),
;
	PUSH	BYTE 00H
	PUSH	DWORD [_InputText]
	PUSH	BYTE 030H
	PUSH	BYTE 051H
	PUSH	DWORD _InputBoxDB
	CALL	_ControlWindow
	ADD	ESP,BYTE 08H
	PUSH	EAX
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 111:	return rtn;
;
	MOV	EAX,DWORD [EBP-04H]
	JMP	SHORT	L_42
L_47:
;
; Line 113:	if ((int) p1 == ID_OK && (int) p2 == 0)
;
	CMP	EBX,BYTE 034H
	JNE	SHORT	L_50
	TEST	EDI,EDI
	JNE	SHORT	L_50
;
; Line 114:	GetItemText(wnd, ID_INPUTTEXT,
;
	PUSH	DWORD [_TextLength]
	PUSH	DWORD [_InputText]
	PUSH	BYTE 051H
	PUSH	ESI
	CALL	_GetItemText
	ADD	ESP,BYTE 010H
L_50:
;
; Line 116:	break;
;
	JMP	SHORT	L_44
L_45:
;
; Line 118:	break;
;
	JMP	SHORT	L_44
L_44:
;
; Line 120:	return DefaultWndProc(wnd, msg, p1, p2);
;
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CMP	DWORD [EAX+04H+_classdefs+00H],BYTE 00H
	JNE	SHORT	L_52
	PUSH	EDI
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	MOV	EAX,DWORD [EAX+_classdefs+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_53
L_52:
	PUSH	EDI
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_53:
L_42:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	_InputBox]
;
; Line 123:	BOOL InputBox(WINDOW wnd,char *ttl,char *msg,char *text,int len,int wd)
;
_InputBox:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EBX,DWORD [EBP+010H]
	MOV	EDI,DWORD [EBP+0CH]
L_55:
;
; Line 124:	{
;
;
; Line 125:	int ln = wd ? wd : len;
;
	CMP	DWORD [EBP+01CH],BYTE 00H
	JE	SHORT	L_56
	MOV	EAX,DWORD [EBP+01CH]
	JMP	SHORT	L_57
L_56:
	MOV	EAX,DWORD [EBP+018H]
L_57:
	MOV	ESI,EAX
;
; Line 126:	ln = min(SCREENWIDTH-8, ln);
;
	MOV	EAX,04AH
	MOVZX	ECX,WORD [___seg0040]
	MOV	EDX,ECX
	MOV	FS,DX
	MOVSX	EAX,BYTE [FS:EAX+00H]
	MOVZX	EAX,AL
	SUB	EAX,BYTE 08H
	CMP	EAX,ESI
	JGE	SHORT	L_58
	MOV	EAX,04AH
	MOVZX	ECX,WORD [___seg0040]
	MOV	EDX,ECX
	MOV	FS,DX
	MOVSX	EAX,BYTE [FS:EAX+00H]
	MOVZX	EAX,AL
	SUB	EAX,BYTE 08H
	JMP	SHORT	L_59
L_58:
	MOV	EAX,ESI
L_59:
	MOV	ESI,EAX
;
; Line 127:	InputText = text;
;
	MOV	EAX,DWORD [EBP+014H]
	MOV	DWORD [_InputText],EAX
;
; Line 128:	TextLength = len;
;
	MOV	EAX,DWORD [EBP+018H]
	MOV	DWORD [_TextLength],EAX
;
; Line 129:	InputBoxDB.dwnd.title = ttl;
;
	MOV	DWORD [_InputBoxDB+04H],EDI
;
; Line 130:	InputBoxDB.dwnd.w = 4 + max(20, max(ln, max(strlen(ttl), strlen(msg))));
;
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	PUSH	EAX
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	CMP	ECX,EAX
	JBE	SHORT	L_64
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	JMP	SHORT	L_65
L_64:
	PUSH	EBX
	CALL	_strlen
	POP	ECX
L_65:
	CMP	ESI,EAX
	JLE	SHORT	L_62
	MOV	EAX,ESI
	JMP	SHORT	L_63
L_62:
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	PUSH	EAX
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	CMP	ECX,EAX
	JBE	SHORT	L_66
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	JMP	SHORT	L_67
L_66:
	PUSH	EBX
	CALL	_strlen
	POP	ECX
L_67:
L_63:
	CMP	EAX,BYTE 014H
	JGE	SHORT	L_60
	MOV	EAX,014H
	JMP	SHORT	L_61
L_60:
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	PUSH	EAX
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	CMP	ECX,EAX
	JBE	SHORT	L_70
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	JMP	SHORT	L_71
L_70:
	PUSH	EBX
	CALL	_strlen
	POP	ECX
L_71:
	CMP	ESI,EAX
	JLE	SHORT	L_68
	MOV	EAX,ESI
	JMP	SHORT	L_69
L_68:
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	PUSH	EAX
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	CMP	ECX,EAX
	JBE	SHORT	L_72
	PUSH	EDI
	CALL	_strlen
	POP	ECX
	JMP	SHORT	L_73
L_72:
	PUSH	EBX
	CALL	_strlen
	POP	ECX
L_73:
L_69:
L_61:
	ADD	EAX,BYTE 04H
	MOV	DWORD [_InputBoxDB+014H],EAX
;
; Line 131:	InputBoxDB.ctl[1].dwnd.x = (InputBoxDB.dwnd.w-2-ln)/2;
;
	MOV	EAX,DWORD [_InputBoxDB+014H]
	SUB	EAX,BYTE 02H
	SUB	EAX,ESI
	SAR	EAX,01H
	JNS	SHORT	L_74
	ADC	EAX,BYTE 00H
L_74:
	MOV	DWORD [04CH+_InputBoxDB],EAX
;
; Line 132:	InputBoxDB.ctl[0].dwnd.w = strlen(msg);
;
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	MOV	DWORD [028H+_InputBoxDB],EAX
;
; Line 133:	InputBoxDB.ctl[0].itext = msg;
;
	MOV	DWORD [_InputBoxDB+030H],EBX
;
; Line 134:	InputBoxDB.ctl[1].itext = NULL;
;
	MOV	DWORD [_InputBoxDB+060H],00H
;
; Line 135:	InputBoxDB.ctl[1].dwnd.w = ln;
;
	MOV	DWORD [058H+_InputBoxDB],ESI
;
; Line 136:	InputBoxDB.ctl[2].dwnd.x = (InputBoxDB.dwnd.w - 20) / 2;
;
	MOV	EAX,DWORD [_InputBoxDB+014H]
	SUB	EAX,BYTE 014H
	SAR	EAX,01H
	JNS	SHORT	L_75
	ADC	EAX,BYTE 00H
L_75:
	MOV	DWORD [07CH+_InputBoxDB],EAX
;
; Line 137:	InputBoxDB.ctl[3].dwnd.x = InputBoxDB.ctl[2].dwnd.x + 10;
;
	MOV	EAX,DWORD [07CH+_InputBoxDB]
	ADD	EAX,BYTE 0AH
	MOV	DWORD [0ACH+_InputBoxDB],EAX
;
; Line 138:	InputBoxDB.ctl[2].isetting = ON;
;
	MOV	DWORD [_InputBoxDB+09CH],01H
;
; Line 139:	InputBoxDB.ctl[3].isetting = ON;
;
	MOV	DWORD [_InputBoxDB+0CCH],01H
;
; Line 140:	return DialogBox(wnd, &InputBoxDB, TRUE, InputBoxProc);
;
	PUSH	DWORD _InputBoxProc
	PUSH	BYTE 01H
	PUSH	DWORD _InputBoxDB
	PUSH	DWORD [EBP+08H]
	CALL	_DialogBox
	ADD	ESP,BYTE 010H
L_54:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_GenericMessage]
;
; Line 143:	BOOL GenericMessage(WINDOW wnd,char *ttl,char *msg,int buttonct,
;
_GenericMessage:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD _MsgBox
	MOV	EBX,DWORD [EBP+014H]
L_77:
;
; Line 146:	{
;
;
; Line 148:	MsgBox.dwnd.title = ttl;
;
	MOV	EAX,DWORD [EBP+0CH]
	MOV	DWORD [ESI+04H],EAX
;
; Line 149:	MsgBox.ctl[0].dwnd.h = MsgHeight(msg);
;
	PUSH	DWORD [EBP+010H]
	CALL	_MsgHeight
	POP	ECX
	MOV	DWORD [ESI+024H],EAX
;
; Line 151:	MsgBox.ctl[0].dwnd.w = max(max(MsgWidth(msg), 								   buttonct*8 + buttonct + 2), strlen(ttl)+2);
;
	PUSH	DWORD [EBP+0CH]
	CALL	_strlen
	POP	ECX
	ADD	EAX,BYTE 02H
	MOV	ECX,EBX
	SHL	ECX,03H
	ADD	ECX,EBX
	ADD	ECX,BYTE 02H
	PUSH	EAX
	PUSH	ECX
	PUSH	DWORD [EBP+010H]
	CALL	_MsgWidth
	POP	ECX
	MOV	EDX,EAX
	POP	ECX
	POP	EAX
	CMP	EDX,ECX
	JLE	SHORT	L_80
	PUSH	EAX
	PUSH	DWORD [EBP+010H]
	CALL	_MsgWidth
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	JMP	SHORT	L_81
L_80:
	MOV	ECX,EBX
	SHL	ECX,03H
	ADD	ECX,EBX
	ADD	ECX,BYTE 02H
L_81:
	CMP	ECX,EAX
	JBE	SHORT	L_78
	MOV	EAX,EBX
	SHL	EAX,03H
	ADD	EAX,EBX
	ADD	EAX,BYTE 02H
	PUSH	EAX
	PUSH	DWORD [EBP+010H]
	CALL	_MsgWidth
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	CMP	ECX,EAX
	JLE	SHORT	L_82
	PUSH	DWORD [EBP+010H]
	CALL	_MsgWidth
	POP	ECX
	JMP	SHORT	L_83
L_82:
	MOV	EAX,EBX
	SHL	EAX,03H
	ADD	EAX,EBX
	ADD	EAX,BYTE 02H
L_83:
	JMP	SHORT	L_79
L_78:
	PUSH	DWORD [EBP+0CH]
	CALL	_strlen
	POP	ECX
	ADD	EAX,BYTE 02H
L_79:
	MOV	DWORD [ESI+028H],EAX
;
; Line 152:	MsgBox.dwnd.h = MsgBox.ctl[0].dwnd.h+6;
;
	MOV	EAX,DWORD [ESI+024H]
	ADD	EAX,BYTE 06H
	MOV	DWORD [ESI+010H],EAX
;
; Line 153:	MsgBox.dwnd.w = MsgBox.ctl[0].dwnd.w+4;
;
	MOV	EAX,DWORD [ESI+028H]
	ADD	EAX,BYTE 04H
	MOV	DWORD [ESI+014H],EAX
;
; Line 154:	if (buttonct == 1)
;
	CMP	EBX,BYTE 01H
	JNE	SHORT	L_84
;
; Line 155:	MsgBox.ctl[1].dwnd.x = (MsgBox.dwnd.w - 10) / 2;
;
	MOV	EAX,DWORD [ESI+014H]
	SUB	EAX,BYTE 0AH
	SAR	EAX,01H
	JNS	SHORT	L_86
	ADC	EAX,BYTE 00H
L_86:
	MOV	DWORD [ESI+04CH],EAX
	JMP	SHORT	L_85
L_84:
;
; Line 157:	MsgBox.ctl[1].dwnd.x = (MsgBox.dwnd.w - 20) / 2;
;
	MOV	EAX,DWORD [ESI+014H]
	SUB	EAX,BYTE 014H
	SAR	EAX,01H
	JNS	SHORT	L_87
	ADC	EAX,BYTE 00H
L_87:
	MOV	DWORD [ESI+04CH],EAX
;
; Line 158:	MsgBox.ctl[2].dwnd.x = MsgBox.ctl[1].dwnd.x + 10;
;
	MOV	EAX,DWORD [ESI+04CH]
	ADD	EAX,BYTE 0AH
	MOV	DWORD [ESI+07CH],EAX
;
; Line 159:	MsgBox.ctl[2].Class = BUTTON;
;
	MOV	DWORD [ESI+08CH],0BH
L_85:
;
; Line 161:	MsgBox.ctl[1].dwnd.y = MsgBox.dwnd.h - 4;
;
	MOV	EAX,DWORD [ESI+010H]
	SUB	EAX,BYTE 04H
	MOV	DWORD [ESI+050H],EAX
;
; Line 162:	MsgBox.ctl[2].dwnd.y = MsgBox.dwnd.h - 4;
;
	MOV	EAX,DWORD [ESI+010H]
	SUB	EAX,BYTE 04H
	MOV	DWORD [ESI+080H],EAX
;
; Line 163:	MsgBox.ctl[0].itext = msg;
;
	MOV	EAX,DWORD [EBP+010H]
	MOV	DWORD [ESI+030H],EAX
;
; Line 164:	MsgBox.ctl[1].itext = b1;
;
	MOV	EAX,DWORD [EBP+01CH]
	MOV	DWORD [ESI+060H],EAX
;
; Line 165:	MsgBox.ctl[2].itext = b2;
;
	MOV	EAX,DWORD [EBP+020H]
	MOV	DWORD [ESI+090H],EAX
;
; Line 166:	MsgBox.ctl[1].command = c1;
;
	MOV	EAX,DWORD [EBP+024H]
	MOV	DWORD [ESI+064H],EAX
;
; Line 167:	MsgBox.ctl[2].command = c2;
;
	MOV	EAX,DWORD [EBP+028H]
	MOV	DWORD [ESI+094H],EAX
;
; Line 168:	MsgBox.ctl[1].isetting = ON;
;
	MOV	DWORD [ESI+06CH],01H
;
; Line 169:	MsgBox.ctl[2].isetting = ON;
;
	MOV	DWORD [ESI+09CH],01H
;
; Line 170:	rtn = DialogBox(wnd, &MsgBox, isModal, wndproc);
;
	PUSH	DWORD [EBP+018H]
	MOVSX	EAX,WORD [EBP+02CH]
	PUSH	EAX
	PUSH	ESI
	PUSH	DWORD [EBP+08H]
	CALL	_DialogBox
	ADD	ESP,BYTE 010H
	MOV	EDI,EAX
;
; Line 171:	MsgBox.ctl[2].Class = 0;
;
	MOV	DWORD [ESI+08CH],00H
;
; Line 172:	return rtn;
;
	MOV	EAX,EDI
L_76:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_MomentaryMessage]
;
; Line 175:	WINDOW MomentaryMessage(char *msg)
;
_MomentaryMessage:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	EBX,DWORD [EBP+08H]
L_89:
;
; Line 176:	{
;
;
; Line 177:	WINDOW wnd = CreateWindow(
;
	PUSH	DWORD 04081H
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	EBX
	CALL	_MsgWidth
	POP	ECX
	ADD	EAX,BYTE 02H
	PUSH	EAX
	PUSH	EBX
	CALL	_MsgHeight
	POP	ECX
	ADD	EAX,BYTE 02H
	PUSH	EAX
	PUSH	BYTE 0FFFFFFFFH
	PUSH	BYTE 0FFFFFFFFH
	PUSH	BYTE 00H
	PUSH	BYTE 02H
	CALL	_CreateWindow
	ADD	ESP,BYTE 028H
	MOV	ESI,EAX
;
; Line 183:	SendMessage(wnd, SETTEXT, (PARAM) msg, 0);
;
	PUSH	BYTE 00H
	PUSH	EBX
	PUSH	BYTE 034H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 184:	if (cfg.mono == 0)    {
;
	MOVSX	EAX,BYTE [0BH+_cfg]
	TEST	EAX,EAX
	JNE	SHORT	L_90
;
; Line 185:	WindowClientColor(wnd, WHITE, GREEN);
;
	MOV	BYTE [ESI+034H],0FH
	MOV	BYTE [ESI+035H],02H
;
; Line 186:	WindowFrameColor(wnd, WHITE, GREEN);
;
	MOV	BYTE [ESI+038H],0FH
	MOV	BYTE [ESI+039H],02H
L_90:
;
; Line 188:	SendMessage(wnd, SHOW_WINDOW, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 05H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 189:	return wnd;
;
	MOV	EAX,ESI
L_88:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_MsgHeight]
;
; Line 192:	int MsgHeight(char *msg)
;
_MsgHeight:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
L_93:
;
; Line 193:	{
;
;
; Line 194:	int h = 1;
;
	MOV	EBX,01H
	JMP	SHORT	L_94
L_96:
;
; Line 196:	h++;
;
	INC	EBX
;
; Line 197:	msg++;
;
	INC	ESI
L_94:
;
; Line 195:	while ((msg = strchr(msg, '\n')) != NULL)    {
;
	PUSH	BYTE 0AH
	PUSH	ESI
	CALL	_strchr
	ADD	ESP,BYTE 08H
	MOV	ESI,EAX
	TEST	EAX,EAX
	JNE	SHORT	L_96
L_95:
;
; Line 199:	return min(h, SCREENHEIGHT-10);
;
	CALL	_isVGA
	TEST	EAX,EAX
	JNE	SHORT	L_101
	CALL	_isEGA
	TEST	EAX,EAX
	JE	SHORT	L_99
L_101:
	MOV	EAX,084H
	MOVZX	ECX,WORD [___seg0040]
	MOV	EDX,ECX
	MOV	FS,DX
	MOVSX	EAX,BYTE [FS:EAX+00H]
	INC	EAX
	JMP	SHORT	L_100
L_99:
	MOV	EAX,019H
L_100:
	SUB	EAX,BYTE 0AH
	CMP	EBX,EAX
	JGE	SHORT	L_97
	MOV	EAX,EBX
	JMP	SHORT	L_98
L_97:
	CALL	_isVGA
	TEST	EAX,EAX
	JNE	SHORT	L_104
	CALL	_isEGA
	TEST	EAX,EAX
	JE	SHORT	L_102
L_104:
	MOV	EAX,084H
	MOVZX	ECX,WORD [___seg0040]
	MOV	EDX,ECX
	MOV	FS,DX
	MOVSX	EAX,BYTE [FS:EAX+00H]
	INC	EAX
	JMP	SHORT	L_103
L_102:
	MOV	EAX,019H
L_103:
	SUB	EAX,BYTE 0AH
L_98:
L_92:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_MsgWidth]
;
; Line 202:	int MsgWidth(char *msg)
;
_MsgWidth:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EBX,DWORD [EBP+08H]
L_106:
;
; Line 203:	{
;
;
; Line 204:	int w = 0;
;
	MOV	ESI,00H
;
; Line 205:	char *cp = msg;
;
	MOV	EDI,EBX
	JMP	SHORT	L_107
L_109:
;
; Line 207:	w = max(w, (int) (cp-msg));
;
	MOV	EAX,EDI
	SUB	EAX,EBX
	CMP	ESI,EAX
	JLE	SHORT	L_110
	MOV	EAX,ESI
	JMP	SHORT	L_111
L_110:
	MOV	EAX,EDI
	SUB	EAX,EBX
L_111:
	MOV	ESI,EAX
;
; Line 208:	msg = cp+1;
;
	MOV	EBX,EDI
	INC	EBX
L_107:
;
; Line 206:	while ((cp = strchr(msg, '\n')) != NULL)    {
;
	PUSH	BYTE 0AH
	PUSH	EBX
	CALL	_strchr
	ADD	ESP,BYTE 08H
	MOV	EDI,EAX
	TEST	EAX,EAX
	JNE	SHORT	L_109
L_108:
;
; Line 210:	return min(max(strlen(msg),w), SCREENWIDTH-10);
;
	MOV	EAX,04AH
	MOVZX	ECX,WORD [___seg0040]
	MOV	EDX,ECX
	MOV	FS,DX
	MOVSX	EAX,BYTE [FS:EAX+00H]
	MOVZX	EAX,AL
	SUB	EAX,BYTE 0AH
	PUSH	EAX
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	CMP	ECX,ESI
	JBE	SHORT	L_114
	PUSH	EAX
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	MOV	ECX,EAX
	POP	EAX
	JMP	SHORT	L_115
L_114:
	MOV	ECX,ESI
L_115:
	CMP	ECX,EAX
	JGE	SHORT	L_112
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	CMP	EAX,ESI
	JBE	SHORT	L_116
	PUSH	EBX
	CALL	_strlen
	POP	ECX
	JMP	SHORT	L_117
L_116:
	MOV	EAX,ESI
L_117:
	JMP	SHORT	L_113
L_112:
	MOV	EAX,04AH
	MOVZX	ECX,WORD [___seg0040]
	MOV	EDX,ECX
	MOV	FS,DX
	MOVSX	EAX,BYTE [FS:EAX+00H]
	MOVZX	EAX,AL
	SUB	EAX,BYTE 0AH
L_113:
L_105:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
SECTION _BSS
[GLOBAL	_CancelWnd]

_CancelWnd	RESB	04H

_ReturnValue	RESB	04H

_InputText	RESB	04H

_TextLength	RESB	04H
SECTION _CONST

SECTION _TEXT
[EXTERN	_InitWindowColors]
[EXTERN	_CreateWindow]
[EXTERN	_GetItemText]
[EXTERN	_strlen]
[EXTERN	_DialogBox]
[EXTERN	_isEGA]
[EXTERN	_cfg]
[EXTERN	_ControlWindow]
[EXTERN	_MsgBox]
[EXTERN	_isVGA]
[EXTERN	_tolower]
[EXTERN	_classdefs]
[EXTERN	_SendMessage]
[EXTERN	_InputBoxDB]
[EXTERN	___seg0040]
[EXTERN	_strchr]
