[293] | 1 | ; Project name : XTIDE Universal BIOS Configurator
|
---|
[2] | 2 | ; Description : Menu for configuring DRVPARAMS.
|
---|
| 3 |
|
---|
| 4 | ; Section containing initialized data
|
---|
| 5 | SECTION .data
|
---|
| 6 |
|
---|
| 7 | ; -Back to previous menu
|
---|
| 8 | ; Block Mode Transfers (Y)
|
---|
| 9 | ; User Specified CHS (Y)
|
---|
| 10 | ; Cylinders (16383)
|
---|
| 11 | ; Heads (16)
|
---|
| 12 | ; Sectors per track (63)
|
---|
| 13 |
|
---|
| 14 | ALIGN WORD_ALIGN
|
---|
| 15 | g_MenuPageDrvParams:
|
---|
| 16 | istruc MENUPAGE
|
---|
| 17 | at MENUPAGE.bItemCnt, db 6
|
---|
| 18 | iend
|
---|
| 19 | istruc MENUPAGEITEM ; Back to previous menu
|
---|
| 20 | at MENUPAGEITEM.fnActivate, dw MainPageItem_ActivateLeaveSubmenu
|
---|
| 21 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
| 22 | at MENUPAGEITEM.szName, dw g_szPreviousMenu
|
---|
| 23 | at MENUPAGEITEM.szInfo, dw g_szNfoDrvBack
|
---|
| 24 | at MENUPAGEITEM.szHelp, dw g_szNfoDrvBack
|
---|
| 25 | at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
|
---|
| 26 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_BACK
|
---|
| 27 | iend
|
---|
| 28 | g_MenuPageItemDrvBlockMode:
|
---|
| 29 | istruc MENUPAGEITEM ; Block Mode Transfers
|
---|
| 30 | at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetBoolFromUser
|
---|
| 31 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
| 32 | at MENUPAGEITEM.wValueMask, dw FLG_DRVPARAMS_BLOCKMODE
|
---|
| 33 | at MENUPAGEITEM.szName, dw g_szItemDrvBlockMode
|
---|
| 34 | at MENUPAGEITEM.szInfo, dw g_szNfoDrvBlockMode
|
---|
| 35 | at MENUPAGEITEM.szHelp, dw g_szHelpDrvBlockMode
|
---|
| 36 | at MENUPAGEITEM.szDialog, dw g_szDlgDrvBlockMode
|
---|
| 37 | at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
|
---|
| 38 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_FLAG
|
---|
| 39 | iend
|
---|
| 40 | g_MenuPageItemDrvUserCHS:
|
---|
| 41 | istruc MENUPAGEITEM ; User Specified CHS
|
---|
| 42 | at MENUPAGEITEM.fnActivate, dw DrvParamsMenu_ActivateUserCHS
|
---|
| 43 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
| 44 | at MENUPAGEITEM.wValueMask, dw FLG_DRVPARAMS_USERCHS
|
---|
| 45 | at MENUPAGEITEM.szName, dw g_szItemDrvUserCHS
|
---|
| 46 | at MENUPAGEITEM.szInfo, dw g_szNfoDrvUserCHS
|
---|
| 47 | at MENUPAGEITEM.szHelp, dw g_szHelpDrvUserCHS
|
---|
| 48 | at MENUPAGEITEM.szDialog, dw g_szDlgDrvUserCHS
|
---|
| 49 | at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
|
---|
| 50 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_FLAG
|
---|
| 51 | iend
|
---|
| 52 | g_MenuPageItemDrvCyls:
|
---|
| 53 | istruc MENUPAGEITEM ; Cylinders
|
---|
| 54 | at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetWordFromUser
|
---|
| 55 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
| 56 | at MENUPAGEITEM.wValueMin, dw 1
|
---|
| 57 | at MENUPAGEITEM.wValueMax, dw 16383
|
---|
| 58 | at MENUPAGEITEM.szName, dw g_szItemDrvCyls
|
---|
| 59 | at MENUPAGEITEM.szInfo, dw g_szNfoDrvCyls
|
---|
| 60 | at MENUPAGEITEM.szHelp, dw g_szNfoDrvCyls
|
---|
| 61 | at MENUPAGEITEM.szDialog, dw g_szDlgDrvCyls
|
---|
| 62 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_UNSIGNED_WORD
|
---|
| 63 | iend
|
---|
| 64 | g_MenuPageItemDrvHeads:
|
---|
| 65 | istruc MENUPAGEITEM ; Heads
|
---|
| 66 | at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetByteFromUser
|
---|
| 67 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
| 68 | at MENUPAGEITEM.wValueMin, dw 1
|
---|
| 69 | at MENUPAGEITEM.wValueMax, dw 16
|
---|
| 70 | at MENUPAGEITEM.szName, dw g_szItemDrvHeads
|
---|
| 71 | at MENUPAGEITEM.szInfo, dw g_szNfoDrvHeads
|
---|
| 72 | at MENUPAGEITEM.szHelp, dw g_szNfoDrvHeads
|
---|
| 73 | at MENUPAGEITEM.szDialog, dw g_szDlgDrvHeads
|
---|
| 74 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_UNSIGNED_BYTE
|
---|
| 75 | iend
|
---|
| 76 | g_MenuPageItemDrvSect:
|
---|
| 77 | istruc MENUPAGEITEM ; Sectors per track
|
---|
| 78 | at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetByteFromUser
|
---|
| 79 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
| 80 | at MENUPAGEITEM.wValueMin, dw 1
|
---|
| 81 | at MENUPAGEITEM.wValueMax, dw 63
|
---|
| 82 | at MENUPAGEITEM.szName, dw g_szItemDrvSect
|
---|
| 83 | at MENUPAGEITEM.szInfo, dw g_szNfoDrvSect
|
---|
| 84 | at MENUPAGEITEM.szHelp, dw g_szNfoDrvSect
|
---|
| 85 | at MENUPAGEITEM.szDialog, dw g_szDlgDrvSect
|
---|
| 86 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_UNSIGNED_BYTE
|
---|
| 87 | iend
|
---|
| 88 |
|
---|
| 89 |
|
---|
| 90 | ; Section containing code
|
---|
| 91 | SECTION .text
|
---|
| 92 |
|
---|
| 93 | ;--------------------------------------------------------------------
|
---|
| 94 | ; Stores DRVPARAMS specific pointers to MENUPAGEITEM structs.
|
---|
| 95 | ;
|
---|
| 96 | ; DrvParamsMenu_SetDrvParamsOffset
|
---|
| 97 | ; Parameters:
|
---|
| 98 | ; AX: Offset to DRVPARAMS
|
---|
| 99 | ; DS: CS
|
---|
| 100 | ; Returns:
|
---|
| 101 | ; Nothing
|
---|
| 102 | ; Corrupts registers:
|
---|
| 103 | ; BX, CX
|
---|
| 104 | ;--------------------------------------------------------------------
|
---|
| 105 | ALIGN JUMP_ALIGN
|
---|
| 106 | DrvParamsMenu_SetDrvParamsOffset:
|
---|
[293] | 107 | eMOVZX cx, [g_MenuPageDrvParams+MENUPAGE.bItemCnt]
|
---|
[2] | 108 | dec cx
|
---|
| 109 | mov bx, g_MenuPageItemDrvBlockMode+MENUPAGEITEM.pValue
|
---|
| 110 | ALIGN JUMP_ALIGN
|
---|
| 111 | .StoreIdevarsLoop:
|
---|
| 112 | mov [bx], ax
|
---|
| 113 | add bx, MENUPAGEITEM_size
|
---|
| 114 | loop .StoreIdevarsLoop
|
---|
| 115 |
|
---|
| 116 | ; Add offsets to values
|
---|
| 117 | add WORD [g_MenuPageItemDrvBlockMode+MENUPAGEITEM.pValue], BYTE DRVPARAMS.wFlags
|
---|
| 118 | add WORD [g_MenuPageItemDrvUserCHS+MENUPAGEITEM.pValue], BYTE DRVPARAMS.wFlags
|
---|
| 119 | add WORD [g_MenuPageItemDrvCyls+MENUPAGEITEM.pValue], BYTE DRVPARAMS.wCylinders
|
---|
| 120 | add WORD [g_MenuPageItemDrvHeads+MENUPAGEITEM.pValue], BYTE DRVPARAMS.bHeads
|
---|
| 121 | add WORD [g_MenuPageItemDrvSect+MENUPAGEITEM.pValue], BYTE DRVPARAMS.bSect
|
---|
| 122 | ret
|
---|
| 123 |
|
---|
| 124 |
|
---|
| 125 | ;--------------------------------------------------------------------
|
---|
| 126 | ; DrvParamsMenu_ActivateUserCHS
|
---|
| 127 | ; Parameters:
|
---|
| 128 | ; DS:SI Ptr to MENUPAGE
|
---|
| 129 | ; DS:DI Ptr to MENUPAGEITEM
|
---|
| 130 | ; SS:BP: Ptr to MENUVARS
|
---|
| 131 | ; Returns:
|
---|
| 132 | ; CF: Set if menuitem changed
|
---|
| 133 | ; Cleared if no changes
|
---|
| 134 | ; Corrupts registers:
|
---|
| 135 | ; AX, BX, CX, DX
|
---|
| 136 | ;--------------------------------------------------------------------
|
---|
| 137 | ALIGN JUMP_ALIGN
|
---|
| 138 | DrvParamsMenu_ActivateUserCHS:
|
---|
| 139 | call MenuPageItem_GetBoolFromUser
|
---|
| 140 | jc SHORT DrvParamsMenu_SetMenuitemVisibilityAndDrawChanges
|
---|
| 141 | ret
|
---|
| 142 |
|
---|
| 143 |
|
---|
| 144 | ;--------------------------------------------------------------------
|
---|
| 145 | ; DrvParamsMenu_SetMenuitemVisibilityAndDrawChanges
|
---|
| 146 | ; Parameters:
|
---|
| 147 | ; DS:SI: Ptr to MENUPAGE
|
---|
| 148 | ; SS:BP: Ptr to MENUVARS
|
---|
| 149 | ; Returns:
|
---|
| 150 | ; CF: Cleared since no need to draw changes
|
---|
| 151 | ; Corrupts registers:
|
---|
| 152 | ; AX, BX, CX, DX
|
---|
| 153 | ;--------------------------------------------------------------------
|
---|
| 154 | ALIGN JUMP_ALIGN
|
---|
| 155 | DrvParamsMenu_SetMenuitemVisibilityAndDrawChanges:
|
---|
| 156 | call DrvParamsMenu_SetMenuitemVisibility
|
---|
| 157 | call MenuPage_InvalidateItemCount
|
---|
| 158 | clc ; No need to redraw Full Mode menuitem
|
---|
| 159 | ret
|
---|
| 160 |
|
---|
| 161 | ;--------------------------------------------------------------------
|
---|
| 162 | ; Enables or disables menuitems based on current configuration.
|
---|
| 163 | ;
|
---|
| 164 | ; DrvParamsMenu_SetMenuitemVisibility
|
---|
| 165 | ; Parameters:
|
---|
| 166 | ; DS: CS
|
---|
| 167 | ; Returns:
|
---|
| 168 | ; Nothing
|
---|
| 169 | ; Corrupts registers:
|
---|
| 170 | ; BX
|
---|
| 171 | ;--------------------------------------------------------------------
|
---|
| 172 | ALIGN JUMP_ALIGN
|
---|
| 173 | DrvParamsMenu_SetMenuitemVisibility:
|
---|
| 174 | jmp SHORT DrvParamsMenu_SetChsVisibility
|
---|
| 175 |
|
---|
| 176 | ALIGN JUMP_ALIGN
|
---|
| 177 | DrvParamsMenu_SetChsVisibility:
|
---|
| 178 | mov bx, [g_MenuPageItemDrvUserCHS+MENUPAGEITEM.pValue]
|
---|
| 179 | test WORD [bx], FLG_DRVPARAMS_USERCHS
|
---|
| 180 | jz SHORT .DisableUserCHS
|
---|
| 181 | or BYTE [g_MenuPageItemDrvCyls+MENUPAGEITEM.bFlags], FLG_MENUPAGEITEM_VISIBLE
|
---|
| 182 | or BYTE [g_MenuPageItemDrvHeads+MENUPAGEITEM.bFlags], FLG_MENUPAGEITEM_VISIBLE
|
---|
| 183 | or BYTE [g_MenuPageItemDrvSect+MENUPAGEITEM.bFlags], FLG_MENUPAGEITEM_VISIBLE
|
---|
| 184 | ret
|
---|
| 185 | ALIGN JUMP_ALIGN
|
---|
| 186 | .DisableUserCHS:
|
---|
| 187 | and BYTE [g_MenuPageItemDrvCyls+MENUPAGEITEM.bFlags], ~FLG_MENUPAGEITEM_VISIBLE
|
---|
| 188 | and BYTE [g_MenuPageItemDrvHeads+MENUPAGEITEM.bFlags], ~FLG_MENUPAGEITEM_VISIBLE
|
---|
| 189 | and BYTE [g_MenuPageItemDrvSect+MENUPAGEITEM.bFlags], ~FLG_MENUPAGEITEM_VISIBLE
|
---|
| 190 | ret
|
---|