Skip to content

Commit

Permalink
Fetcher: Use sleep_task
Browse files Browse the repository at this point in the history
  • Loading branch information
ry755 committed Oct 11, 2023
1 parent d61c54d commit beb7a8f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion applications/fetcher/Browser.okm
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ MODULE Browser;
w := RSH(384 *| (16 - i) + 32 *| i, 4);
h := RSH(192 *| (16 - i) + 32 *| i, 4);
DrawWireframeBox(get_window_overlay_number(desktopWin), x, y, w, h, 020F0F0F0H);
Eep(10);
sleep_task(10);
draw_filled_rectangle_to_overlay(x, y, w, h, 0, get_window_overlay_number(desktopWin));
i := i + 1;
END;
Expand Down
2 changes: 1 addition & 1 deletion applications/fetcher/Desktop.okm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ MODULE Desktop;
w := RSH(32 *| (16 - i) + 384 *| i, 4);
h := RSH(32 *| (16 - i) + 192 *| i, 4);
DrawWireframeBox(get_window_overlay_number(PTROF(desktopWindow)), x, y, w, h, 020F0F0F0H);
Eep(10);
sleep_task(10);
draw_filled_rectangle_to_overlay(x, y, w, h, 0, get_window_overlay_number(PTROF(desktopWindow)));
i := i + 1;
END;
Expand Down
11 changes: 1 addition & 10 deletions applications/fetcher/OS.okm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MODULE OS;
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,
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;
ryfs_get_file_list, copy_memory_bytes, IsRomDiskAvailable, end_current_task, sleep_task: INT;

EXTERN PROCEDURE brk: INT;

Expand All @@ -30,15 +30,6 @@ MODULE OS;
width, height, x, y: SHORT;
END;

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);
Expand Down

0 comments on commit beb7a8f

Please sign in to comment.