Fix redraw handling
This commit is contained in:
parent
140b191c0a
commit
f51b9458da
2 changed files with 24 additions and 18 deletions
39
ponydos.asm
39
ponydos.asm
|
@ -75,31 +75,34 @@ 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
|
||||||
|
|
||||||
call draw_wallpaper
|
|
||||||
|
|
||||||
mov di, mouse_column
|
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:
|
mainloop:
|
||||||
cmp byte [di - mouse_column + redraw], 0
|
xor al, al
|
||||||
jne draw
|
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]
|
mov bx, [di - mouse_column + mouse_x]
|
||||||
shr bx, 1
|
shr bx, 1
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue