diff --git a/avr/modules/lcd2/gui/base/object.asm b/avr/modules/lcd2/gui/base/object.asm index ad7c304..337a8e3 100644 --- a/avr/modules/lcd2/gui/base/object.asm +++ b/avr/modules/lcd2/gui/base/object.asm @@ -100,25 +100,11 @@ Object_Alloc: push xh push r16 push r17 - push r24 - push r25 - bigcall Heap_Alloc ; X=mem allocated (r16, r17, r18, r19, r24, r25, X) - pop r25 - pop r24 + bigcall Heap_AllocAndZero pop r17 pop r16 - brcc Object_Alloc_ret - mov yl, xl - mov yh, xh - clr r18 -Object_Alloc_loop: - st X+, r18 - sbiw r25:r24, 1 - brne Object_Alloc_loop - sec -Object_Alloc_ret: pop xh - pop xl + pop xl ret ; @end @@ -537,9 +523,25 @@ OBJ_GetRootToY_end: ; @clobbers any, !Y OBJ_EmitSignal: + ldd r17, Y+OBJECT_OFFS_SELECTOR + rjmp OBJ_EmitSignalWithSelector +; @end + + + +; --------------------------------------------------------------------------- +; @routine OBJ_EmitSignalWithSelector @global +; +; @param Z byte address of object (for LPM!) +; @param R16 signal number +; @param R17 selector +; @param xl param1 +; @param xh param2 +; @clobbers any, !Y + +OBJ_EmitSignalWithSelector: push yl push yh - ldd r17, Y+OBJECT_OFFS_SELECTOR ldd r23, Y+OBJECT_OFFS_TARGET_LO ldd yh, Y+OBJECT_OFFS_TARGET_HI mov yl, r23