forked from offtopia/ponydos
Can now not create a file with open_file
This commit is contained in:
parent
99288a9fff
commit
b38f9a663c
|
@ -62,6 +62,7 @@ load_shell:
|
||||||
push word 0x1000
|
push word 0x1000
|
||||||
pop es
|
pop es
|
||||||
mov si, shell_name
|
mov si, shell_name
|
||||||
|
xor dx, dx
|
||||||
call 0:open_file
|
call 0:open_file
|
||||||
xor bx, bx
|
xor bx, bx
|
||||||
xor di, di ; read
|
xor di, di ; read
|
||||||
|
@ -90,7 +91,7 @@ draw:
|
||||||
; Draw windows
|
; Draw windows
|
||||||
push cs ; Return segment
|
push cs ; Return segment
|
||||||
push word mainloop ; Return offset
|
push word mainloop ; Return offset
|
||||||
mov bx, [window_chain_head]
|
mov bx, [di - mouse_column + window_chain_head]
|
||||||
mov ax, 0xf000
|
mov ax, 0xf000
|
||||||
and ax, bx
|
and ax, bx
|
||||||
push ax ; Call segment
|
push ax ; Call segment
|
||||||
|
@ -100,7 +101,7 @@ draw:
|
||||||
retf
|
retf
|
||||||
|
|
||||||
mainloop:
|
mainloop:
|
||||||
cmp byte [redraw], 0
|
cmp byte [di - mouse_column + redraw], 0
|
||||||
jne draw
|
jne draw
|
||||||
|
|
||||||
mov bx, [di - mouse_column + mouse_x]
|
mov bx, [di - mouse_column + mouse_x]
|
||||||
|
@ -299,6 +300,7 @@ shell_name db 'shell.bin', 0
|
||||||
; out:
|
; out:
|
||||||
; ax = LBA of first sector, 0 if no space left
|
; ax = LBA of first sector, 0 if no space left
|
||||||
; cx = length in sectors
|
; cx = length in sectors
|
||||||
|
; dx = non-zero => do not create new file
|
||||||
; di = dirent address (in GLOBAL_DIRENTS)
|
; di = dirent address (in GLOBAL_DIRENTS)
|
||||||
; [Far calls only]
|
; [Far calls only]
|
||||||
open_file:
|
open_file:
|
||||||
|
@ -354,6 +356,9 @@ open_file:
|
||||||
retf
|
retf
|
||||||
|
|
||||||
.create_file:
|
.create_file:
|
||||||
|
test dx, dx
|
||||||
|
jnz .return
|
||||||
|
|
||||||
; TODO: zero out the sector for this file?
|
; TODO: zero out the sector for this file?
|
||||||
inc word [es:di]
|
inc word [es:di]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue