Add some convenience routines for moving and resizing overlays

This commit is contained in:
Ry 2022-07-26 16:58:20 -07:00
parent ab0a8e62db
commit 8ee0214164
3 changed files with 84 additions and 0 deletions

View File

@ -43,6 +43,11 @@ draw_pixel_to_overlay: jmp [0xF004301C]
draw_filled_rectangle_to_overlay: jmp [0xF0043020]
check_if_overlay_covers_position: jmp [0xF0043024]
check_if_enabled_overlay_covers_position: jmp [0xF0043028]
enable_overlay: jmp [0xF004302C]
disable_overlay: jmp [0xF0043030]
move_overlay: jmp [0xF0043034]
resize_overlay: jmp [0xF0043038]
set_overlay_framebuffer_pointer: jmp [0xF004303C]
; menu bar jump table
enable_menu_bar: jmp [0xF0044000]

View File

@ -189,6 +189,11 @@ get_rom_version:
data.32 draw_filled_rectangle_to_overlay
data.32 check_if_overlay_covers_position
data.32 check_if_enabled_overlay_covers_position
data.32 enable_overlay
data.32 disable_overlay
data.32 move_overlay
data.32 resize_overlay
data.32 set_overlay_framebuffer_pointer
; menu bar jump table
org.pad 0xF0044000

View File

@ -1,5 +1,79 @@
; overlay routines
; enable an overlay
; inputs:
; r0: overlay number
; outputs:
; none
enable_overlay:
push r0
or r0, 0x80000300
out r0, 1
pop r0
ret
; disable an overlay
; inputs:
; r0: overlay number
; outputs:
; none
disable_overlay:
push r0
or r0, 0x80000300
out r0, 0
pop r0
ret
; move an overlay
; r0: X position
; r1: Y position
; r2: overlay number
move_overlay:
push r1
push r2
or r2, 0x80000000
sla r1, 16
mov.16 r1, r0
out r2, r1
pop r2
pop r1
ret
; resize an overlay
; r0: width
; r1: height
; r2: overlay number
resize_overlay:
push r1
push r2
or r2, 0x80000100
sla r1, 16
mov.16 r1, r0
out r2, r1
pop r2
pop r1
ret
; set an overlay's framebuffer pointer
; r0: framebuffer pointer
; r1: overlay number
set_overlay_framebuffer_pointer:
push r1
or r1, 0x80000200
out r1, r0
pop r1
ret
; fill a whole overlay with a color
; inputs:
; r0: color