diff options
author | yenatch <yenatch@gmail.com> | 2018-04-09 21:30:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-09 21:30:24 -0400 |
commit | 40b537d45b4b8937038126f7e5d2d21ccee460c0 (patch) | |
tree | 881a090b80b2c22985fc6d1231b03c6721a83462 /home/scrolling_menu.asm | |
parent | e4b41fad4fd3787ca2e61adb5377ba8f68fca7ef (diff) | |
parent | 53ff57ca663dc5bf9c3731022b0eb0dc73f2207f (diff) |
Merge pull request #503 from Rangi42/master
Factor wMisc into meaningful parts; move most code out of home.asm
Diffstat (limited to 'home/scrolling_menu.asm')
-rw-r--r-- | home/scrolling_menu.asm | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/home/scrolling_menu.asm b/home/scrolling_menu.asm new file mode 100644 index 000000000..cb7d7b1c5 --- /dev/null +++ b/home/scrolling_menu.asm @@ -0,0 +1,65 @@ +ScrollingMenu:: ; 350c + call CopyMenuData + ld a, [hROMBank] + push af + + ld a, BANK(_ScrollingMenu) + rst Bankswitch + + call _InitScrollingMenu + call .UpdatePalettes + call _ScrollingMenu + + pop af + rst Bankswitch + + ld a, [wMenuJoypad] + ret +; 3524 + +.UpdatePalettes: ; 3524 + ld hl, wVramState + bit 0, [hl] + jp nz, UpdateTimePals + jp SetPalettes +; 352f + +InitScrollingMenu:: ; 352f + ld a, [wMenuBorderTopCoord] + dec a + ld b, a + ld a, [wMenuBorderBottomCoord] + sub b + ld d, a + ld a, [wMenuBorderLeftCoord] + dec a + ld c, a + ld a, [wMenuBorderRightCoord] + sub c + ld e, a + push de + call Coord2Tile + pop bc + jp TextBox +; 354b + +JoyTextDelay_ForcehJoyDown:: ; 354b joypad + call DelayFrame + + ld a, [hInMenu] + push af + ld a, $1 + ld [hInMenu], a + call JoyTextDelay + pop af + ld [hInMenu], a + + ld a, [hJoyLast] + and D_RIGHT + D_LEFT + D_UP + D_DOWN + ld c, a + ld a, [hJoyPressed] + and A_BUTTON + B_BUTTON + SELECT + START + or c + ld c, a + ret +; 3567 |