Properly read the file names from the directory in shell
This commit is contained in:
parent
e9462804f5
commit
572362f04f
31
shell.asm
31
shell.asm
|
@ -395,30 +395,25 @@ click:
|
||||||
mov ax, bx
|
mov ax, bx
|
||||||
sub ax, [si + window.y]
|
sub ax, [si + window.y]
|
||||||
jz .end
|
jz .end
|
||||||
|
dec ax
|
||||||
|
|
||||||
; Find the start of the line user clicked on
|
push ds
|
||||||
mov bx, [si + window.width]
|
|
||||||
shl bx, 1
|
|
||||||
mul bx
|
|
||||||
|
|
||||||
mov si, [si + window.data]
|
mov bp, PONYDOS_SEG
|
||||||
|
mov ds, bp
|
||||||
|
|
||||||
|
mov bp, FS_DIRENT_SIZE
|
||||||
|
mul bp
|
||||||
|
mov si, GLOBAL_DIRENTS
|
||||||
add si, ax
|
add si, ax
|
||||||
|
add si, 2 ; File name begins two bytes into the start of the dirent
|
||||||
; Zero out launch_filename
|
|
||||||
mov di, launch_filename
|
|
||||||
mov cx, FS_DIRENT_NAME_SIZE
|
|
||||||
xor al, al
|
|
||||||
rep stosb
|
|
||||||
|
|
||||||
; Copy file name to launch_filename
|
; Copy file name to launch_filename
|
||||||
mov di, launch_filename
|
mov di, launch_filename
|
||||||
.copy_filename_loop:
|
mov cx, FS_DIRENT_NAME_SIZE
|
||||||
lodsw
|
rep movsb
|
||||||
test al, al
|
|
||||||
jz .copy_filename_loop_end
|
pop ds
|
||||||
stosb
|
|
||||||
jmp .copy_filename_loop
|
|
||||||
.copy_filename_loop_end:
|
|
||||||
|
|
||||||
call launch
|
call launch
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue