From 3d1c3988923f86ddc92314c271976b2805d4d5de Mon Sep 17 00:00:00 2001 From: Ry Date: Wed, 2 Oct 2024 02:31:01 -0700 Subject: [PATCH] pride: Initial commit --- Makefile | 5 +++ applications/pride/main.asm | 74 +++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 applications/pride/main.asm diff --git a/Makefile b/Makefile index b74587c..9ce485e 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,9 @@ base_image/fetcher.fxf: applications/fetcher/Fetcher.okm $(wildcard applications $(FOX32ASM) applications/fetcher/fetcher.asm $@ rm applications/fetcher/fetcher.asm +base_image/pride.fxf: applications/pride/main.asm + $(FOX32ASM) $< $@ + base_image/serial.fxf: applications/serial/main.asm $(wildcard applications/terminal/*.asm) $(FOX32ASM) $< $@ @@ -98,6 +101,7 @@ FILES = \ base_image/terminal.fxf \ base_image/fetcher.fxf \ base_image/serial.fxf \ + base_image/pride.fxf \ base_image/foxpaint.fxf \ base_image/okmpaint.fxf \ base_image/bg.fxf \ @@ -114,6 +118,7 @@ ROM_FILES = \ base_image/terminal.fxf \ base_image/fetcher.fxf \ base_image/serial.fxf \ + base_image/pride.fxf \ base_image/bg.fxf \ base_image/launcher.fxf \ base_image/ted.fxf diff --git a/applications/pride/main.asm b/applications/pride/main.asm new file mode 100644 index 0000000..14a0ac4 --- /dev/null +++ b/applications/pride/main.asm @@ -0,0 +1,74 @@ +; pride flags :3 + + opton + + mov r0, window_struct + mov r1, window_title + mov r2, 256 + mov r3, 125 + mov r4, 64 + mov r5, 64 + mov r6, 0 + mov r7, 0 + call new_window + + mov r0, window_struct + call get_window_overlay_number + mov r5, r0 + mov r0, 0 + mov r1, 16 + mov r2, 256 + mov r3, 25 + mov r4, 0xFFFACE5B + call draw_filled_rectangle_to_overlay + add r1, 25 + mov r4, 0xFFB8A9F5 + call draw_filled_rectangle_to_overlay + add r1, 25 + mov r4, 0xFFFFFFFF + call draw_filled_rectangle_to_overlay + add r1, 25 + mov r4, 0xFFB8A9F5 + call draw_filled_rectangle_to_overlay + add r1, 25 + mov r4, 0xFFFACE5B + call draw_filled_rectangle_to_overlay + +event_loop: + mov r0, window_struct + call get_next_window_event + + ; did the user click somewhere in the window? + cmp r0, EVENT_TYPE_MOUSE_CLICK + ifz call mouse_click_event + + call yield_task + rjmp event_loop + +mouse_click_event: + push r0 + + ; check if we are attempting to drag or close the window + cmp r2, 16 + iflteq jmp drag_or_close_window + + pop r0 + ret + +drag_or_close_window: + cmp r1, 8 + iflteq jmp close_window + mov r0, window_struct + call start_dragging_window + pop r0 + ret +close_window: + mov r0, window_struct + call destroy_window + call end_current_task + +window_title: data.strz "Trans Pride!" +window_struct: data.fill 0, 40 + + #include "../../../fox32rom/fox32rom.def" + #include "../../../fox32os/fox32os.def"