diff options
| -rw-r--r-- | dev/ZBA/Sources/HEL/AMD64/BootATA.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx | 2 | ||||
| -rw-r--r-- | dev/ZKA/Modules/CoreCG/WindowRenderer.hxx | 29 | ||||
| -rw-r--r-- | dev/ZKA/Sources/DLLMain.cxx | 18 |
4 files changed, 32 insertions, 19 deletions
diff --git a/dev/ZBA/Sources/HEL/AMD64/BootATA.cxx b/dev/ZBA/Sources/HEL/AMD64/BootATA.cxx index 0c2e557d..714e552d 100644 --- a/dev/ZBA/Sources/HEL/AMD64/BootATA.cxx +++ b/dev/ZBA/Sources/HEL/AMD64/BootATA.cxx @@ -31,7 +31,7 @@ Boolean boot_ata_detected(Void); STATIC Boolean boot_ata_wait_io(UInt16 IO) { - for (int i = 0; i < 4; i++) + for (int i = 0; i < 400; i++) In8(IO + ATA_REG_STATUS); ATAWaitForIO_Retry: diff --git a/dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx b/dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx index acca5dd4..8ab97940 100644 --- a/dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx +++ b/dev/ZKA/HALKit/AMD64/Storage/ATA-PIO.cxx @@ -33,7 +33,7 @@ static Char kATAData[kATADataLen] = {0}; Boolean drv_std_wait_io(UInt16 IO) { - for (int i = 0; i < 4; i++) + for (int i = 0; i < 400; i++) In8(IO + ATA_REG_STATUS); ATAWaitForIO_Retry: diff --git a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx index 59ebd9f2..16e4c14c 100644 --- a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx +++ b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx @@ -25,6 +25,8 @@ namespace CG enum { cWndFlagNoShow = 0x04, + cWndFlagButton = 0x08, + cWndFlagWindow = 0x0A, }; struct UI_WINDOW_STRUCT final @@ -44,15 +46,6 @@ namespace CG inline struct UI_WINDOW_STRUCT* CGCreateWindow(Int32 flags, const Char* window_name, const Char* class_name, Int32 x, Int32 y, Int32 width, Int32 height) { - const auto cMaxLimit = 214; - - if (width < cMaxLimit || - height < cMaxLimit) - { - ErrLocal() = kErrorInvalidData; - return nullptr; - } - UI_WINDOW_STRUCT* wnd = new UI_WINDOW_STRUCT(); if (!wnd) @@ -140,11 +133,21 @@ namespace CG CGInit(); - CGDrawBitMapInRegion(wnd[index]->display_ptr, wnd[index]->w_h, wnd[index]->w_w, wnd[index]->w_y, wnd[index]->w_x); - CGDrawInRegion(CGColor(0xFF, 0xFF, 0xFF), wnd[index]->w_w, FLATCONTROLS_HEIGHT, wnd[index]->w_y, wnd[index]->w_x); - CGDrawBitMapInRegion(FlatControls, FLATCONTROLS_HEIGHT, FLATCONTROLS_WIDTH, wnd[index]->w_y, wnd[index]->w_x+wnd[index]->w_w-FLATCONTROLS_WIDTH); + // Draw fake controls, just for the looks of it (WINDOW ONLY) + if ((wnd[index]->w_flags & cWndFlagWindow) == cWndFlagWindow) + { + CGDrawBitMapInRegion(wnd[index]->display_ptr, wnd[index]->w_h, wnd[index]->w_w, wnd[index]->w_y, wnd[index]->w_x); + CGDrawInRegion(CGColor(0xFF, 0xFF, 0xFF), wnd[index]->w_w, FLATCONTROLS_HEIGHT, wnd[index]->w_y, wnd[index]->w_x); - CGDrawString(wnd[index]->w_window_name, wnd[index]->w_y + 8, wnd[index]->w_x + 8, CGColor(0x00, 0x00, 0x00)); + CGDrawBitMapInRegion(FlatControls, FLATCONTROLS_HEIGHT, FLATCONTROLS_WIDTH, wnd[index]->w_y, wnd[index]->w_x + wnd[index]->w_w - FLATCONTROLS_WIDTH); + CGDrawString(wnd[index]->w_window_name, wnd[index]->w_y + 8, wnd[index]->w_x + 8, CGColor(0x00, 0x00, 0x00)); + } + else if ((wnd[index]->w_flags & cWndFlagButton) == cWndFlagButton) + { + CGDrawInRegion(CGColor(0xD3, 0x74, 0x00), wnd[index]->w_w + 1, wnd[index]->w_h + 1, wnd[index]->w_y, wnd[index]->w_x); + CGDrawInRegion(CGColor(0xFF, 0xFF, 0xFF), wnd[index]->w_w - 1, wnd[index]->w_h - 1, wnd[index]->w_y + 1, wnd[index]->w_x + 1); + CGDrawString(wnd[index]->w_window_name, wnd[index]->w_y + (wnd[index]->w_y / 2) - 1, wnd[index]->w_x + (wnd[index]->w_x / 2), CGColor(0x00, 0x00, 0x00)); + } CGFini(); } diff --git a/dev/ZKA/Sources/DLLMain.cxx b/dev/ZKA/Sources/DLLMain.cxx index 16e7a82a..f8c59a53 100644 --- a/dev/ZKA/Sources/DLLMain.cxx +++ b/dev/ZKA/Sources/DLLMain.cxx @@ -186,25 +186,35 @@ namespace Kernel::Detail EXTERN_C Kernel::Void KeMain(Kernel::Void) { - CGInit(); + CGInit(); CGDrawInRegion(CGColor(0x45, 0x00, 0x06), CG::UIAccessibilty::The().Height(), CG::UIAccessibilty::The().Width(), - 0, 0); + 0, 0); CGFini(); - auto root_zka_wnd = CG::CGCreateWindow(0, "ZKA System", "Window", 0, 0, 512, 214); + auto root_zka_wnd = CG::CGCreateWindow(CG::cWndFlagWindow, "ZKA Setup", "Window", 0, 0, CG::UIAccessibilty::The().Height() - 20, CG::UIAccessibilty::The().Width() - 20); root_zka_wnd->w_x = 10; root_zka_wnd->w_y = 10; root_zka_wnd->w_needs_repaint = Yes; - CG::CGDrawWindowList(&root_zka_wnd, 1); /// Now run kernel loop, until no process are running. Kernel::Detail::FilesystemInstaller(); // automatic filesystem creation. + auto root_install_wnd = CG::CGCreateWindow(CG::cWndFlagButton, "Install ZKA.", "Button", 0, 0, 128, 32); + + root_install_wnd->w_x = 30; + root_install_wnd->w_y = 60; + + root_install_wnd->w_needs_repaint = Yes; + + CG::UI_WINDOW_STRUCT* arr[] = {root_zka_wnd, root_install_wnd}; + + CG::CGDrawWindowList(arr, 2); + while (Yes) { } |
