source: xtideuniversalbios/trunk/Assembly_Library/Src/Menu/Dialog/DialogDrive.asm @ 625

Last change on this file since 625 was 625, checked in by krille_n_, 14 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: 4.1 KB
Line 
1; Project name  :   Assembly Library
2; Description   :   Displays drive 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; DialogDrive_GetDriveWithIoInDSSI
25;   Parameters:
26;       DS:SI:  Ptr to DRIVE_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
34DialogDrive_GetDriveWithIoInDSSI:
35    mov     bx, DriveEventHandler
36    mov     BYTE [si+DRIVE_DIALOG_IO.bUserCancellation], TRUE
37    jmp     Dialog_DisplayWithDialogInputInDSSIandHandlerInBX
38
39
40;--------------------------------------------------------------------
41; DriveEventHandler
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
52DriveEventHandler:
53    jmp     [cs:bx+.rgfnEventHandlers]
54
55
56ALIGN JUMP_ALIGN
57.InitializeMenuinitFromDSSI:
58    call    Dialog_EventInitializeMenuinitFromDSSIforSingleItemWithItemZero
59    call    Drive_GetFlagsForAvailableDrivesToDXAX
60    mov     [bp+MENU.dwUserData], ax
61    mov     [bp+MENU.dwUserData+2], dx
62
63    call    Bit_GetSetCountToCXfromDXAX
64    mov     [bp+MENUINIT.wItems], cx
65
66    dec     cx          ; Items initialized to one. Ignore it.
67    add     cl, [bp+MENUINIT.bHeight]
68    CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH
69    MIN_U   cl, ah
70    mov     [bp+MENUINIT.bHeight], cl
71    ret
72
73
74ALIGN JUMP_ALIGN
75.ItemSelectedFromCX:
76    call    ConvertDriveLetterToBLfromItemIndexInCX
77    lds     si, [bp+DIALOG.fpDialogIO]
78    mov     BYTE [si+DRIVE_DIALOG_IO.bUserCancellation], FALSE
79    mov     [si+DRIVE_DIALOG_IO.cReturnDriveLetter], bl
80    sub     bl, 'A'
81    mov     [si+DRIVE_DIALOG_IO.bReturnDriveNumber], bl
82    jmp     MenuInit_CloseMenuWindow
83
84
85ALIGN JUMP_ALIGN
86.RefreshItemFromCX:
87    push    bp
88
89    call    ConvertDriveLetterToBLfromItemIndexInCX
90    mov     bp, sp
91    push    bx
92    mov     si, g_szDriveFormat
93    CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
94
95    pop     bp
96    stc
97    ret
98
99
100.rgfnEventHandlers:
101istruc MENUEVENT
102    at  MENUEVENT.InitializeMenuinitFromDSSI,   dw  .InitializeMenuinitFromDSSI
103    at  MENUEVENT.ExitMenu,                     dw  Dialog_EventExitMenu
104    at  MENUEVENT.IdleProcessing,               dw  Dialog_EventNotHandled
105    at  MENUEVENT.ItemHighlightedFromCX,        dw  Dialog_EventNotHandled
106    at  MENUEVENT.ItemSelectedFromCX,           dw  .ItemSelectedFromCX
107    at  MENUEVENT.KeyStrokeInAX,                dw  Dialog_EventNotHandled
108    at  MENUEVENT.RefreshTitle,                 dw  Dialog_EventRefreshTitle
109    at  MENUEVENT.RefreshInformation,           dw  Dialog_EventRefreshInformation
110    at  MENUEVENT.RefreshItemFromCX,            dw  .RefreshItemFromCX
111iend
112
113
114;--------------------------------------------------------------------
115; ConvertDriveLetterToBLfromItemIndexInCX
116;   Parameters:
117;       CX:     Item index
118;       SS:BP:  Ptr to DIALOG
119;   Returns:
120;       BL:     Drive letter
121;   Corrupts registers:
122;       AX, CX, DX
123;--------------------------------------------------------------------
124ALIGN JUMP_ALIGN
125ConvertDriveLetterToBLfromItemIndexInCX:
126    inc     cx          ; Index to count
127    mov     bl, 'A'-1
128    mov     ax, [bp+MENU.dwUserData]
129    mov     dx, [bp+MENU.dwUserData+2]
130ALIGN JUMP_ALIGN
131.CheckNextBit:
132    inc     bx          ; Increment drive letter
133    shr     dx, 1
134    rcr     ax, 1
135    jnc     SHORT .CheckNextBit
136    loop    .CheckNextBit
137    ret
Note: See TracBrowser for help on using the repository browser.