debug sliders
This commit is contained in:
parent
182d8a36c3
commit
a976416822
2 changed files with 41 additions and 21 deletions
37
src/boot.asm
37
src/boot.asm
|
|
@ -110,20 +110,37 @@ entrycode:
|
||||||
call gui_init_system
|
call gui_init_system
|
||||||
call build_interface
|
call build_interface
|
||||||
|
|
||||||
main_loop:
|
call main_loop
|
||||||
call gui_process_all
|
|
||||||
|
|
||||||
GUI OBJ_GET_VAL, 5 ; slider
|
|
||||||
|
|
||||||
;GFX GOTOXY, 5, 20
|
|
||||||
;call print_word_hex
|
|
||||||
|
|
||||||
jmp main_loop
|
|
||||||
|
|
||||||
; --- Callbacks (Fonctions appelées par le moteur) ---
|
; --- Callbacks (Fonctions appelées par le moteur) ---
|
||||||
on_click_quit:
|
on_click_quit:
|
||||||
hlt
|
hlt
|
||||||
jmp on_click_quit
|
jmp on_click_quit
|
||||||
|
ret
|
||||||
|
|
||||||
|
%define .oldval word [bp-2]
|
||||||
|
main_loop:
|
||||||
|
push bp
|
||||||
|
push bx
|
||||||
|
mov bp, sp
|
||||||
|
sub sp, 2
|
||||||
|
|
||||||
|
mov .oldval, -1
|
||||||
|
|
||||||
|
.loop:
|
||||||
|
call gui_process_all
|
||||||
|
GUI OBJ_GET_VAL, 6 ; slider
|
||||||
|
|
||||||
|
cmp ax,.oldval
|
||||||
|
je .loop
|
||||||
|
|
||||||
|
mov .oldval, ax
|
||||||
|
GFX RECTANGLE_FILL,0,148,50,166, PATTERN_WHITE
|
||||||
|
GFX GOTOXY, 8, 150
|
||||||
|
|
||||||
|
call print_word_hex
|
||||||
|
|
||||||
|
jmp .loop
|
||||||
|
|
||||||
|
|
||||||
build_interface:
|
build_interface:
|
||||||
|
|
@ -154,7 +171,7 @@ build_interface:
|
||||||
|
|
||||||
GUI OBJ_CREATE, OBJ_TYPE_SLIDER, 400, 10, 16, 150
|
GUI OBJ_CREATE, OBJ_TYPE_SLIDER, 400, 10, 16, 150
|
||||||
GUI OBJ_SET_MODE, ax, SLIDER_VERTICAL
|
GUI OBJ_SET_MODE, ax, SLIDER_VERTICAL
|
||||||
GUI OBJ_SLIDER_SET_ATTR, ax, 10, 140, 140, 20
|
GUI OBJ_SLIDER_SET_ATTR, ax, 0, 15, 15, 20
|
||||||
|
|
||||||
.mem_full:
|
.mem_full:
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -774,7 +774,6 @@ cga_line_horizontal:
|
||||||
%define .x2 word [bp+8]
|
%define .x2 word [bp+8]
|
||||||
%define .y2 word [bp+10]
|
%define .y2 word [bp+10]
|
||||||
%define .color byte [bp+12]
|
%define .color byte [bp+12]
|
||||||
|
|
||||||
cga_line:
|
cga_line:
|
||||||
push bp
|
push bp
|
||||||
mov bp, sp
|
mov bp, sp
|
||||||
|
|
@ -815,6 +814,7 @@ cga_line:
|
||||||
jge .calc_dx
|
jge .calc_dx
|
||||||
neg ax
|
neg ax
|
||||||
neg bx ; sx = -1
|
neg bx ; sx = -1
|
||||||
|
|
||||||
.calc_dx:
|
.calc_dx:
|
||||||
mov .dx, ax ; save dx
|
mov .dx, ax ; save dx
|
||||||
mov .sx, bx ; save sx
|
mov .sx, bx ; save sx
|
||||||
|
|
@ -826,6 +826,7 @@ cga_line:
|
||||||
jge .calc_dy
|
jge .calc_dy
|
||||||
neg ax
|
neg ax
|
||||||
neg bx ; sy = -1
|
neg bx ; sy = -1
|
||||||
|
|
||||||
.calc_dy:
|
.calc_dy:
|
||||||
mov .dy, ax ; save dy
|
mov .dy, ax ; save dy
|
||||||
mov .sy, bx ; save sy
|
mov .sy, bx ; save sy
|
||||||
|
|
@ -850,9 +851,11 @@ cga_line:
|
||||||
je .plot_black
|
je .plot_black
|
||||||
or byte [es:di], ah
|
or byte [es:di], ah
|
||||||
jmp .plot_next
|
jmp .plot_next
|
||||||
|
|
||||||
.plot_black:
|
.plot_black:
|
||||||
not ah
|
not ah
|
||||||
and byte [es:di], ah
|
and byte [es:di], ah
|
||||||
|
|
||||||
.plot_next:
|
.plot_next:
|
||||||
pop dx
|
pop dx
|
||||||
pop cx
|
pop cx
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue