ref: 85f7328bf853d30c23149151718c2ccef337ced5
parent: 50ea6d6e22804441c028e8bbbdd3e0720b4478c5
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Wed May 23 16:44:32 EDT 2018
Identify USE_OBP1_F
--- a/constants/map_object_constants.asm
+++ b/constants/map_object_constants.asm
@@ -58,10 +58,12 @@
LOW_PRIORITY_F EQU 0
HIGH_PRIORITY_F EQU 1
OVERHEAD_F EQU 3
+USE_OBP1_F EQU 4
LOW_PRIORITY EQU 1 << LOW_PRIORITY_F
HIGH_PRIORITY EQU 1 << HIGH_PRIORITY_F
OVERHEAD EQU 1 << OVERHEAD_F
+USE_OBP1 EQU 1 << USE_OBP1_F
; object_struct OBJECT_PALETTE bit flags
SWIMMING_F EQU 5
--- a/data/sprites/map_objects.asm
+++ b/data/sprites/map_objects.asm
@@ -198,7 +198,7 @@
db DOWN ; facing
db OBJECT_ACTION_STAND ; action
db 1 << 1 | FIXED_FACING | SLIDING | 1 << 5 ; flags1
- db 1 << 4 ; flags2
+ db USE_OBP1 ; flags2
db 0 ; palette flags
; SPRITEMOVEDATA_STRENGTH_BOULDER
--- a/engine/overworld/map_objects.asm
+++ b/engine/overworld/map_objects.asm
@@ -2973,12 +2973,12 @@
ld hl, OBJECT_SPRITE_TILE
add hl, bc
ld a, [hl]
- and %01111111
+ and $ff ^ (1 << 7)
ld [hFFC1], a
xor a
bit 7, [hl]
jr nz, .skip1
- or %00001000
+ or VRAM_BANK_1
.skip1
ld hl, OBJECT_FLAGS2
add hl, bc
@@ -2985,23 +2985,23 @@
ld e, [hl]
bit 7, e
jr z, .skip2
- or %10000000
+ or PRIORITY
.skip2
- bit 4, e
+ bit USE_OBP1_F, e
jr z, .skip3
- or %00010000
+ or OBP_NUM
.skip3
ld hl, OBJECT_PALETTE
add hl, bc
ld d, a
ld a, [hl]
- and %00000111
+ and PALETTE_MASK
or d
ld d, a
xor a
- bit 3, e
+ bit OVERHEAD_F, e
jr z, .skip4
- or %10000000
+ or PRIORITY
.skip4
ld [hFFC2], a
ld hl, OBJECT_SPRITE_X