Resolve #428: Use HIGH(X) and LOW(X) instead of X / $100 and X % $100 or X >> 8 and X & $ff

This commit is contained in:
Remy Oukaour
2017-12-25 13:40:10 -05:00
parent da2b01a36c
commit e34e68095d
71 changed files with 435 additions and 398 deletions

View File

@@ -124,28 +124,28 @@ _CheckItem:: ; d244
DoesHLEqualNumItems: ; d27b
ld a, l
cp NumItems % $100
cp LOW(NumItems)
ret nz
ld a, h
cp NumItems / $100
cp HIGH(NumItems)
ret
GetPocketCapacity: ; d283
ld c, MAX_ITEMS
ld a, e
cp NumItems % $100
cp LOW(NumItems)
jr nz, .not_bag
ld a, d
cp NumItems / $100
cp HIGH(NumItems)
ret z
.not_bag
ld c, MAX_PC_ITEMS
ld a, e
cp PCItems % $100
cp LOW(PCItems)
jr nz, .not_pc
ld a, d
cp PCItems / $100
cp HIGH(PCItems)
ret z
.not_pc