Use ~X instead of $ff ^ X

This commit is contained in:
Rangi 2021-11-23 20:37:18 -05:00
parent ab0f9c287a
commit e706b878d9
16 changed files with 23 additions and 23 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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]

View File

@ -2189,7 +2189,7 @@ PokeFluteEffect:
xor a
ld [wPokeFluteCuredSleep], a
ld b, $ff ^ SLP
ld b, ~SLP
ld hl, wPartyMon1Status
call .CureSleep

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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]

View File

@ -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)

View File

@ -137,5 +137,5 @@ _GetVarAction::
.BattleResult:
ld a, [wBattleResult]
and $ff ^ BATTLERESULT_BITMASK
and ~BATTLERESULT_BITMASK
jp .loadstringbuffer2

View File

@ -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

View File

@ -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

View File

@ -1607,7 +1607,7 @@ endr
Unknown_17da94:
for x, 8
db $ff ^ (1 << x)
db ~(1 << x)
endr
Function17da9c: