diff options
author | Daniel Harding <33dannye@gmail.com> | 2021-11-15 13:31:15 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 13:31:15 -0600 |
commit | f516a91f5fa02a741631c77b9097598f466d1328 (patch) | |
tree | bac2ee5e3fad02983b061580f5c085baecb5439a /src/engine/menus/labels.asm | |
parent | 15e986d374fdd11ed0f412fbdc9b858d4c4b9f50 (diff) | |
parent | 1fd16cd27fcd4f432bfc09fc5b7a262798b72430 (diff) |
Some more bank splitting
Diffstat (limited to 'src/engine/menus/labels.asm')
-rw-r--r-- | src/engine/menus/labels.asm | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/engine/menus/labels.asm b/src/engine/menus/labels.asm new file mode 100644 index 0000000..4784bc4 --- /dev/null +++ b/src/engine/menus/labels.asm @@ -0,0 +1,72 @@ +; prints $ff-terminated list of text to text box +; given 2 bytes for text alignment and 2 bytes for text ID +PrintLabels: + ldh a, [hffb0] + push af + ld a, $02 + ldh [hffb0], a + + push hl +.loop_text_print_1 + ld d, [hl] + inc hl + bit 7, d + jr nz, .next + inc hl + ld a, [hli] + push hl + ld h, [hl] + ld l, a + call PrintTextNoDelay + pop hl + inc hl + jr .loop_text_print_1 + +.next + pop hl + pop af + ldh [hffb0], a +.loop_text_print_2 + ld d, [hl] + inc hl + bit 7, d + ret nz + ld e, [hl] + inc hl + call AdjustCoordinatesForBGScroll + call InitTextPrinting + ld a, [hli] + push hl + ld h, [hl] + ld l, a + call PrintTextNoDelay + pop hl + inc hl + jr .loop_text_print_2 + +InitAndPrintMenu: + push hl + push bc + push de + push af + ld d, [hl] + inc hl + ld e, [hl] + inc hl + ld b, [hl] + inc hl + ld c, [hl] + inc hl + push hl + call AdjustCoordinatesForBGScroll + farcall Func_c3ca + call DrawRegularTextBox + call DoFrameIfLCDEnabled + pop hl + call PrintLabels + pop af + call InitializeMenuParameters + pop de + pop bc + pop hl + ret |