source: xtideuniversalbios/trunk/Assembly_Library/Src/Menu/Dialog/DialogString.asm @ 568

Last change on this file since 568 was 568, checked in by krille_n_@…, 9 years ago

Changes:

  • SerDrive: Using named pipe mode (serdrive -p) now works under Windows XP/2000/Server 2003.
  • checksum.pl: Added a compatibility fix for 3Com 3C503 cards.
  • XTIDECFG will now scan every possible segment address to find and load the BIOS and/or its settings from EEPROM. This should simplify things for people using combined option ROMs.
  • Fixed a bug from r521 in BootSector.asm where the BIOS would not display a timeout error if it failed to load the boot sector from harddrive.
  • Fixed a bug from r541 in CompatibleDPT.asm where CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI would generate an invalid checksum in the DPTE.
  • Optimizations and other fixes.
File size: 3.6 KB
Line 
1; Project name  :   Assembly Library
2; Description   :   Displays word input dialog.
3
4;
5; XTIDE Universal BIOS and Associated Tools
6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
7;
8; This program is free software; you can redistribute it and/or modify
9; it under the terms of the GNU General Public License as published by
10; the Free Software Foundation; either version 2 of the License, or
11; (at your option) any later version.
12;
13; This program is distributed in the hope that it will be useful,
14; but WITHOUT ANY WARRANTY; without even the implied warranty of
15; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16; GNU General Public License for more details.
17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18;
19
20; Section containing code
21SECTION .text
22
23;--------------------------------------------------------------------
24; DialogString_GetStringWithIoInDSSI
25;   Parameters:
26;       DS:SI:  Ptr to STRING_DIALOG_IO
27;       SS:BP:  Ptr to parent MENU
28;   Returns:
29;       Nothing
30;   Corrupts registers:
31;       AX, BX, CX, DX, SI, DI
32;--------------------------------------------------------------------
33ALIGN JUMP_ALIGN
34DialogString_GetStringWithIoInDSSI:
35    mov     bx, StringEventHandler
36    mov     BYTE [si+STRING_DIALOG_IO.bUserCancellation], TRUE
37    jmp     Dialog_DisplayWithDialogInputInDSSIandHandlerInBX
38
39
40;--------------------------------------------------------------------
41; StringEventHandler
42;   Common parameters for all events:
43;       BX:         Menu event (anything from MENUEVENT struct)
44;       SS:BP:      Ptr to DIALOG
45;   Common return values for all events:
46;       CF:         Set if event processed
47;                   Cleared if event not processed
48;   Corrupts registers:
49;       All
50;--------------------------------------------------------------------
51ALIGN JUMP_ALIGN
52StringEventHandler:
53    jmp     [cs:bx+.rgfnEventHandlers]
54
55
56ALIGN JUMP_ALIGN
57.InitializeMenuinitFromDSSI:
58    xor     ax, ax
59    jmp     Dialog_EventInitializeMenuinitFromDSSIforSingleItemWithHighlightedItemInAX
60
61
62ALIGN JUMP_ALIGN
63.IdleProcessing:
64    xor     cx, cx                      ; Item 0 is used as input line
65    call    MenuText_AdjustDisplayContextForDrawingItemFromCX
66    call    GetStringFromUser
67    call    MenuInit_CloseMenuWindow
68    stc
69    ret
70
71
72ALIGN WORD_ALIGN
73.rgfnEventHandlers:
74istruc MENUEVENT
75    at  MENUEVENT.InitializeMenuinitFromDSSI,   dw  .InitializeMenuinitFromDSSI
76    at  MENUEVENT.ExitMenu,                     dw  Dialog_EventExitMenu
77    at  MENUEVENT.IdleProcessing,               dw  .IdleProcessing
78    at  MENUEVENT.ItemHighlightedFromCX,        dw  Dialog_EventNotHandled
79    at  MENUEVENT.ItemSelectedFromCX,           dw  Dialog_EventNotHandled
80    at  MENUEVENT.KeyStrokeInAX,                dw  Dialog_EventNotHandled
81    at  MENUEVENT.RefreshTitle,                 dw  Dialog_EventRefreshTitle
82    at  MENUEVENT.RefreshInformation,           dw  Dialog_EventRefreshInformation
83    at  MENUEVENT.RefreshItemFromCX,            dw  Dialog_EventNotHandled
84iend
85
86
87;--------------------------------------------------------------------
88; GetStringFromUser
89;   Parameters
90;       SS:BP:  Ptr to DIALOG
91;   Returns:
92;       Nothing (User input stored to STRING_DIALOG_IO)
93;   Corrupts registers:
94;       AX, CX, DX, SI, DI
95;--------------------------------------------------------------------
96ALIGN JUMP_ALIGN
97GetStringFromUser:
98    lds     si, [bp+DIALOG.fpDialogIO]
99    mov     cx, [si+STRING_DIALOG_IO.wBufferSize]
100    les     di, [si+STRING_DIALOG_IO.fpReturnBuffer]
101    mov     dx, [si+STRING_DIALOG_IO.fnCharFilter]
102    test    dx, dx
103    jnz     SHORT .CharacterFilterFunctionInDX
104    mov     dx, Char_CharIsValid
105
106.CharacterFilterFunctionInDX:
107    call    Keyboard_ReadUserInputtedStringToESDIWhilePrinting
108    jz      SHORT .UserCancellation
109
110    mov     BYTE [si+STRING_DIALOG_IO.bUserCancellation], FALSE
111    mov     [si+STRING_DIALOG_IO.wReturnLength], cx
112.UserCancellation:
113    ret
Note: See TracBrowser for help on using the repository browser.