From 92efebccf1ab65a19282bab20578703386f0d24a Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Sat, 7 Mar 2026 15:29:28 +0100 Subject: [PATCH] gui2: basic start works! --- avr/devices/c03/test/main.asm | 30 +++++++---- avr/modules/lcd2/gui2/base/guiapp.asm | 61 +++++++++++++---------- avr/modules/lcd2/gui2/base/rootwindow.asm | 6 ++- avr/modules/lcd2/gui2/base/widget.asm | 28 +++++------ 4 files changed, 73 insertions(+), 52 deletions(-) diff --git a/avr/devices/c03/test/main.asm b/avr/devices/c03/test/main.asm index ccbde37..8bf0436 100644 --- a/avr/devices/c03/test/main.asm +++ b/avr/devices/c03/test/main.asm @@ -199,8 +199,8 @@ onSystemStart: ; Called on every message received onMessageReceived: -; ldi zl, LOW(appC03*2) -; ldi zh, HIGH(appC03*2) +; lds yl, guiApp +; lds yh, guiApp+1 ; bigcall GuiApp_MsgReceived clc ret @@ -214,9 +214,9 @@ onMessageReceived: ; Called every 100ms. Add your routine calls here. No arguments, no results. onEvery100ms: -; ldi zl, LOW(appC03*2) -; ldi zh, HIGH(appC03*2) -; bigcall GuiApp_Every100ms + lds yl, guiApp + lds yh, guiApp+1 + bigcall GuiApp_Every100ms ret onEveryMinute: @@ -243,10 +243,19 @@ onEveryLoop: test: -; ldi zl, LOW(appC03*2) -; ldi zh, HIGH(appC03*2) -; bigcall GuiApp_Init - + clr r16 + sts guiApp, r16 + sts guiApp+1, r16 + + ldi r16, 0 + ldi r17, 0 + bigcall GuiApp_new + brcs test_ok +bigjmp DEBUG1 + +test_ok: + sts guiApp, yl + sts guiApp+1, yh ret @@ -311,9 +320,12 @@ test: .dseg +guiApp: .byte 2 + heapStart: .equ HEAP_START = heapStart .equ HEAP_SIZE = (SRAM_SIZE-STACK_SIZE)-HEAP_START + diff --git a/avr/modules/lcd2/gui2/base/guiapp.asm b/avr/modules/lcd2/gui2/base/guiapp.asm index 4f8dc9b..f74e7bb 100644 --- a/avr/modules/lcd2/gui2/base/guiapp.asm +++ b/avr/modules/lcd2/gui2/base/guiapp.asm @@ -106,6 +106,12 @@ GuiApp_Init: ldi r16, 0 ; opts_lo ldi r17, 0 ; opts_hi bigcall RootWindow_new + + ; always visible + ldd r16, Y+OBJECT_OFFS_FLAGS + sbr r16, (1<