Skip to content

Commit

Permalink
pride: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ry755 committed Oct 2, 2024
1 parent ce1ce9f commit 3d1c398
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) $< $@

Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down
74 changes: 74 additions & 0 deletions applications/pride/main.asm
Original file line number Diff line number Diff line change
@@ -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"

1 comment on commit 3d1c398

@minihoot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YAY!! 10/10 commit.

Please sign in to comment.