fox32os/applications/fetcher/OS.okm

48 lines
1.8 KiB
Plaintext
Raw Normal View History

2023-07-25 06:17:56 +02:00
(* FIXME: this module should probably be moved somewhere global so all applications can use it *)
MODULE OS;
EXTERN PROCEDURE new_window, destroy_window, draw_str_to_overlay, get_window_overlay_number,
draw_widgets_to_window, draw_filled_rectangle_to_overlay, GetNextWindowEvent, DrawPixel,
save_state_and_yield_task, start_dragging_window, handle_widget_click, fill_window, fill_overlay,
set_window_flags, menu_update_event, menu_bar_click_event, close_menu, new_messagebox,
2023-07-13 09:11:02 +02:00
launch_fxf_from_disk, get_boot_disk_id, string_to_int, set_tilemap, draw_tile_to_overlay,
ryfs_get_file_list, copy_memory_bytes, IsRomDiskAvailable, end_current_task: INT;
EXTERN PROCEDURE brk: INT;
2023-07-13 01:41:39 +02:00
EXTERN PROCEDURE PortIn: INT;
EXTERN EVENT_TYPE_MOUSE_CLICK,
EVENT_TYPE_MOUSE_RELEASE,
EVENT_TYPE_BUTTON_CLICK,
EVENT_TYPE_MENU_BAR_CLICK,
EVENT_TYPE_MENU_UPDATE,
EVENT_TYPE_MENU_CLICK,
EVENT_TYPE_MENU_ACK,
WIDGET_TYPE_BUTTON: INT;
EXTERN eventArgs: ARRAY 8 OF INT;
TYPE Fox32OSButtonWidget = RECORD
next, id, type, text, fgColor, bgColor: INT;
width, height, x, y: SHORT;
END;
2023-07-13 01:41:39 +02:00
PROCEDURE Eep(ms: INT;); (* the furry version of sleep :3 *)
VAR deadline: INT;
BEGIN
deadline := ms + PortIn(80000706H);
WHILE PortIn(80000706H) <| deadline DO
save_state_and_yield_task();
END;
END;
PROCEDURE DrawWireframeBox(overlay, x, y, w, h, color: INT;);
BEGIN
draw_filled_rectangle_to_overlay(x, y, w, 1, color, overlay);
draw_filled_rectangle_to_overlay(x, y, 1, h, color, overlay);
draw_filled_rectangle_to_overlay(x + w - 1, y, 1, h, color, overlay);
draw_filled_rectangle_to_overlay(x, y + h - 1, w, 1, color, overlay);
END;
END.