Allow changing wallpapers from shell
This commit is contained in:
parent
c455758566
commit
be727d8757
|
@ -1,5 +1,5 @@
|
|||
[45m[97mANSI art is my
|
||||
[91mp[92ma[93ms[94ms[95mi[96mo[97mn[97m
|
||||
[45m[97mANSI art is my [91mp[92ma[93ms[94ms[95mi[96mo[97mn[97m
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
51
shell.asm
51
shell.asm
|
@ -43,13 +43,7 @@ initialize:
|
|||
.not_relaunch:
|
||||
|
||||
; Set wallpaper
|
||||
mov si, wallpaper_name
|
||||
xor dx, dx
|
||||
call PONYDOS_SEG:SYS_OPEN_FILE
|
||||
|
||||
mov bx, GLOBAL_WALLPAPER
|
||||
xor di, di ; read
|
||||
call PONYDOS_SEG:SYS_MODIFY_SECTORS
|
||||
call set_wallpaper
|
||||
|
||||
; Create icon for the disk on the desktop
|
||||
mov ax, cs
|
||||
|
@ -340,10 +334,33 @@ hide_file_window:
|
|||
launch:
|
||||
mov si, launch_filename
|
||||
|
||||
; Is it a .bin file?
|
||||
; Is it a .wall file?
|
||||
call strlen
|
||||
cmp cx, 5
|
||||
jb .not_wall
|
||||
add si, cx
|
||||
sub si, 5
|
||||
mov di, wall_extension
|
||||
call strcmp
|
||||
jne .not_wall
|
||||
|
||||
mov ax, cs
|
||||
mov es, ax
|
||||
mov si, launch_filename
|
||||
mov di, wallpaper_name
|
||||
mov cx, FS_DIRENT_NAME_SIZE
|
||||
rep movsb
|
||||
|
||||
call set_wallpaper
|
||||
call request_redraw
|
||||
jmp .end
|
||||
|
||||
.not_wall:
|
||||
|
||||
; Is it a .bin file?
|
||||
cmp cx, 4
|
||||
jb .end ; No, too short
|
||||
mov si, launch_filename
|
||||
add si, cx
|
||||
sub si, 4
|
||||
mov di, bin_extension
|
||||
|
@ -402,6 +419,20 @@ launch:
|
|||
.end:
|
||||
ret
|
||||
|
||||
; out:
|
||||
; clobbers everything
|
||||
set_wallpaper:
|
||||
mov ax, PONYDOS_SEG
|
||||
mov es, ax
|
||||
mov si, wallpaper_name
|
||||
xor dx, dx
|
||||
call PONYDOS_SEG:SYS_OPEN_FILE
|
||||
|
||||
mov bx, GLOBAL_WALLPAPER
|
||||
xor di, di ; read
|
||||
call PONYDOS_SEG:SYS_MODIFY_SECTORS
|
||||
ret
|
||||
|
||||
; in:
|
||||
; al = WM_KEYBOARD
|
||||
; bx = window ID
|
||||
|
@ -748,9 +779,11 @@ forward_event:
|
|||
pop bp
|
||||
ret
|
||||
|
||||
wallpaper_name db 'ponydos.wall', 0
|
||||
wallpaper_name db 'ponydos.wall'
|
||||
times FS_DIRENT_NAME_SIZE-12 db 0
|
||||
|
||||
bin_extension db '.bin', 0
|
||||
wall_extension db '.wall', 0
|
||||
|
||||
%include "debug.inc"
|
||||
|
||||
|
|
Loading…
Reference in New Issue