Wrap set_skin, unpacker works now.
This commit is contained in:
8
kofu.c
8
kofu.c
@@ -298,6 +298,13 @@ void kofu_display_number(int argc, const char **argv) {
|
|||||||
umka_sys_display_number(is_pointer, base, digits_to_display, is_qword, show_leading_zeros, number_or_pointer, x, y, color, fill_background, font, draw_to_buffer, scale_factor, background_color_or_buffer);
|
umka_sys_display_number(is_pointer, base, digits_to_display, is_qword, show_leading_zeros, number_or_pointer, x, y, color, fill_background, font, draw_to_buffer, scale_factor, background_color_or_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void kofu_set_skin(int argc, const char **argv) {
|
||||||
|
(void)argc;
|
||||||
|
const char *path = argv[1];
|
||||||
|
int32_t status = umka_sys_set_skin(path);
|
||||||
|
printf("status: %" PRIi32 "\n", status);
|
||||||
|
}
|
||||||
|
|
||||||
void kofu_get_font_smoothing(int argc, const char **argv) {
|
void kofu_get_font_smoothing(int argc, const char **argv) {
|
||||||
(void)argc;
|
(void)argc;
|
||||||
(void)argv;
|
(void)argv;
|
||||||
@@ -711,6 +718,7 @@ func_table_t funcs[] = {
|
|||||||
{ "draw_rect", kofu_draw_rect },
|
{ "draw_rect", kofu_draw_rect },
|
||||||
{ "draw_line", kofu_draw_line },
|
{ "draw_line", kofu_draw_line },
|
||||||
{ "display_number", kofu_display_number },
|
{ "display_number", kofu_display_number },
|
||||||
|
{ "set_skin", kofu_set_skin },
|
||||||
{ "get_font_smoothing", kofu_get_font_smoothing },
|
{ "get_font_smoothing", kofu_get_font_smoothing },
|
||||||
{ "set_font_smoothing", kofu_set_font_smoothing },
|
{ "set_font_smoothing", kofu_set_font_smoothing },
|
||||||
{ "put_image_palette", kofu_put_image_palette },
|
{ "put_image_palette", kofu_put_image_palette },
|
||||||
|
35
kolibri.asm
35
kolibri.asm
@@ -14,6 +14,13 @@ lang fix en
|
|||||||
preboot_blogesc = 0 ; start immediately after bootlog
|
preboot_blogesc = 0 ; start immediately after bootlog
|
||||||
pci_code_sel = 0
|
pci_code_sel = 0
|
||||||
VESA_1_2_VIDEO = 0 ; enable vesa 1.2 bank switch functions
|
VESA_1_2_VIDEO = 0 ; enable vesa 1.2 bank switch functions
|
||||||
|
macro int n {
|
||||||
|
if n eq 0x40
|
||||||
|
call i40
|
||||||
|
else
|
||||||
|
int n
|
||||||
|
end if
|
||||||
|
}
|
||||||
|
|
||||||
purge mov,add,sub
|
purge mov,add,sub
|
||||||
purge mov,add,sub
|
purge mov,add,sub
|
||||||
@@ -69,9 +76,7 @@ include 'video/cursors.inc'
|
|||||||
include 'unpacker.inc'
|
include 'unpacker.inc'
|
||||||
include 'gui/window.inc'
|
include 'gui/window.inc'
|
||||||
include 'gui/button.inc'
|
include 'gui/button.inc'
|
||||||
load_file equ __load_file
|
|
||||||
include 'gui/skincode.inc'
|
include 'gui/skincode.inc'
|
||||||
restore load_file
|
|
||||||
include 'sysother.inc'
|
include 'sysother.inc'
|
||||||
include 'gui/draw.inc'
|
include 'gui/draw.inc'
|
||||||
include 'gui/font.inc'
|
include 'gui/font.inc'
|
||||||
@@ -198,9 +203,13 @@ proc kos_init c uses ebx esi edi ebp
|
|||||||
call init_kernel_heap
|
call init_kernel_heap
|
||||||
call init_malloc
|
call init_malloc
|
||||||
|
|
||||||
|
stdcall kernel_alloc, (unpack.LZMA_BASE_SIZE+(unpack.LZMA_LIT_SIZE shl \
|
||||||
|
(unpack.lc+unpack.lp)))*4
|
||||||
|
mov [unpack.p], eax
|
||||||
|
|
||||||
mov dword[sysdir_name], 'sys'
|
mov dword[sysdir_name], 'sys'
|
||||||
mov dword[sysdir_path], 'HD0/'
|
mov dword[sysdir_path], 'RD/1'
|
||||||
mov word[sysdir_path+4], '1'
|
mov word[sysdir_path+4], 0
|
||||||
|
|
||||||
mov ebx, SLOT_BASE + 2*256
|
mov ebx, SLOT_BASE + 2*256
|
||||||
mov [current_slot], ebx
|
mov [current_slot], ebx
|
||||||
@@ -255,7 +264,7 @@ proc kos_init c uses ebx esi edi ebp
|
|||||||
|
|
||||||
call set_window_defaults
|
call set_window_defaults
|
||||||
mov [skin_data], 0
|
mov [skin_data], 0
|
||||||
call load_default_skin
|
; call load_default_skin
|
||||||
|
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
@@ -521,19 +530,6 @@ sys_posix:
|
|||||||
sys_end:
|
sys_end:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
proc __load_file _filename
|
|
||||||
push ebx ecx edx esi edi
|
|
||||||
stdcall kernel_alloc, skin_size
|
|
||||||
push eax
|
|
||||||
mov esi, skin
|
|
||||||
mov edi, eax
|
|
||||||
mov ecx, skin_size
|
|
||||||
rep movsb
|
|
||||||
pop eax
|
|
||||||
pop edi esi edx ecx ebx
|
|
||||||
ret
|
|
||||||
endp
|
|
||||||
|
|
||||||
coverage_end:
|
coverage_end:
|
||||||
public coverage_end
|
public coverage_end
|
||||||
|
|
||||||
@@ -551,10 +547,7 @@ vdisk_functions:
|
|||||||
dd 0 ; adjust_cache_size
|
dd 0 ; adjust_cache_size
|
||||||
vdisk_functions_end:
|
vdisk_functions_end:
|
||||||
|
|
||||||
disk_name db 'hd0',0
|
|
||||||
;IncludeIGlobals
|
;IncludeIGlobals
|
||||||
skin file 'skin.skn'
|
|
||||||
skin_size = $ - skin
|
|
||||||
include 'hid/mousedrv.inc'
|
include 'hid/mousedrv.inc'
|
||||||
|
|
||||||
screen_workarea RECT
|
screen_workarea RECT
|
||||||
|
@@ -155,6 +155,7 @@ typedef struct {
|
|||||||
uint32_t kos_time_to_epoch(uint32_t *time);
|
uint32_t kos_time_to_epoch(uint32_t *time);
|
||||||
void kos_init(void);
|
void kos_init(void);
|
||||||
void i40(void);
|
void i40(void);
|
||||||
|
int32_t set_skin(const char *path);
|
||||||
void *kos_disk_add(const char *file_name, const char *disk_name);
|
void *kos_disk_add(const char *file_name, const char *disk_name);
|
||||||
int kos_disk_del(const char *name);
|
int kos_disk_del(const char *name);
|
||||||
uint32_t kos_getcwd(char *buf, uint32_t len);
|
uint32_t kos_getcwd(char *buf, uint32_t len);
|
||||||
|
12
syscalls.h
12
syscalls.h
@@ -155,6 +155,18 @@ static inline void umka_sys_display_number(int is_pointer, int base,
|
|||||||
: "memory");
|
: "memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int32_t umka_sys_set_skin(const char *path) {
|
||||||
|
int32_t status;
|
||||||
|
__asm__ __inline__ __volatile__ (
|
||||||
|
"call i40"
|
||||||
|
: "=a" (status)
|
||||||
|
: "a"(48),
|
||||||
|
"b"(8),
|
||||||
|
"c"(path)
|
||||||
|
: "memory");
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int umka_sys_get_smoothing() {
|
static inline int umka_sys_get_smoothing() {
|
||||||
int type;
|
int type;
|
||||||
__asm__ __inline__ __volatile__ (
|
__asm__ __inline__ __volatile__ (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
disk_add ../img/kolibri.img rd
|
||||||
|
set_skin /sys/DEFAULT.SKN
|
||||||
window_redraw 1
|
window_redraw 1
|
||||||
draw_window 0 300 0 200 0x000088 1 1 1 0 1 4 hello
|
draw_window 0 300 0 200 0x000088 1 1 1 0 1 4 hello
|
||||||
set_pixel 0 0 0x0000ff
|
set_pixel 0 0 0x0000ff
|
||||||
@@ -34,3 +36,5 @@ dump_win_pos 5
|
|||||||
process_info -1
|
process_info -1
|
||||||
|
|
||||||
scrot umka.rgba
|
scrot umka.rgba
|
||||||
|
|
||||||
|
disk_del rd
|
||||||
|
Reference in New Issue
Block a user