#define MAIN_MENU_FILE_1_OFFSET 128+2
#define MENU_CURSOR_TILE 0xF5
+#define MENU_CURSOR_TILE_REVERSE 0xF5+3
; location table for cursor
@notleft:
pop bc ; get back table length
+ ld c, b ; store table length in c
pop af
push af
dec b ; length - 1
ld [select_menu_delay], a
pop af
inc a
+ ld b, c ; table length = c
call select_menu_draw_status
ld b, BTNRIGHT
ret
; inputs:
; hl: string ptr table
; a: selection
+ ; b: string table length
; preserves:
; af
select_menu_draw_status:
push af
+ push bc
push hl
push af
call ui_clear_status_line
+
pop af
- pop hl
+ push af
+ ; check if left arrow needs to be drawn (a != 0)
+ cp a, 0
+ jr z, @no_left_arrow REL
+ ; write cursor tile
+ ld de, UI_STATUS_LINE
+ ld a, MENU_CURSOR_TILE_REVERSE
+ ld [de], a
+@no_left_arrow:
+ pop af
+ pop hl
+
add a, a ; * 2 for table offset
ld d, 0
ld e, a
ld h, a
ld l, d
- ld de, UI_STATUS_LINE
+ ld de, UI_STATUS_LINE+1
call puts
+ push de
call ui_request_redraw
+ pop de
+ ; de = tile after string
+ pop bc
+ pop af
+
+ push af
+ ; check if right arrow needs to be drawn (a != b-1)
+ dec b
+ cp a, b
+ jr z, @no_right_arrow REL
+ ; write cursor tile
+ ld a, MENU_CURSOR_TILE
+ ld [de], a
+@no_right_arrow:
pop af
ret