Save some bytes

This commit is contained in:
shikhin 2023-03-18 12:12:18 +05:30
parent f39f25a4c1
commit a110e1da1b
3 changed files with 14 additions and 9 deletions

View File

@ -6,7 +6,7 @@ PYTHON = python3
all: ponydos.img all: ponydos.img
FS_FILES = wallpaper.bin shell.bin FS_FILES = bg.bin shell.bin
ponydos.img: ponydos.bin $(FS_FILES) ponydos.img: ponydos.bin $(FS_FILES)
$(PYTHON) assemble_floppy.py $@ ponydos.bin $(FS_FILES) $(PYTHON) assemble_floppy.py $@ ponydos.bin $(FS_FILES)

View File

@ -72,8 +72,8 @@ load_wallpaper:
; TODO: error management? Surely this works... ; TODO: error management? Surely this works...
load_shell: load_shell:
mov ax, 0x1000 push word 0x1000
mov es, ax pop es
mov si, shell_name mov si, shell_name
call open_file call open_file
xor bx, bx xor bx, bx
@ -118,15 +118,20 @@ mainloop:
draw_wallpaper: draw_wallpaper:
pusha pusha
push es push es
push ds
mov bx, 0xb800 xor ax, ax
mov es, bx mov ds, ax
push word 0xb800
pop es
mov si, WALLPAPER mov si, WALLPAPER
xor di, di xor di, di
mov cx, 80*25 mov cx, 80*25
rep movsw rep movsw
pop ds
pop es pop es
popa popa
ret ret
@ -135,8 +140,8 @@ flip_mouse_cursor:
pusha pusha
push es push es
mov bx, 0xb800 push word 0xb800
mov es, bx pop es
; Column ; Column
xor bh, bh xor bh, bh
@ -224,7 +229,7 @@ modify_sector:
ret ret
.error: .error:
; Reset the disk system unconditinoally, as we have no ; Reset the disk system unconditionally, as we have no
; kernel panic handler to go to after 3 tries and proper ; kernel panic handler to go to after 3 tries and proper
; error handling would take too much code ; error handling would take too much code
xor ah, ah xor ah, ah
@ -235,7 +240,7 @@ modify_sector:
; Filesystem ; Filesystem
; ------------------------------------------------------------------ ; ------------------------------------------------------------------
wallpaper_name: db 'wallpaper.bin', 0 wallpaper_name: db 'bg.bin', 0
shell_name: db 'shell.bin', 0 shell_name: db 'shell.bin', 0
; in: ; in: