-
Notifications
You must be signed in to change notification settings - Fork 0
/
statsRoutines.asm
85 lines (81 loc) · 1.45 KB
/
statsRoutines.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
startMenu:
call drawMap ; erase the screen [drawMap.asm]
call drawPlayer ; player was erased in the call above
xor a ; default option selected
ld hl,startMenuTxt
call drawMenu
call menuGetkey
jp main ;if they cancel out of the menu with [Alpha], go back to the main loop
dispStats:
call clearGbuf
ld bc,$4060 ;dimensions
ld de,$0000 ;coords
ld hl,statsMenuTxt ;txt
call drawTextBox
call drawGbuf
call pause
jr startMenu
dispItems:
ld hl,playerInventory
ld a,(hl)
or a
jr z,noItems
exx
ld hl,itemMenuTxt
ld (hl),a ;# of items
inc hl
exx
ld b,a
ld ix,subMenu1Txt
createItemListLoop:
inc hl ;points to first item ID
ld e,(hl)
inc hl ;item amount
ld d,(hl)
push de
exx
pop de
ld (hl),MN
inc hl
ld (hl),ITEM
inc hl
ld (hl),e
inc hl
ld (hl),NEWX
inc hl
ld (hl),82
inc hl
ld (hl),NUM8
inc hl
ld (hl),d
inc hl
ld (hl),NEWL
inc hl ;.db MN,ITEM,[ID],NEWX,70,NUM8,[#],NEWL
exx
ld (ix),ITEMD
inc ix
ld (ix),e
inc ix
ld (ix),0
inc ix ;.db ITEMD,[ID],0
djnz createItemListLoop
;zero terminate the string
xor a
exx
dec hl
ld (hl),a ;this overwrites the last NEWL with a 0
;just ignore shadows
ld hl,itemMenuTxt
ld de,$0000 ;y,x
ld bc,$2E60 ;width,height
ld a,5 ;how many items to be drawn at a time
call drawMenuScroll
ld de,$002C ;e=y,d=x
ld bc,$1460 ;width,height
call installSub1
call menuGetkey
jp startMenu
noItems:
ld hl,noItemsTxt
call drawDialog
jp startMenu