Fix redraw handling

This commit is contained in:
Juhani Krekelä 2023-03-20 18:17:45 +02:00
parent 140b191c0a
commit f51b9458da
2 changed files with 24 additions and 18 deletions

View File

@ -75,19 +75,25 @@ initialize_screen:
mov ch, 0x20 mov ch, 0x20
int 0x10 int 0x10
draw:
; Set up segments for drawing routines ; Set up segments for drawing routines
push word 0xb800 push word 0xb800
pop es pop es
mov di, mouse_column
mainloop:
xor al, al
xchg byte [di - mouse_column + redraw], al
test al, al
jz .draw_end
.draw:
call draw_wallpaper call draw_wallpaper
mov di, mouse_column
call flip_mouse_cursor call flip_mouse_cursor
; Draw windows ; Draw windows
push cs ; Return segment push cs ; Return segment
push word mainloop ; Return offset push word .draw_end ; Return offset
mov bx, [di - mouse_column + window_chain_head] mov bx, [di - mouse_column + window_chain_head]
mov ax, 0xf000 mov ax, 0xf000
and ax, bx and ax, bx
@ -96,10 +102,7 @@ draw:
push cs ; Call offset push cs ; Call offset
mov ax, WM_PAINT mov ax, WM_PAINT
retf retf
.draw_end:
mainloop:
cmp byte [di - mouse_column + redraw], 0
jne draw
mov bx, [di - mouse_column + mouse_x] mov bx, [di - mouse_column + mouse_x]
shr bx, 1 shr bx, 1

View File

@ -65,6 +65,9 @@ initialize:
xchg [es:GLOBAL_WINDOW_CHAIN_HEAD], ax xchg [es:GLOBAL_WINDOW_CHAIN_HEAD], ax
mov [next_window2], ax mov [next_window2], ax
; Request repaint
mov byte [es:GLOBAL_REDRAW], 1
; Temporary testing ; Temporary testing
mov ax, cs mov ax, cs
mov es, ax mov es, ax