Compare commits

..
2 Commits
Author SHA1 Message Date
t3hn3rd be4b482bde fix: LVGL rendering for 16bpp framebuffers (HyperV compatibility)
continuous-integration/drone/push Build is failing
The LVGL flush callback assumed 32bpp (4-byte stride, direct pixel
copy), causing corrupted output on hypervisors that fall back to
16bpp modes (e.g. HyperV at 1600x1200x16).

- lvgl.pas: Make lvgl_flush_cb BPP-aware; add ARGB8888->RGB565
  conversion path for 16bpp, keep direct copy for 32bpp. Replace
  static lv_buf1 array (hardcoded 1600px wide) with kalloc'd buffer
  sized to actual screen width.
- doublebuffer.pas: Fix allocateBackBuffer size from (W*H*BPP) to
  (W*H*BPP) div 8 to get correct byte count.
- vesa.pas: Account for BPP in allocateVESAFrameBuffer page range
  calculation to avoid under-mapping at higher BPP/resolutions.
- Removed the initialization of console in kernel.pas as this will
  cause issues on some systems that don't expect to need to allocate the
  textmode buffer.
2026-02-28 15:38:11 +00:00
t3hn3rd 6f50b053b7 Full LVGL binding & Cursor fix
- Full(ish) LVGL bindings implemented.
- Cursor replaced with an actual cursor.
2026-02-28 00:06:10 +00:00
6 changed files with 1555 additions and 296 deletions

No files matched your search

