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

Last change on this file was 625, checked in by Krister Nordvall, 22 months ago

Changes:

  • Added a configuration option to let the BIOS store RamVars to an UMB when Full operating mode is enabled. This is primarily for XT class machines with RAM in the UMA (which apparently is a common thing these days).
  • Added two new builds specifically for IBM PS/2 machines. This is for support of the new McIDE adapter from the guys at zzxio.com. Note that the additional hardware specific code (under the USE_PS2 define) is for the PS/2 machines themselves and not for the McIDE adapters, so any controller in an IBM PS/2 machine can be used with the USE_PS2 define.
  • Moved pColorTheme out of the range of ROMVARS being copied over when doing "Load old settings from EEPROM" in XTIDECFG. This fixed a serious bug from r592 where loading a BIOS from file and then loading the old settings from ROM would corrupt 7 bytes of code somewhere in the loaded BIOS.
  • Optimizations (speed and size) to the library. Browsing the menus in XTIDECFG should now feel a little less sluggish.
  • Hopefully fixed a problem with the PostCommitHook script where it sometimes wouldn't find the CommitInProgress file. I say hopefully because testing this is a nightmare.
File size: 3.5 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-2023 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, 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.IdleProcessing:
58 xor cx, cx ; Item 0 is used as input line
59 call MenuText_AdjustDisplayContextForDrawingItemFromCX
60 call GetStringFromUser
61 call MenuInit_CloseMenuWindow
62 stc
63 ret
64
65
66ALIGN WORD_ALIGN
67.rgfnEventHandlers:
68istruc MENUEVENT
69 at MENUEVENT.InitializeMenuinitFromDSSI, dw Dialog_EventInitializeMenuinitFromDSSIforSingleItemWithItemZero
70 at MENUEVENT.ExitMenu, dw Dialog_EventExitMenu
71 at MENUEVENT.IdleProcessing, dw .IdleProcessing
72 at MENUEVENT.ItemHighlightedFromCX, dw Dialog_EventNotHandled
73 at MENUEVENT.ItemSelectedFromCX, dw Dialog_EventNotHandled
74 at MENUEVENT.KeyStrokeInAX, dw Dialog_EventNotHandled
75 at MENUEVENT.RefreshTitle, dw Dialog_EventRefreshTitle
76 at MENUEVENT.RefreshInformation, dw Dialog_EventRefreshInformation
77 at MENUEVENT.RefreshItemFromCX, dw Dialog_EventNotHandled
78iend
79
80
81;--------------------------------------------------------------------
82; GetStringFromUser
83; Parameters
84; SS:BP: Ptr to DIALOG
85; Returns:
86; Nothing (User input stored to STRING_DIALOG_IO)
87; Corrupts registers:
88; AX, CX, DX, SI, DI
89;--------------------------------------------------------------------
90ALIGN JUMP_ALIGN
91GetStringFromUser:
92 lds si, [bp+DIALOG.fpDialogIO]
93 mov cx, [si+STRING_DIALOG_IO.wBufferSize]
94 les di, [si+STRING_DIALOG_IO.fpReturnBuffer]
95 mov dx, [si+STRING_DIALOG_IO.fnCharFilter]
96 test dx, dx
97 jnz SHORT .CharacterFilterFunctionInDX
98 mov dx, Char_CharIsValid
99
100.CharacterFilterFunctionInDX:
101 call Keyboard_ReadUserInputtedStringToESDIWhilePrinting
102 jz SHORT .UserCancellation
103
104 mov BYTE [si+STRING_DIALOG_IO.bUserCancellation], FALSE
105 mov [si+STRING_DIALOG_IO.wReturnLength], cx
106.UserCancellation:
107 ret
Note: See TracBrowser for help on using the repository browser.