From e706b878d9f78466e6cc9eda184e14a798cc4a0d Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 23 Nov 2021 20:37:18 -0500 Subject: [PATCH] Use ~X instead of $ff ^ X --- audio/engine.asm | 2 +- engine/battle/effect_commands.asm | 2 +- engine/battle_anims/anim_commands.asm | 2 +- engine/battle_anims/helpers.asm | 2 +- engine/events/catch_tutorial.asm | 2 +- engine/gfx/sprites.asm | 4 ++-- engine/items/item_effects.asm | 2 +- engine/link/mystery_gift.asm | 2 +- engine/menus/save.asm | 2 +- engine/menus/trainer_card.asm | 2 +- engine/overworld/map_objects.asm | 4 ++-- engine/overworld/scripting.asm | 6 +++--- engine/overworld/variables.asm | 2 +- engine/pokemon/stats_screen.asm | 8 ++++---- home/lcd.asm | 2 +- mobile/mobile_5f.asm | 2 +- 16 files changed, 23 insertions(+), 23 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index db175b7d0..7d9f7b458 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -533,7 +533,7 @@ PlayDanger: ret z ; Don't do anything if SFX is being played - and $ff ^ (1 << DANGER_ON_F) + and ~(1 << DANGER_ON_F) ld d, a call _CheckSFX jr c, .increment diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 77623f07b..de1a15103 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -340,7 +340,7 @@ CantMove: ld a, BATTLE_VARS_SUBSTATUS3 call GetBattleVarAddr ld a, [hl] - and $ff ^ (1 << SUBSTATUS_BIDE | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_CHARGED) + and ~(1 << SUBSTATUS_BIDE | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_CHARGED) ld [hl], a call ResetFuryCutterCount diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index a5ecdb393..e7ae07087 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -245,7 +245,7 @@ BattleAnim_ClearOAM: ld c, NUM_SPRITE_OAM_STRUCTS .loop ld a, [hl] - and $ff ^ (PALETTE_MASK | VRAM_BANK_1) ; zeros out the palette bits + and ~(PALETTE_MASK | VRAM_BANK_1) ; zeros out the palette bits assert PAL_BATTLE_OB_ENEMY == 0 ld [hli], a rept SPRITEOAMSTRUCT_LENGTH - 1 diff --git a/engine/battle_anims/helpers.asm b/engine/battle_anims/helpers.asm index b533988ef..6685ab733 100644 --- a/engine/battle_anims/helpers.asm +++ b/engine/battle_anims/helpers.asm @@ -37,7 +37,7 @@ GetBattleAnimFrame: push af ld a, [hl] push hl - and $ff ^ (Y_FLIP << 1 | X_FLIP << 1) + and ~(Y_FLIP << 1 | X_FLIP << 1) ld hl, BATTLEANIMSTRUCT_DURATION add hl, bc ld [hl], a diff --git a/engine/events/catch_tutorial.asm b/engine/events/catch_tutorial.asm index 5c12a02f1..3539ceab6 100644 --- a/engine/events/catch_tutorial.asm +++ b/engine/events/catch_tutorial.asm @@ -35,7 +35,7 @@ CatchTutorial:: ldh [hJoyPressed], a ld a, [wOptions] push af - and $ff ^ TEXT_DELAY_MASK + and ~TEXT_DELAY_MASK add TEXT_DELAY_MED ld [wOptions], a ld hl, .AutoInput diff --git a/engine/gfx/sprites.asm b/engine/gfx/sprites.asm index 81f65c52d..b3c781625 100644 --- a/engine/gfx/sprites.asm +++ b/engine/gfx/sprites.asm @@ -351,7 +351,7 @@ GetSpriteOAMAttr: and PRIORITY | Y_FLIP | X_FLIP ld b, a ld a, [hl] - and $ff ^ (PRIORITY | Y_FLIP | X_FLIP) + and ~(PRIORITY | Y_FLIP | X_FLIP) or b ret @@ -436,7 +436,7 @@ GetSpriteAnimFrame: push af ld a, [hl] push hl - and $ff ^ (Y_FLIP << 1 | X_FLIP << 1) + and ~(Y_FLIP << 1 | X_FLIP << 1) ld hl, SPRITEANIMSTRUCT_DURATIONOFFSET add hl, bc add [hl] diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 1c88ea15f..1c73c7c8f 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -2189,7 +2189,7 @@ PokeFluteEffect: xor a ld [wPokeFluteCuredSleep], a - ld b, $ff ^ SLP + ld b, ~SLP ld hl, wPartyMon1Status call .CureSleep diff --git a/engine/link/mystery_gift.asm b/engine/link/mystery_gift.asm index 6a964396d..1bc26f6a4 100644 --- a/engine/link/mystery_gift.asm +++ b/engine/link/mystery_gift.asm @@ -14,7 +14,7 @@ MG_TIMED_OUT EQU 1 << MG_TIMED_OUT_F MG_CANCELED EQU 1 << MG_CANCELED_F MG_WRONG_PREFIX EQU 1 << MG_WRONG_PREFIX_F MG_NOT_OKAY EQU MG_WRONG_CHECKSUM | MG_TIMED_OUT | MG_CANCELED | MG_WRONG_PREFIX -MG_OKAY EQU $ff ^ MG_NOT_OKAY +MG_OKAY EQU ~MG_NOT_OKAY MG_START_END EQU %11111111 REGION_PREFIX EQU $96 diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 20dc3cdd0..82dab1046 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -472,7 +472,7 @@ SaveOptions: ld bc, wOptionsEnd - wOptions call CopyBytes ld a, [wOptions] - and $ff ^ (1 << NO_TEXT_SCROLL) + and ~(1 << NO_TEXT_SCROLL) ld [sOptions], a jp CloseSRAM diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm index 8dead3429..12f123cdd 100644 --- a/engine/menus/trainer_card.asm +++ b/engine/menus/trainer_card.asm @@ -532,7 +532,7 @@ TrainerCard_Page2_3_OAMUpdate: inc de ld a, [wTrainerCardBadgeTileID] - and $ff ^ (1 << 7) + and ~(1 << 7) add [hl] ld [de], a ; tile id inc hl diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm index b1041ed69..814e763f1 100644 --- a/engine/overworld/map_objects.asm +++ b/engine/overworld/map_objects.asm @@ -2530,7 +2530,7 @@ _SetPlayerPalette: ld hl, OBJECT_PALETTE add hl, bc ld a, [hl] - and $ff ^ PALETTE_MASK + and ~PALETTE_MASK or d ld [hl], a ret @@ -2895,7 +2895,7 @@ InitSprites: ld hl, OBJECT_SPRITE_TILE add hl, bc ld a, [hl] - and $ff ^ (1 << 7) + and ~(1 << 7) ldh [hCurSpriteTile], a xor a bit 7, [hl] diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index 05e0f95e5..b53ba3911 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -759,7 +759,7 @@ Script_musicfadeout: call GetScriptByte ld [wMusicFadeID + 1], a call GetScriptByte - and $ff ^ (1 << MUSIC_FADE_IN_F) + and ~(1 << MUSIC_FADE_IN_F) ld [wMusicFade], a ret @@ -1159,7 +1159,7 @@ Script_startbattle: call BufferScreen predef StartBattle ld a, [wBattleResult] - and $ff ^ BATTLERESULT_BITMASK + and ~BATTLERESULT_BITMASK ld [wScriptVar], a ret @@ -1175,7 +1175,7 @@ Script_reloadmapafterbattle: ld d, [hl] ld [hl], 0 ld a, [wBattleResult] - and $ff ^ BATTLERESULT_BITMASK + and ~BATTLERESULT_BITMASK cp LOSE jr nz, .notblackedout ld b, BANK(Script_BattleWhiteout) diff --git a/engine/overworld/variables.asm b/engine/overworld/variables.asm index 321665ad5..65ad1ec74 100644 --- a/engine/overworld/variables.asm +++ b/engine/overworld/variables.asm @@ -137,5 +137,5 @@ _GetVarAction:: .BattleResult: ld a, [wBattleResult] - and $ff ^ BATTLERESULT_BITMASK + and ~BATTLERESULT_BITMASK jp .loadstringbuffer2 diff --git a/engine/pokemon/stats_screen.asm b/engine/pokemon/stats_screen.asm index 932c0f72b..33e2d1195 100644 --- a/engine/pokemon/stats_screen.asm +++ b/engine/pokemon/stats_screen.asm @@ -65,12 +65,12 @@ StatsScreenMain: ; ??? ld [wStatsScreenFlags], a ld a, [wStatsScreenFlags] - and $ff ^ STAT_PAGE_MASK + and ~STAT_PAGE_MASK or PINK_PAGE ; first_page ld [wStatsScreenFlags], a .loop ld a, [wJumptableIndex] - and $ff ^ (1 << 7) + and ~(1 << 7) ld hl, StatsScreenPointerTable rst JumpTable call StatsScreen_WaitAnim @@ -85,7 +85,7 @@ StatsScreenMobile: ; ??? ld [wStatsScreenFlags], a ld a, [wStatsScreenFlags] - and $ff ^ STAT_PAGE_MASK + and ~STAT_PAGE_MASK or PINK_PAGE ; first_page ld [wStatsScreenFlags], a .loop @@ -394,7 +394,7 @@ StatsScreen_JoypadAction: .set_page ld a, [wStatsScreenFlags] - and $ff ^ STAT_PAGE_MASK + and ~STAT_PAGE_MASK or c ld [wStatsScreenFlags], a ld h, 4 diff --git a/home/lcd.asm b/home/lcd.asm index b78f1d13a..432635d51 100644 --- a/home/lcd.asm +++ b/home/lcd.asm @@ -56,7 +56,7 @@ DisableLCD:: jr nz, .wait ldh a, [rLCDC] - and $ff ^ (1 << rLCDC_ENABLE) + and ~(1 << rLCDC_ENABLE) ldh [rLCDC], a xor a diff --git a/mobile/mobile_5f.asm b/mobile/mobile_5f.asm index 75b61704d..f37f7c7f8 100644 --- a/mobile/mobile_5f.asm +++ b/mobile/mobile_5f.asm @@ -1607,7 +1607,7 @@ endr Unknown_17da94: for x, 8 - db $ff ^ (1 << x) + db ~(1 << x) endr Function17da9c: