From ffcc5c0d9f654cab5c43fc72b012ad28f02d4093 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Thu, 12 Jun 2025 23:30:36 +0200 Subject: [PATCH] some minor work on gui/win modules. --- avr/devices/all/includes.asm | 1 + avr/modules/lcd2/gui/TODO | 13 ++++++++++++ avr/modules/lcd2/gui/defs.asm | 37 +++++++++++++++++++++++++++++++++ avr/modules/lcd2/win/defs.asm | 3 --- avr/modules/lcd2/win/gui.asm | 22 ++++++++++++++++++++ avr/modules/lcd2/win/object.asm | 4 ++++ avr/modules/lcd2/win/widget.asm | 10 ++++----- 7 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 avr/modules/lcd2/gui/TODO create mode 100644 avr/modules/lcd2/gui/defs.asm create mode 100644 avr/modules/lcd2/win/gui.asm diff --git a/avr/devices/all/includes.asm b/avr/devices/all/includes.asm index 3dc46d6..3d6df0b 100644 --- a/avr/devices/all/includes.asm +++ b/avr/devices/all/includes.asm @@ -179,6 +179,7 @@ .include "modules/lcd2/win/defs.asm" .include "modules/lcd2/win/object.asm" .include "modules/lcd2/win/widget.asm" +.include "modules/lcd2/win/gui.asm" #endif diff --git a/avr/modules/lcd2/gui/TODO b/avr/modules/lcd2/gui/TODO new file mode 100644 index 0000000..898a149 --- /dev/null +++ b/avr/modules/lcd2/gui/TODO @@ -0,0 +1,13 @@ + + +- Screen + - functions: + - show + - unshow + - touch + - key + - activeAreas: + - x, y, w, h (in FLASH) + - only small variable data in SRAM, no need for heap! + + diff --git a/avr/modules/lcd2/gui/defs.asm b/avr/modules/lcd2/gui/defs.asm new file mode 100644 index 0000000..a73cf3a --- /dev/null +++ b/avr/modules/lcd2/gui/defs.asm @@ -0,0 +1,37 @@ +; *************************************************************************** +; copyright : (C) 2025 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + +#ifndef AQH_AVR_GUI_H +#define AQH_AVR_GUI_H + + + +.equ SCR_OFFS_HANDLER_LO = 0 +.equ SCR_OFFS_HANDLER_HI = 1 +.equ SCR_OFFS_X_LO = 2 +.equ SCR_OFFS_X_HI = 3 +.equ SCR_OFFS_Y_LO = 4 +.equ SCR_OFFS_Y_HI = 5 +.equ SCR_OFFS_WIDTH_LO = 6 +.equ SCR_OFFS_WIDTH_HI = 7 +.equ SCR_OFFS_HEIGHT_LO = 8 +.equ SCR_OFFS_HEIGHT_HI = 9 +.equ SCR_OFFS_BG_COL_LO = 10 +.equ SCR_OFFS_BG_COL_HI = 11 +.equ SCR_OFFS_FG_COL_LO = 12 +.equ SCR_OFFS_FG_COL_HI = 13 +.equ SCR_OFFS_FONT_LO = 14 +.equ SCR_OFFS_FONT_HI = 15 +.equ SCR_SIZE = 16 + + + + +#endif + diff --git a/avr/modules/lcd2/win/defs.asm b/avr/modules/lcd2/win/defs.asm index c3c28e8..86e4ebf 100644 --- a/avr/modules/lcd2/win/defs.asm +++ b/avr/modules/lcd2/win/defs.asm @@ -69,9 +69,6 @@ .equ WID_OPTIONS1_BIT_VALIGN0 = 4 ; 00: top, 01: bottom, 11: center .equ WID_OPTIONS1_BIT_VALIGN1 = 5 -.equ WID_OPTIONS1_BIT_ALIGN_HCENTER = 4 -.equ WID_OPTIONS1_BIT_ALIGN_VCENTER = 5 - .equ WID_OPTIONS1_BIT_FIXED_WIDTH = 6 .equ WID_OPTIONS1_BIT_FIXED_HEIGHT = 7 diff --git a/avr/modules/lcd2/win/gui.asm b/avr/modules/lcd2/win/gui.asm new file mode 100644 index 0000000..0c64673 --- /dev/null +++ b/avr/modules/lcd2/win/gui.asm @@ -0,0 +1,22 @@ +; *************************************************************************** +; copyright : (C) 2025 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + + +.dseg + +guiRootWidget: .byte 2 + + + +.cseg + +GUI_Init: + ret +; @end + diff --git a/avr/modules/lcd2/win/object.asm b/avr/modules/lcd2/win/object.asm index 2f5b57b..e857e3f 100644 --- a/avr/modules/lcd2/win/object.asm +++ b/avr/modules/lcd2/win/object.asm @@ -8,6 +8,10 @@ ; *************************************************************************** +.cseg + + + ; --------------------------------------------------------------------------- ; @routine OBJ_Init @global ; diff --git a/avr/modules/lcd2/win/widget.asm b/avr/modules/lcd2/win/widget.asm index d9d083b..655aee9 100644 --- a/avr/modules/lcd2/win/widget.asm +++ b/avr/modules/lcd2/win/widget.asm @@ -160,11 +160,11 @@ wVLayout: rcall wSetChildrenHeightsFromMinHeights ; count number of expandable children - ldi r16, WID_OPTIONS1_BIT_STRETCH_Y - ldi r17, WID_OPTIONS1_BIT_STRETCH_Y - rcall widgetCountVisibleChildrenWithOptions1 ; (r18, r24, r25, X) + ldi r16, (1< count all visible children @@ -187,7 +187,7 @@ wVLayout: sub r20, r18 ; r21:r20 = HEIGHT-SUM_OF_VIS_CHILDREN_HEIGHTS sbc r21, r19 brcc wVLayout_heightTooSmall - breq wVLayout_yDone ; nothing to distribute + breq wVLayout_yDone ; nothing to distribute bigcall Utils_Divu16_16_16 ; r17:r16 = r21:r20 / r23:r22 ; add additional pixel to heights of expandable child widgets rcall wAddToHeightsOfExpandableVisibleChildren