fixing push/pop order in api_set_text & api_set_mode

This commit is contained in:
Frater 2026-02-27 22:23:18 +01:00
commit 14a5ec116a
4 changed files with 56 additions and 16 deletions

View file

@ -204,12 +204,19 @@ main_loop:
mov .value, 0xFADE
.loop:
call gui_process_all
GUI OBJ_GET_VAL, .my_slider
mov .value, ax
cmp ax,.oldval
je .loop
ISADBG ISA_RIGHT, 0x11
call gui_process_all
; --- TRACE 12 : GUI traitée ---
ISADBG ISA_RIGHT, 0x12
; GUI OBJ_GET_VAL, .my_slider
;mov .value, ax
;cmp ax,.oldval
;je .loop
; debug
;mov .oldval, ax
@ -228,9 +235,9 @@ main_loop:
;mov al, 0x00
;int 0x10
mov dx, CRTC_COLOR_DATA
and ax, 0x001F
out dx, ax
;mov dx, CRTC_COLOR_DATA
;and ax, 0x001F
;out dx, ax
jmp .loop
leave

View file

@ -291,6 +291,7 @@ isr_mouse_handler:
in al, i8042_PS2_DATA ; lire octet souris
movzx bx, byte [PTR_MOUSE + mouse.idx]
cmp bl,0
jne .read_packet
@ -299,6 +300,7 @@ isr_mouse_handler:
jz .done_eoi ; allignement erroné
.read_packet:
mov byte [PTR_MOUSE + mouse.buffer + bx], al
inc byte [PTR_MOUSE + mouse.idx]
@ -372,7 +374,6 @@ isr_mouse_handler:
.done:
; update la position du curseur sur l'écran
; en ce moment c'est commented out (debug)
; call cga_mouse_cursor_move
GFX MOUSE_MOVE
.done_eoi:
mov al, 0x20

View file

@ -133,17 +133,18 @@ endstruc
; -----------------------------------------------------------------------------
; gui_api_slider_attr
; -----------------------------------------------------------------------------
%define .id word [bp+4]
%define .min word [bp+6]
%define .max word [bp+8]
%define .val word [bp+10]
%define .pct word [bp+12]
; -----------------------------------------------------------------------------
gui_api_slider_attr:
push bp
mov bp, sp
push gs
push ax
push si
mov ax, .id
call gui_get_widget_ptr_internal
@ -161,23 +162,29 @@ gui_api_slider_attr:
call gui_slider_update_pixels
.err:
pop si
pop ax
pop gs
leave
%undef .id
%undef .min
%undef .max
%undef .val
%undef .pct
ret
%undef .id
%undef .mode
; -----------------------------------------------------------------------------
; gui_api_set_mode
; -----------------------------------------------------------------------------
%define .id word [bp+4]
%define .mode word [bp+6]
; -----------------------------------------------------------------------------
gui_api_set_mode:
push bp
mov bp, sp
push gs
push ax
push si
mov ax, .id
call gui_get_widget_ptr_internal
@ -187,8 +194,9 @@ gui_api_set_mode:
mov byte [gs:si + widget.attr_mode], al
.err:
pop gs
pop si
pop ax
pop gs
leave
ret
%undef .id
@ -205,6 +213,7 @@ gui_api_set_text:
mov bp, sp
push gs
push ax
push si
mov ax, .id
call gui_get_widget_ptr_internal
@ -216,8 +225,9 @@ gui_api_set_text:
mov word [gs:si + widget.text_ofs], ax
.err:
pop gs
pop si
pop ax
pop gs
leave
ret
%undef .id
@ -288,6 +298,7 @@ gui_api_get_state:
push bp
mov bp, sp
push gs
push si
mov ax, .id
call gui_get_widget_ptr_internal
@ -300,6 +311,7 @@ gui_api_get_state:
.err:
mov ax, -1
.done:
pop si
pop gs
leave
ret
@ -315,6 +327,7 @@ gui_api_get_type:
push bp
mov bp, sp
push gs
push si
mov ax,.id
call gui_get_widget_ptr_internal
@ -327,6 +340,7 @@ gui_api_get_type:
.err:
mov ax, -1
.done:
pop si
pop gs
leave
ret
@ -342,6 +356,8 @@ gui_api_get_val:
push bp
mov bp, sp
push gs
push si
mov ax,.id
call gui_get_widget_ptr_internal
@ -354,6 +370,7 @@ gui_api_get_val:
.err:
mov ax, -1
.done:
pop si
pop gs
leave
ret
@ -370,6 +387,7 @@ gui_api_set_val:
push bp
mov bp, sp
push gs
push si
mov ax,.id
call gui_get_widget_ptr_internal
@ -379,6 +397,7 @@ gui_api_set_val:
mov [gs:si + widget.thumb_pos], ax
.err:
pop si
pop gs
leave
ret
@ -396,6 +415,7 @@ gui_api_destroy:
push bp
mov bp, sp
push gs
push si
mov ax,.id
call gui_get_widget_ptr_internal
@ -408,6 +428,7 @@ gui_api_destroy:
.err:
mov ax, -1
.done:
pop si
pop gs
leave
ret
@ -469,7 +490,7 @@ gui_get_widget_ptr_internal:
; Entrée : DS doit pointer vers SEG_GUI
; -----------------------------------------------------------------------------
gui_init_system:
push eax
push ax
push cx
push es
push di
@ -486,7 +507,7 @@ gui_init_system:
pop di
pop es
pop cx
pop eax
pop ax
ret
; -----------------------------------------------------------------------------

View file

@ -37,9 +37,15 @@ gui_process_all:
cmp byte [gs:si + widget.state], GUI_STATE_FREE
je .next_widget
mov ax, di
ISADBG ISA_LEFT, al
; --- Logique Widget ---
push bx ; Sauver état boutons souris
ISADBG ISA_RIGHT, 0x20 ; Avant logic
call gui_update_logic ; Vérifier collision/clic
ISADBG ISA_RIGHT, 0x21 ; Avant logic
; Si AL=1 (Clic relâché validé), exécuter le callback
cmp al, 1
@ -63,10 +69,15 @@ gui_process_all:
; Dessiner (si l'état a changé ou pour refresh)
ISADBG ISA_RIGHT, 0x22 ; Avant dessin
cmp al,ah
je .next_widget ; Si != 0, le widget est à jour, on passe.
call gui_draw_single_widget
ISADBG ISA_RIGHT, 0x23 ; Avant dessin
.next_widget:
add si, widget_size
dec di