shithub: pokered

Download patch

ref: 09e92c554c7563b52a9484b26d96d903c7635b0d
parent: 865d37e02ad6af386e7f596659ebec12266be3ce
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Tue Nov 23 16:00:07 EST 2021

Use ~X instead of $ff ^ X

--- a/Makefile
+++ b/Makefile
@@ -58,7 +58,7 @@
 	$(MAKE) -C tools/
 
 
-RGBASMFLAGS = -h -L -Weverything
+RGBASMFLAGS = -h -L -Weverything -Wnumeric-string=2 -Wtruncation=1
 # Create a sym/map for debug purposes if `make` run with `DEBUG=1`
 ifeq ($(DEBUG),1)
 RGBASMFLAGS += -E
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -3433,7 +3433,7 @@
 	ld hl, wPlayerBattleStatus1
 	ld a, [hl]
 	; clear bide, thrashing, charging up, and trapping moves such as warp (already cleared for confusion damage)
-	and $ff ^ ((1 << STORING_ENERGY) | (1 << THRASHING_ABOUT) | (1 << CHARGING_UP) | (1 << USING_TRAPPING_MOVE))
+	and ~((1 << STORING_ENERGY) | (1 << THRASHING_ABOUT) | (1 << CHARGING_UP) | (1 << USING_TRAPPING_MOVE))
 	ld [hl], a
 	ld a, [wPlayerMoveEffect]
 	cp FLY_EFFECT
@@ -5940,7 +5940,7 @@
 	ld hl, wEnemyBattleStatus1
 	ld a, [hl]
 	; clear bide, thrashing about, charging up, and multi-turn moves such as warp
-	and $ff ^ ((1 << STORING_ENERGY) | (1 << THRASHING_ABOUT) | (1 << CHARGING_UP) | (1 << USING_TRAPPING_MOVE))
+	and ~((1 << STORING_ENERGY) | (1 << THRASHING_ABOUT) | (1 << CHARGING_UP) | (1 << USING_TRAPPING_MOVE))
 	ld [hl], a
 	ld a, [wEnemyMoveEffect]
 	cp FLY_EFFECT
--- a/engine/battle/move_effects/haze.asm
+++ b/engine/battle/move_effects/haze.asm
@@ -51,7 +51,7 @@
 	inc hl ; BATTSTATUS2
 	ld a, [hl]
 	; clear USING_X_ACCURACY, PROTECTED_BY_MIST, GETTING_PUMPED, and SEEDED statuses
-	and $ff ^((1 << USING_X_ACCURACY) | (1 << PROTECTED_BY_MIST) | (1 << GETTING_PUMPED) | (1 << SEEDED))
+	and ~((1 << USING_X_ACCURACY) | (1 << PROTECTED_BY_MIST) | (1 << GETTING_PUMPED) | (1 << SEEDED))
 	ld [hli], a ; BATTSTATUS3
 	ld a, [hl]
 	and %11110000 | (1 << TRANSFORMED) ; clear Bad Poison, Reflect and Light Screen statuses
--- a/engine/debug/debug_party.asm
+++ b/engine/debug/debug_party.asm
@@ -46,7 +46,7 @@
 	ld [wTownVisitedFlag + 1], a
 
 	; Get all badges except Earth Badge.
-	ld a, $ff ^ (1 << BIT_EARTHBADGE)
+	ld a, ~(1 << BIT_EARTHBADGE)
 	ld [wObtainedBadges], a
 
 	call SetIshiharaTeam
--- a/home/lcd.asm
+++ b/home/lcd.asm
@@ -12,7 +12,7 @@
 	jr nz, .wait
 
 	ldh a, [rLCDC]
-	and $ff ^ rLCDC_ENABLE_MASK
+	and ~rLCDC_ENABLE_MASK
 	ldh [rLCDC], a
 	ld a, b
 	ldh [rIE], a
--- a/scripts/ViridianCity.asm
+++ b/scripts/ViridianCity.asm
@@ -18,7 +18,7 @@
 	CheckEvent EVENT_VIRIDIAN_GYM_OPEN
 	ret nz
 	ld a, [wObtainedBadges]
-	cp $ff ^ (1 << BIT_EARTHBADGE)
+	cp ~(1 << BIT_EARTHBADGE)
 	jr nz, .gym_closed
 	SetEvent EVENT_VIRIDIAN_GYM_OPEN
 	ret
@@ -148,7 +148,7 @@
 ViridianCityText2:
 	text_asm
 	ld a, [wObtainedBadges]
-	cp $ff ^ (1 << BIT_EARTHBADGE)
+	cp ~(1 << BIT_EARTHBADGE)
 	ld hl, ViridianCityText_19127
 	jr z, .done
 	CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI