From 4d57f15dad3afae426711df4922269580ae5df8f Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Wed, 6 May 2026 00:26:08 +0200 Subject: [PATCH] gui: started working on keypads. --- avr/modules/lcd2/gui/base/d_numinput.asm | 139 ++++++ avr/modules/lcd2/gui/base/keypad.asm | 551 +++++++++++++++++++++++ avr/modules/lcd2/gui/base/keypad_num.asm | 57 +++ 3 files changed, 747 insertions(+) create mode 100644 avr/modules/lcd2/gui/base/d_numinput.asm create mode 100644 avr/modules/lcd2/gui/base/keypad.asm create mode 100644 avr/modules/lcd2/gui/base/keypad_num.asm diff --git a/avr/modules/lcd2/gui/base/d_numinput.asm b/avr/modules/lcd2/gui/base/d_numinput.asm new file mode 100644 index 0000000..e9ee4fe --- /dev/null +++ b/avr/modules/lcd2/gui/base/d_numinput.asm @@ -0,0 +1,139 @@ +; *************************************************************************** +; copyright : (C) 2026 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_BASE_D_NUMINPUT_ASM +#define AQH_AVR_GUI_BASE_D_NUMINPUT_ASM + + +; *************************************************************************** +; defines + +.equ DLGNUMINPUT_OFFS_BEGIN = MAINWINDOW_SIZE +.equ DLGNUMINPUT_SIZE = DLGNUMINPUT_OFFS_BEGIN+0 + + + +; *************************************************************************** +; code + +.cseg + + + +; --------------------------------------------------------------------------- +; @routine DlgNumInput_new @global +; +; @param Y pointer to GUIAPP +; @param r21:r20 ressource id for title +; @return CFLAG set of okay, cleared otherwise +; @return Y address of newly created object + +DlgNumInput_new: + bigcall GuiApp_GetRootWindow + brcc DlgNumInput_new_ret + push r20 + push r21 + mov xl, r18 ; use root window as parent for main window + mov xh, r19 + ldi r24, LOW(DLGNUMINPUT_SIZE) + ldi r25, HIGH(DLGNUMINPUT_SIZE) + bigcall Object_Alloc ; Y=space (!r16, !r17, !X) + pop r21 + pop r20 + brcc DlgNumInput_new_ret + rcall DlgNumInput_Init +DlgNumInput_new_ret: + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine DlgNumInput_Init @global +; +; @param Y pointer to newly allocated widget data +; @param X pointer to root window +; @param r21:r20 ressource id for title +; @return CFLAG set of okay, cleared otherwise +; @clobbers any, !Y + +DlgNumInput_Init: + ldi r16, 0 ; OPTS + ldi r17, (WIDGET_PACK_FILLED<