Changeset 183 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
Nov 15, 2011, 4:35:14 AM (13 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Space optimization, added option to inline offsets for MENUEVENT structure, for situations (such as the XTIDE bios) where only one menu is needed. Ifdef'd change (set in main.asm) so either method can be used.

Location:
trunk/Assembly_Library
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/MenuEvents.inc

    r58 r183  
    1919;       All
    2020;--------------------------------------------------------------------
     21
     22;
     23; There are two ways to use MENUEVENT:
     24;
     25; 1. If the program needs two different menus, include the definition of the MENUEVENT structure below,
     26;    instantiate with members that point to the routines that make up the menu.
     27;
     28; 2. If the program needs only one menu, %define MENUEVENT_INLINE_OFFSETS before this include file,
     29;    and define (through EQU statements) each of the entry points as offsets from a base address. 
     30;    Entry points must be within 256 bytes of the base (only a byte is used to pass the offset).
     31;
     32
     33%ifndef MENUEVENT_INLINE_OFFSETS
     34
    2135struc MENUEVENT
    2236    ; Parameters:
     
    2539    ;   DS:SI:      Ptr to initialized MENUINIT struct
    2640    .InitializeMenuinitFromDSSI     resb    2
     41%define MENUEVENT_InitializeMenuinitFromDSSI MENUEVENT.InitializeMenuinitFromDSSI
    2742
    2843    ; Parameters:
     
    3247    ;               Clear to cancel exit
    3348    .ExitMenu                       resb    2
     49%define MENUEVENT_ExitMenu MENUEVENT.ExitMenu
    3450
    3551    ; Parameters:
    3652    ;   None
    3753    .IdleProcessing                 resb    2
     54%define MENUEVENT_IdleProcessing MENUEVENT.IdleProcessing
    3855
    3956    ; Parameters:
     
    4158    ;   DX:         Index of previously highlighted item or NO_ITEM_HIGHLIGHTED
    4259    .ItemHighlightedFromCX          resb    2
     60%define MENUEVENT_ItemHighlightedFromCX MENUEVENT.ItemHighlightedFromCX
    4361
    4462    ; Parameters:
    4563    ;   CX:         Index of selected item
    4664    .ItemSelectedFromCX             resb    2
     65%define MENUEVENT_ItemSelectedFromCX MENUEVENT.ItemSelectedFromCX
    4766
    4867    ; Parameters:
     
    5069    ;   AH:         Keyboard library scan code for the key
    5170    .KeyStrokeInAX                  resb    2
     71%define MENUEVENT_KeyStrokeInAX MENUEVENT.KeyStrokeInAX
    5272
    5373    ; Parameters:
     
    5676    .RefreshTitle                   resb    2
    5777    .RefreshInformation             resb    2
     78%define MENUEVENT_RefreshTitle MENUEVENT.RefreshTitle
     79%define MENUEVENT_RefreshInformation MENUEVENT.RefreshInformation
    5880
    5981    ; Parameters:
     
    6183    ;   Cursor has been positioned to the beginning of item line
    6284    .RefreshItemFromCX              resb    2
     85%define MENUEVENT_RefreshItemFromCX MENUEVENT.RefreshItemFromCX
    6386endstruc
    6487
     88%endif ; MENUEVENTS_INLINE_OFFSETS
    6589
    6690%endif ; MENUEVENTS_INC
  • trunk/Assembly_Library/Src/Menu/MenuEvent.asm

    r133 r183  
    2121    pop     ds
    2222    mov     si, bp
    23     mov     bl, MENUEVENT.InitializeMenuinitFromDSSI
     23    mov     bl, MENUEVENT_InitializeMenuinitFromDSSI
    2424    jmp     SHORT MenuEvent_SendFromBX
    2525
     
    3737ALIGN JUMP_ALIGN
    3838MenuEvent_ExitMenu:
    39     mov     bl, MENUEVENT.ExitMenu
     39    mov     bl, MENUEVENT_ExitMenu
    4040    jmp     SHORT MenuEvent_SendFromBX
    4141
     
    5353ALIGN JUMP_ALIGN
    5454MenuEvent_IdleProcessing:
    55     mov     bl, MENUEVENT.IdleProcessing
     55    mov     bl, MENUEVENT_IdleProcessing
    5656    jmp     SHORT MenuEvent_SendFromBX
    5757
     
    7171ALIGN JUMP_ALIGN
    7272MenuEvent_RefreshTitle:
    73     mov     bl, MENUEVENT.RefreshTitle
     73    mov     bl, MENUEVENT_RefreshTitle
    7474    SKIP2B  cx  ; mov cx, <next instruction>
    7575
    7676MenuEvent_RefreshInformation:
    77     mov     bl, MENUEVENT.RefreshInformation
     77    mov     bl, MENUEVENT_RefreshInformation
    7878    mov     cx, [bp+MENUINIT.wHighlightedItem]
    7979    jmp     SHORT MenuEvent_SendFromBX
     
    9494ALIGN JUMP_ALIGN
    9595MenuEvent_RefreshItemFromCX:
    96     mov     bl, MENUEVENT.RefreshItemFromCX
     96    mov     bl, MENUEVENT_RefreshItemFromCX
    9797    jmp     SHORT MenuEvent_SendFromBX
    9898
     
    114114    push    dx
    115115
    116     mov     bl, MENUEVENT.ItemHighlightedFromCX
     116    mov     bl, MENUEVENT_ItemHighlightedFromCX
    117117    call    MenuEvent_SendFromBX
    118118
     
    137137ALIGN JUMP_ALIGN
    138138MenuEvent_KeyStrokeInAX:
    139     mov     bl, MENUEVENT.KeyStrokeInAX
     139    mov     bl, MENUEVENT_KeyStrokeInAX
    140140    SKIP2B  dx  ; mov dx, <next instruction>
    141141
     
    153153;--------------------------------------------------------------------
    154154MenuEvent_ItemSelectedFromCX:
    155     mov     bl, MENUEVENT.ItemSelectedFromCX
     155    mov     bl, MENUEVENT_ItemSelectedFromCX
    156156    ; Fall to MenuEvent_SendFromBX
    157157
Note: See TracChangeset for help on using the changeset viewer.