forked from offtopia/ponydos
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
|
||||
sub ax, [si + window.y]
|
||||
jz .end
|
||||
dec ax
|
||||
|
||||
; Find the start of the line user clicked on
|
||||
mov bx, [si + window.width]
|
||||
shl bx, 1
|
||||
mul bx
|
||||
push ds
|
||||
|
||||
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
|
||||
|
||||
; Zero out launch_filename
|
||||
mov di, launch_filename
|
||||
mov cx, FS_DIRENT_NAME_SIZE
|
||||
xor al, al
|
||||
rep stosb
|
||||
add si, 2 ; File name begins two bytes into the start of the dirent
|
||||
|
||||
; Copy file name to launch_filename
|
||||
mov di, launch_filename
|
||||
.copy_filename_loop:
|
||||
lodsw
|
||||
test al, al
|
||||
jz .copy_filename_loop_end
|
||||
stosb
|
||||
jmp .copy_filename_loop
|
||||
.copy_filename_loop_end:
|
||||
mov cx, FS_DIRENT_NAME_SIZE
|
||||
rep movsb
|
||||
|
||||
pop ds
|
||||
|
||||
call launch
|
||||
|
||||
|
|
Loading…
Reference in New Issue