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

View File

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