some remarks

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-03-01 11:46:12 +03:00
parent 2de3b84957
commit a260cbad92
5 changed files with 71 additions and 39 deletions

View File

@ -2400,6 +2400,10 @@
A5611B3021DCB9CD008FDB96 /* HdaCodecInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HdaCodecInfo.h; sourceTree = "<group>"; };
A5611B3121DCB9CD008FDB96 /* HdaControllerInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HdaControllerInfo.h; sourceTree = "<group>"; };
A5611B3221DCB9CE008FDB96 /* HdaIo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HdaIo.h; sourceTree = "<group>"; };
A570FAFE240BA4D00057F26D /* menu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = menu.h; sourceTree = "<group>"; };
A570FAFF240BA4DB0057F26D /* screen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = screen.h; sourceTree = "<group>"; };
A570FB02240BA5340057F26D /* menu_items.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = menu_items.h; sourceTree = "<group>"; };
A570FB03240BA5340057F26D /* menu_globals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = menu_globals.h; sourceTree = "<group>"; };
A5716F82235968BE000CEC60 /* Nasm.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = Nasm.inc; path = ../../Nasm.inc; sourceTree = "<group>"; };
A5716FD5235A1576000CEC60 /* InternalIsaBus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InternalIsaBus.h; sourceTree = "<group>"; };
A5716FD6235A1576000CEC60 /* IsaBusDxeExtra.uni */ = {isa = PBXFileReference; lastKnownFileType = text; path = IsaBusDxeExtra.uni; sourceTree = "<group>"; };
@ -6049,6 +6053,7 @@
A571C27B240574A100B6A2C5 /* cpp_unit_test */,
A5DEBF3423BF687D00C41734 /* cpp_util */,
126151391A15BBAF00903E7B /* entry_scan */,
A570FB00240BA5340057F26D /* gui */,
126151471A15BBB000903E7B /* include */,
1261514B1A15BBB000903E7B /* libeg */,
126151561A15BBB000903E7B /* Platform */,
@ -6208,8 +6213,10 @@
A5456D7C23FC5B40000BF18C /* list.cpp */,
A5456D7523FC5B3D000BF18C /* list.h */,
A5456D7823FC5B3E000BF18C /* main.cpp */,
A570FAFE240BA4D00057F26D /* menu.h */,
A5456D7A23FC5B3F000BF18C /* menu.cpp */,
A5456D7B23FC5B3F000BF18C /* screen.cpp */,
A570FAFF240BA4DB0057F26D /* screen.h */,
);
path = refit;
sourceTree = "<group>";
@ -8029,6 +8036,23 @@
path = HdaController;
sourceTree = "<group>";
};
A570FB00240BA5340057F26D /* gui */ = {
isa = PBXGroup;
children = (
A570FB01240BA5340057F26D /* menu_items */,
);
path = gui;
sourceTree = "<group>";
};
A570FB01240BA5340057F26D /* menu_items */ = {
isa = PBXGroup;
children = (
A570FB02240BA5340057F26D /* menu_items.h */,
A570FB03240BA5340057F26D /* menu_globals.h */,
);
path = menu_items;
sourceTree = "<group>";
};
A5716FD3235A1576000CEC60 /* Isa */ = {
isa = PBXGroup;
children = (

View File

@ -34,7 +34,7 @@ extern EFI_AUDIO_IO_PROTOCOL *AudioIo;
// make them theme dependent? No, 32 is good value for all.
#define POINTER_WIDTH 32
#define POINTER_HEIGHT 32
//have to be moved to menu class
ACTION gAction;
UINTN gItemID;
@ -407,40 +407,4 @@ EFI_STATUS CheckMouseEvent(REFIT_MENU_SCREEN *Screen)
return Status;
}
#define ONE_SECOND 10000000
#define ONE_MSECOND 10000
// TimeoutDefault for a wait in seconds
// return EFI_TIMEOUT if no inputs
EFI_STATUS WaitForInputEventPoll(REFIT_MENU_SCREEN *Screen, UINTN TimeoutDefault)
{
EFI_STATUS Status = EFI_SUCCESS;
UINTN TimeoutRemain = TimeoutDefault * 100;
while (TimeoutRemain != 0) {
// Status = WaitForSingleEvent (gST->ConIn->WaitForKey, ONE_MSECOND * 10);
Status = WaitFor2EventWithTsc (gST->ConIn->WaitForKey, NULL, 10);
if (Status != EFI_TIMEOUT) {
break;
}
UpdateAnime(Screen, &(Screen->FilmPlace));
if (gSettings.PlayAsync) {
CheckSyncSound();
}
/* if ((INTN)gItemID < Screen->Entries.size()) {
UpdateAnime(Screen->Entries[gItemID].SubScreen, &(Screen->Entries[gItemID].Place));
} */
TimeoutRemain--;
if (gPointer.SimplePointerProtocol) {
UpdatePointer();
Status = CheckMouseEvent(Screen); //out: gItemID, gAction
if (Status != EFI_TIMEOUT) { //this check should return timeout if no mouse events occured
break;
}
}
}
return Status;
}

View File

@ -81,8 +81,8 @@
libeg/VectorGraphics.cpp
libeg/libeg.h
libeg/libegint.h
# libeg/XImage.cpp
# libeg/XImage.h
libeg/XImage.cpp
libeg/XImage.h
Platform/AcpiPatcher.cpp
Platform/ati_reg.h
Platform/AmlGenerator.cpp

View File

@ -1023,6 +1023,7 @@ WaitFor2EventWithTsc (
UINTN Index;
EFI_EVENT WaitList[2];
UINT64 t0, t1;
//all arguments are UINT64, we can use native divide and multiply
UINT64 Delta = DivU64x64Remainder(MultU64x64(Timeout, gCPUStructure.TSCFrequency), 1000, NULL);
if (Timeout != 0)
@ -1054,6 +1055,46 @@ WaitFor2EventWithTsc (
return Status;
}
#define ONE_SECOND 10000000
#define ONE_MSECOND 10000
// TimeoutDefault for a wait in seconds
// return EFI_TIMEOUT if no inputs
//the function must be in menu class
//so UpdatePointer(); => Pointer.Update(&gItemID, &gAction);
EFI_STATUS WaitForInputEventPoll(REFIT_MENU_SCREEN *Screen, UINTN TimeoutDefault)
{
EFI_STATUS Status = EFI_SUCCESS;
UINTN TimeoutRemain = TimeoutDefault * 100;
while (TimeoutRemain != 0) {
// Status = WaitForSingleEvent (gST->ConIn->WaitForKey, ONE_MSECOND * 10);
Status = WaitFor2EventWithTsc (gST->ConIn->WaitForKey, NULL, 10);
if (Status != EFI_TIMEOUT) {
break;
}
UpdateAnime(Screen, &(Screen->FilmPlace));
if (gSettings.PlayAsync) {
CheckSyncSound();
}
/* if ((INTN)gItemID < Screen->Entries.size()) {
UpdateAnime(Screen->Entries[gItemID].SubScreen, &(Screen->Entries[gItemID].Place));
} */
TimeoutRemain--;
if (gPointer.SimplePointerProtocol) {
UpdatePointer();
Status = CheckMouseEvent(Screen); //out: gItemID, gAction
if (Status != EFI_TIMEOUT) { //this check should return timeout if no mouse events occured
break;
}
}
}
return Status;
}
BOOLEAN
SetPageBreak (
IN OUT PRINT_STATE *ps

View File

@ -284,6 +284,9 @@ WaitFor2EventWithTsc (
IN UINT64 Timeout OPTIONAL
);
EFI_STATUS
WaitForInputEventPoll(REFIT_MENU_SCREEN *Screen, UINTN TimeoutDefault);
VOID LowCase (IN OUT CHAR8 *Str);
UINT32 hex2bin(IN CHAR8 *hex, OUT UINT8 *bin, UINT32 len);
BOOLEAN IsHexDigit (CHAR8 c);