+6 -12
View File
@@ -800,19 +800,13 @@ begin
lv_obj_set_style_text_color(clock_label, lv_color_make(200, 205, 220), 0);
lv_obj_set_style_text_font(clock_label, @lv_font_montserrat_14, 0);
{ ---- Mouse cursor ---- }
cursor_obj := lv_obj_create(scr);
{ ---- Mouse cursor (FontAwesome arrow-pointer U+F245) ---- }
cursor_obj := lv_label_create(scr);
lv_obj_remove_style_all(cursor_obj);
lv_obj_set_size(cursor_obj, 12, 12);
lv_obj_set_style_bg_color(cursor_obj, lv_color_make(255, 255, 255), 0);
lv_obj_set_style_bg_opa(cursor_obj, LV_OPA_COVER, 0);
lv_obj_set_style_radius(cursor_obj, 6, 0);
lv_obj_set_style_border_width(cursor_obj, 1, 0);
lv_obj_set_style_border_color(cursor_obj, lv_color_make(0, 0, 0), 0);
lv_obj_set_style_border_opa(cursor_obj, LV_OPA_COVER, 0);
lv_obj_set_style_shadow_width(cursor_obj, 4, 0);
lv_obj_set_style_shadow_color(cursor_obj, lv_color_make(0, 0, 0), 0);
lv_obj_set_style_shadow_opa(cursor_obj, 100, 0);
lv_label_set_text(cursor_obj, #$EF#$89#$85); { UTF-8 for U+F245 }
lv_obj_set_style_text_font(cursor_obj, @lv_font_fa_solid_16, 0);
lv_obj_set_style_text_color(cursor_obj, lv_color_make(255, 255, 255), 0);
lv_obj_set_style_text_opa(cursor_obj, LV_OPA_COVER, 0);
lv_obj_remove_flag(cursor_obj, LV_OBJ_FLAG_CLICKABLE);
lv_obj_remove_flag(cursor_obj, LV_OBJ_FLAG_SCROLLABLE);
+1 -2
View File
@@ -32,8 +32,7 @@ implementation
function allocateBackBuffer(Width : uint32; Height : uint32; BitsPerPixel : uint8) : uint64;
begin
tracer.push_trace('doublebuffer.allocateBackBuffer.enter');
//This doesn't currently work... Needs a rework of lmemorymanager
allocateBackBuffer:= uint64(klalloc((Width * Height) * BitsPerPixel));
allocateBackBuffer:= uint64(klalloc((Width * Height * BitsPerPixel) div 8));
tracer.push_trace('doublebuffer.allocateBackBuffer.exit');
end;
+1539 -274
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -277,6 +277,7 @@ var
fps_range : uint32;
x_step : uint32; { x spacing in 256ths of a pixel (fixed point) }
y_scaled : sint32;
begin
if graph_line = nil then exit;
+7 -5
View File
@@ -32,22 +32,24 @@ implementation
uses
VESA8, VESA16, VESA24, VESA32;
procedure allocateVESAFrameBuffer(Address : uint32; Width : uint32; Height : uint32);
procedure allocateVESAFrameBuffer(Address : uint32; Width : uint32; Height : uint32; BitsPerPixel : uint8);
var
LowerAddress, UpperAddress : uint32;
Block : uint32;
FrameBufferSize : uint32;
begin
tracer.push_trace('VESA.allocateFrameBuffer.enter');
FrameBufferSize := (Width * Height * BitsPerPixel) div 8;
LowerAddress:= ((Address) SHR 22)-1;
UpperAddress:= ((Address + (Width * Height)) SHR 22)+1;
UpperAddress:= ((Address + FrameBufferSize) SHR 22)+1;
For Block:=LowerAddress to UpperAddress do begin
kpalloc(Block SHL 22);
end;
tracer.push_trace('VESA.allocateFrameBuffer.exit');
end;
procedure initVESAFrameBuffer(VideoBuffer : PVideoBuffer; Location : uint64; Width : uint32; Height : uint32; BitsPerPixel : uint8);
procedure initVESAFrameBuffer(VideoBuffer : PVideoBuffer; Location : uint64; Width : uint32; Height : uint32; BitsPerPixel : uint8; Pitch : uint32);
begin
tracer.push_trace('VESA.initVESAFrameBuffer.enter');
if not(VideoBuffer^.Initialized) then begin
@@ -55,7 +57,7 @@ begin
VideoBuffer^.BitsPerPixel:= BitsPerPixel;
VideoBuffer^.Width:= Width;
VideoBuffer^.Height:= Height;
allocateVESAFrameBuffer(VideoBuffer^.Location, VideoBuffer^.Width, VideoBuffer^.Height);
allocateVESAFrameBuffer(VideoBuffer^.Location, VideoBuffer^.Width, VideoBuffer^.Height, BitsPerPixel);
if VideoBuffer^.Location <> 0 then
VideoBuffer^.Initialized:= True;
end;
@@ -65,7 +67,7 @@ end;
function enable(VideoInterface : PVideoInterface) : boolean;
begin
tracer.push_trace('VESA.enable.enter');
initVESAFrameBuffer(@VideoInterface^.FrontBuffer, multiboot.multibootinfo^.framebuffer_addr, multiboot.multibootinfo^.framebuffer_width, multiboot.multibootinfo^.framebuffer_height, multiboot.multibootinfo^.framebuffer_bpp);
initVESAFrameBuffer(@VideoInterface^.FrontBuffer, multiboot.multibootinfo^.framebuffer_addr, multiboot.multibootinfo^.framebuffer_width, multiboot.multibootinfo^.framebuffer_height, multiboot.multibootinfo^.framebuffer_bpp, multiboot.multibootinfo^.framebuffer_pitch);
case (VideoInterface^.FrontBuffer.BitsPerPixel) of
08:VESA8.init(@VideoInterface^.DrawRoutines);
16:VESA16.init(@VideoInterface^.DrawRoutines);
+1 -3
View File
@@ -123,8 +123,6 @@ begin
multibootinfo:= mbinfo;
multibootmagic:= mbmagic;
//video.init();
{ Ensure tracer is frozen }
tracer.freeze();
@@ -181,7 +179,7 @@ begin
scheduler.init();
{ Console Init }
console.init();
//console.init();
{ CPUID }
console.outputln('CPU', 'Init begin');