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

@ -539,7 +539,7 @@ PlayDanger: ; e8307
ld a, [Danger]
bit DANGER_ON_F, a
ret z
and $ff - (1 << DANGER_ON_F)
and $ff ^ (1 << DANGER_ON_F)
ld d, a
call _CheckSFX
jr c, .asm_e8335
@ -2297,9 +2297,9 @@ SetNoteDuration: ; e8a8d
add hl, bc
ld a, [hl]
; multiply NoteLength by delay units
ld l, 0; just multiply
ld l, 0 ; just multiply
call .Multiply
ld a, l ; % $100
ld a, l ; low
; store Tempo in de
ld hl, Channel1Tempo - Channel1
add hl, bc
@ -2310,7 +2310,7 @@ SetNoteDuration: ; e8a8d
ld hl, Channel1Field0x16 - Channel1
add hl, bc
ld l, [hl]
; multiply Tempo by last result (NoteLength * delay % $100)
; multiply Tempo by last result (NoteLength * LOW(delay))
call .Multiply
; copy result to de
ld e, l

View File

@ -237,16 +237,16 @@ Functioncc220: ; cc220
; Appears to be unused.
xor a
ld [hBGMapMode], a
ld a, (VBGMap0 tile $28) % $100
ld a, LOW(VBGMap0 tile $28)
ld [hBGMapAddress], a
ld a, (VBGMap0 tile $28) / $100
ld a, HIGH(VBGMap0 tile $28)
ld [hBGMapAddress + 1], a
call WaitBGMap2
ld a, $60
ld [hWY], a
xor a
xor a ; LOW(VBGMap0)
ld [hBGMapAddress], a
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
call BattleAnimDelayFrame
ret
@ -1501,10 +1501,10 @@ BattleAnim_UpdateOAM_All: ; cc96e
jr nz, .loop
ld a, [wBattleAnimOAMPointerLo]
ld l, a
ld h, Sprites / $100
ld h, HIGH(Sprites)
.loop2
ld a, l
cp SpritesEnd % $100
cp LOW(SpritesEnd)
jr nc, .done
xor a
ld [hli], a

View File

@ -1223,7 +1223,7 @@ BattleBGEffect_DoubleTeam: ; c8689 (32:4689)
xor $ff
inc a
ld d, a
ld h, LYOverridesBackup / $100
ld h, HIGH(LYOverridesBackup)
ld a, [hLYOverrideStart]
ld l, a
ld a, [hLYOverrideEnd]
@ -1264,7 +1264,7 @@ BattleBGEffect_AcidArmor: ; c8709 (32:4709)
ld e, [hl]
ld d, 2
call Functionc8f2e
ld h, LYOverridesBackup / $100
ld h, HIGH(LYOverridesBackup)
ld a, [hLYOverrideEnd]
ld l, a
ld [hl], $0
@ -1275,7 +1275,7 @@ BattleBGEffect_AcidArmor: ; c8709 (32:4709)
.one
ld a, [hLYOverrideEnd]
ld l, a
ld h, LYOverridesBackup / $100
ld h, HIGH(LYOverridesBackup)
ld e, l
ld d, h
dec de
@ -1554,7 +1554,7 @@ Functionc88a5: ; c88a5 (32:48a5)
ld a, [hLYOverrideEnd]
sub d
ld d, a
ld h, LYOverridesBackup / $100
ld h, HIGH(LYOverridesBackup)
ld a, [hSCY]
or a
jr nz, .skip1
@ -1846,7 +1846,7 @@ BattleBGEffect_2a: ; c8a3a (32:4a3a)
ld [hLYOverrideEnd], a
ld a, [hLYOverrideStart]
ld l, a
ld h, LYOverridesBackup / $100
ld h, HIGH(LYOverridesBackup)
.loop
ld a, [hLYOverrideEnd]
cp l
@ -1900,7 +1900,7 @@ BattleBGEffect_2a: ; c8a3a (32:4a3a)
ld a, [hLYOverrideEnd]
sub l
srl a
ld h, LYOverridesBackup / $100
ld h, HIGH(LYOverridesBackup)
.loop2
ld [hl], e
inc hl
@ -2851,7 +2851,7 @@ BattleBGEffect_WavyScreenFX: ; c8fef (32:4fef)
ld l, a
inc a
ld e, a
ld h, LYOverridesBackup / $100
ld h, HIGH(LYOverridesBackup)
ld d, h
ld a, [hLYOverrideEnd]
sub l
@ -2874,7 +2874,7 @@ BattleBGEffect_WavyScreenFX: ; c8fef (32:4fef)
BGEffect_FillLYOverridesBackup: ; c900b (32:500b)
push af
ld h, LYOverridesBackup / $100
ld h, HIGH(LYOverridesBackup)
ld a, [hLYOverrideStart]
ld l, a
ld a, [hLYOverrideEnd]
@ -2897,7 +2897,7 @@ BGEffect_DisplaceLYOverridesBackup: ; c901b (32:501b)
sub l
sub e
ld d, a
ld h, LYOverridesBackup / $100
ld h, HIGH(LYOverridesBackup)
ld a, [hLYOverrideStart]
ld l, a
ld a, $90

View File

@ -2573,11 +2573,11 @@ WinTrainerBattle: ; 3cfa4
.CheckMaxedOutMomMoney: ; 3d0b1
ld hl, wMomsMoney + 2
ld a, [hld]
cp MAX_MONEY % $100
cp LOW(MAX_MONEY)
ld a, [hld]
sbc MAX_MONEY / $100 % $100
sbc HIGH(MAX_MONEY) ; mid
ld a, [hl]
sbc MAX_MONEY / $10000 % $100
sbc HIGH(MAX_MONEY >> 8)
ret
; 3d0be
@ -2602,17 +2602,17 @@ AddBattleMoneyToAccount: ; 3d0be
jr nz, .loop
pop hl
ld a, [hld]
cp MAX_MONEY % $100
cp LOW(MAX_MONEY)
ld a, [hld]
sbc MAX_MONEY / $100 % $100
sbc HIGH(MAX_MONEY) ; mid
ld a, [hl]
sbc MAX_MONEY / $10000 % $100
sbc HIGH(MAX_MONEY >> 8)
ret c
ld [hl], MAX_MONEY / $10000 % $100
ld [hl], HIGH(MAX_MONEY >> 8)
inc hl
ld [hl], MAX_MONEY / $100 % $100
ld [hl], HIGH(MAX_MONEY) ; mid
inc hl
ld [hl], MAX_MONEY % $100
ld [hl], LOW(MAX_MONEY)
ret
; 3d0ea
@ -6384,25 +6384,25 @@ LoadEnemyMon: ; 3e8eb
; We're clear if the length is < 1536
ld a, [wMagikarpLength]
cp $06 ; $600 = 1536
cp HIGH(1536)
jr nz, .CheckMagikarpArea
; 5% chance of skipping size checks
; 5% chance of skipping both size checks
call Random
cp $0c ; / $100
cp 5 percent
jr c, .CheckMagikarpArea
; Try again if > 1614
ld a, [wMagikarpLength + 1]
cp $50
cp LOW(1614) + 2
jr nc, .GenerateDVs
; 20% chance of skipping this check
call Random
cp $32 ; / $100
cp 20 percent - 1
jr c, .CheckMagikarpArea
; Try again if > 1598
ld a, [wMagikarpLength + 1]
cp $40
cp LOW(1598) + 2
jr nc, .GenerateDVs
.CheckMagikarpArea:
@ -6423,11 +6423,11 @@ LoadEnemyMon: ; 3e8eb
jr z, .Happiness
; 40% chance of not flooring
call Random
cp $64 ; / $100
cp 40 percent - 2
jr c, .Happiness
; Floor at length 1024
ld a, [wMagikarpLength]
cp 1024 >> 8
cp HIGH(1024)
jr c, .GenerateDVs ; try again
; Finally done with DVs
@ -6462,7 +6462,7 @@ LoadEnemyMon: ; 3e8eb
.TreeMon:
; If we're headbutting trees, some monsters enter battle asleep
call CheckSleepingTreeMon
ld a, SLP ; Asleep for 7 turns
ld a, TREEMON_SLEEP_TURNS
jr c, .UpdateStatus
; Otherwise, no status
xor a
@ -7009,14 +7009,14 @@ ApplyStatLevelMultiplier: ; 3ecb7
; Cap at 999.
ld a, [hQuotient + 2]
sub MAX_STAT_VALUE % $100
sub LOW(MAX_STAT_VALUE)
ld a, [hQuotient + 1]
sbc MAX_STAT_VALUE / $100
sbc HIGH(MAX_STAT_VALUE)
jp c, .okay3
ld a, MAX_STAT_VALUE / $100
ld a, HIGH(MAX_STAT_VALUE)
ld [hQuotient + 1], a
ld a, MAX_STAT_VALUE % $100
ld a, LOW(MAX_STAT_VALUE)
ld [hQuotient + 2], a
.okay3
@ -7132,13 +7132,13 @@ BoostStat: ; 3ed7c
; Cap at 999.
ld a, [hld]
sub MAX_STAT_VALUE % $100
sub LOW(MAX_STAT_VALUE)
ld a, [hl]
sbc MAX_STAT_VALUE / $100
sbc HIGH(MAX_STAT_VALUE)
ret c
ld a, MAX_STAT_VALUE / $100
ld a, HIGH(MAX_STAT_VALUE)
ld [hli], a
ld a, MAX_STAT_VALUE % $100
ld a, LOW(MAX_STAT_VALUE)
ld [hld], a
ret
; 3ed9f
@ -7217,7 +7217,7 @@ _BattleRandom:: ; 3edd8
ld b, 10 ; number of seeds
; Generate next number in the sequence for each seed
; The algorithm takes the form *5 + 1 % 256
; a[n+1] = (a[n] * 5 + 1) % 256
.loop
; get last #
ld a, [hl]
@ -9135,10 +9135,10 @@ AddLastMobileBattleToLinkRecord: ; 3fa42
dec hl
ld a, [hl]
inc hl
cp MAX_LINK_RECORD / $100
cp HIGH(MAX_LINK_RECORD)
ret c
ld a, [hl]
cp MAX_LINK_RECORD % $100
cp LOW(MAX_LINK_RECORD)
ret
; 3fac8

View File

@ -3576,14 +3576,14 @@ BattleCommand_DamageCalc: ; 35612
jr nz, .Cap
ld a, [hProduct + 2]
cp 998 / $100
cp HIGH(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE + 1)
jr c, .dont_cap_2
cp 998 / $100 + 1
cp HIGH(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE + 1) + 1
jr nc, .Cap
ld a, [hProduct + 3]
cp 998 % $100
cp LOW(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE + 1)
jr nc, .Cap
.dont_cap_2
@ -3601,21 +3601,21 @@ BattleCommand_DamageCalc: ; 35612
jr c, .Cap
ld a, [hl]
cp 998 / $100
cp HIGH(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE + 1)
jr c, .dont_cap_3
cp 998 / $100 + 1
cp HIGH(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE + 1) + 1
jr nc, .Cap
inc hl
ld a, [hld]
cp 998 % $100
cp LOW(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE + 1)
jr c, .dont_cap_3
.Cap:
ld a, 997 / $100
ld a, HIGH(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE)
ld [hli], a
ld a, 997 % $100
ld a, LOW(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE)
ld [hld], a
@ -3623,7 +3623,7 @@ BattleCommand_DamageCalc: ; 35612
; Minimum neutral damage is 2 (bringing the cap to 999).
inc hl
ld a, [hl]
add 2
add MIN_NEUTRAL_DAMAGE
ld [hld], a
jr nc, .dont_floor
inc [hl]
@ -5651,10 +5651,10 @@ CheckIfStatCanBeRaised: ; 361ef
.no_carry
pop bc
ld a, [hld]
sub MAX_STAT_VALUE % $100
sub LOW(MAX_STAT_VALUE)
jr nz, .not_already_max
ld a, [hl]
sbc MAX_STAT_VALUE / $100
sbc HIGH(MAX_STAT_VALUE)
jp z, .stats_already_max
.not_already_max
ld a, [hBattleTurn]
@ -6417,14 +6417,14 @@ CalcStats: ; 3661d
.check_maxed_out
ld a, [hQuotient + 2]
cp MAX_STAT_VALUE % $100
cp LOW(MAX_STAT_VALUE)
ld a, b
sbc MAX_STAT_VALUE / $100
sbc HIGH(MAX_STAT_VALUE)
jr c, .not_maxed_out
ld a, MAX_STAT_VALUE % $100
ld a, LOW(MAX_STAT_VALUE)
ld [hQuotient + 2], a
ld a, MAX_STAT_VALUE / $100
ld a, HIGH(MAX_STAT_VALUE)
ld [hQuotient + 1], a
.not_maxed_out
@ -8367,7 +8367,7 @@ BattleCommand_Heal: ; 3713e
call GetBattleVarAddr
ld a, [hl]
and a
ld [hl], REST_TURNS + 1
ld [hl], REST_SLEEP_TURNS + 1
ld hl, WentToSleepText
jr z, .no_status_to_heal
ld hl, RestedText

View File

@ -106,7 +106,7 @@ BattleAnimOAMUpdate: ; cca09
ld l, a
ld a, [wBattleAnimOAMPointerLo]
ld e, a
ld d, Sprites / $100
ld d, HIGH(Sprites)
.loop
ld a, [wBattleAnimTempYCoord]
ld b, a

View File

@ -10,8 +10,12 @@ NUM_MOVES EQU 4
BASE_STAT_LEVEL EQU 7
MAX_STAT_LEVEL EQU 13
; turns that Rest sleep lasts
REST_TURNS EQU 2
; minimum damage before type effectiveness
MIN_NEUTRAL_DAMAGE EQU 2
; turns that sleep lasts
REST_SLEEP_TURNS EQU 2
TREEMON_SLEEP_TURNS EQU 7
; PlayerStatLevels and EnemyStatLevels indexes
; used for GetStatName

View File

@ -0,0 +1,35 @@
EnvironmentColorsPointers:
; entries correspond to environment constants (see constants/map_constants.asm)
dw .OutdoorColors ; unused
dw .OutdoorColors ; TOWN
dw .OutdoorColors ; ROUTE
dw .IndoorColors ; INDOOR
dw .DungeonColors ; CAVE
dw .Env5Colors ; ENVIRONMENT_5
dw .IndoorColors ; GATE
dw .DungeonColors ; DUNGEON
; Valid indices: $00 - $29
.OutdoorColors:
db $00, $01, $02, $28, $04, $05, $06, $07 ; morn
db $08, $09, $0a, $28, $0c, $0d, $0e, $0f ; day
db $10, $11, $12, $29, $14, $15, $16, $17 ; nite
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark
.IndoorColors:
db $20, $21, $22, $23, $24, $25, $26, $07 ; morn
db $20, $21, $22, $23, $24, $25, $26, $07 ; day
db $10, $11, $12, $13, $14, $15, $16, $07 ; nite
db $18, $19, $1a, $1b, $1c, $1d, $1e, $07 ; dark
.DungeonColors:
db $00, $01, $02, $03, $04, $05, $06, $07 ; morn
db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day
db $10, $11, $12, $13, $14, $15, $16, $17 ; nite
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark
.Env5Colors:
db $00, $01, $02, $03, $04, $05, $06, $07 ; morn
db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day
db $10, $11, $12, $13, $14, $15, $16, $17 ; nite
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark

View File

@ -72,16 +72,16 @@ This is a bug with `SpeciesItemBoost` in [battle/effect_commands.asm](/battle/ef
sla l
rl h
ld a, 999 / $100
ld a, HIGH(MAX_STAT_VALUE)
cp h
jr c, .cap
ld a, 999 % $100
ld a, LOW(MAX_STAT_VALUE)
cp l
ret nc
.cap
ld h, 999 / $100
ld l, 999 % $100
ld h, HIGH(MAX_STAT_VALUE)
ld l, LOW(MAX_STAT_VALUE)
ret
```
@ -128,16 +128,16 @@ This is a bug with `DittoMetalPowder` in [battle/effect_commands.asm](/battle/ef
scf
rr c
ld a, 999 / $100
ld a, HIGH(MAX_STAT_VALUE)
cp b
jr c, .cap
ld a, 999 % $100
ld a, LOW(MAX_STAT_VALUE)
cp c
ret nc
.cap
ld b, 999 / $100
ld c, 999 % $100
ld b, HIGH(MAX_STAT_VALUE)
ld c, LOW(MAX_STAT_VALUE)
ret
```
@ -1398,7 +1398,7 @@ ClearWRAM:: ; 25a
push af
ld [rSVBK], a
xor a
ld hl, $d000
ld hl, wRAM1Start
ld bc, $1000
call ByteFill
pop af

View File

@ -719,7 +719,7 @@ EggHatch_AnimationSequence: ; 1728f (5:728f)
call PlayMusic
call EnableLCD
hlcoord 7, 4
ld b, VBGMap0 / $100
ld b, HIGH(VBGMap0)
ld c, $31 ; Egg tiles start here
ld a, EGG
call Hatch_UpdateFrontpicBGMapCenter
@ -768,7 +768,7 @@ EggHatch_AnimationSequence: ; 1728f (5:728f)
call ClearSprites
call Hatch_InitShellFragments
hlcoord 6, 3
ld b, VBGMap0 / $100
ld b, HIGH(VBGMap0)
ld c, $00 ; Hatchling tiles start here
ld a, [wJumptableIndex]
call Hatch_UpdateFrontpicBGMapCenter

View File

@ -644,10 +644,10 @@ CardFlip_BlankDiscardedCardSlot: ; e0534
ld a, e
and $1c ; get level
srl a
add .Jumptable % $100
add LOW(.Jumptable)
ld l, a
ld a, 0
adc .Jumptable / $100
adc HIGH(.Jumptable)
ld h, a
ld a, [hli]
ld h, [hl]
@ -1185,14 +1185,14 @@ CardFlip_CheckWinCondition: ; e0637
.IsCoinCaseFull: ; e0833
ld a, [Coins]
cp MAX_COINS / $100
cp HIGH(MAX_COINS)
jr c, .less
jr z, .check_low
jr .more
.check_low
ld a, [Coins + 1]
cp MAX_COINS % $100
cp LOW(MAX_COINS)
jr c, .less
.more

View File

@ -523,10 +523,10 @@ LoadPalette_White_Col1_Col2_Black:
ld a, $5
ld [rSVBK], a
ld a, (palred 31 + palgreen 31 + palblue 31) % $100
ld a, LOW(palred 31 + palgreen 31 + palblue 31)
ld [de], a
inc de
ld a, (palred 31 + palgreen 31 + palblue 31) / $100
ld a, HIGH(palred 31 + palgreen 31 + palblue 31)
ld [de], a
inc de
@ -912,9 +912,9 @@ InitCGBPals::
ld [rBGPI], a
ld c, 4 * 8
.bgpals_loop
ld a, (palred 31 + palgreen 31 + palblue 31) % $100
ld a, LOW(palred 31 + palgreen 31 + palblue 31)
ld [rBGPD], a
ld a, (palred 31 + palgreen 31 + palblue 31) / $100
ld a, HIGH(palred 31 + palgreen 31 + palblue 31)
ld [rBGPD], a
dec c
jr nz, .bgpals_loop
@ -922,9 +922,9 @@ InitCGBPals::
ld [rOBPI], a
ld c, 4 * 8
.obpals_loop
ld a, (palred 31 + palgreen 31 + palblue 31) % $100
ld a, LOW(palred 31 + palgreen 31 + palblue 31)
ld [rOBPD], a
ld a, (palred 31 + palgreen 31 + palblue 31) / $100
ld a, HIGH(palred 31 + palgreen 31 + palblue 31)
ld [rOBPD], a
dec c
jr nz, .obpals_loop
@ -943,9 +943,9 @@ InitCGBPals::
.LoadWhitePals:
ld c, 4 * 16
.loop
ld a, (palred 31 + palgreen 31 + palblue 31) % $100
ld a, LOW(palred 31 + palgreen 31 + palblue 31)
ld [hli], a
ld a, (palred 31 + palgreen 31 + palblue 31) / $100
ld a, HIGH(palred 31 + palgreen 31 + palblue 31)
ld [hli], a
dec c
jr nz, .loop
@ -1070,7 +1070,7 @@ SGBBorder_PushBGPals:
ld [rBGP], a
ld hl, PredefPals
ld de, VTiles1
ld bc, $1000
ld bc, $100 tiles
call CopyData
call DrawDefaultTiles
ld a, $e3

View File

@ -193,9 +193,9 @@ Credits_UpdateGFXRequestPath: ; 109964 (42:5964)
ld [Requested2bppSource], a
ld a, h
ld [Requested2bppSource + 1], a
ld a, VTiles2 % $100
ld a, LOW(VTiles2)
ld [Requested2bppDest], a
ld a, VTiles2 / $100
ld a, HIGH(VTiles2)
ld [Requested2bppDest + 1], a
jr Credits_RequestGFX
@ -374,9 +374,9 @@ ParseCredits: ; 1099aa
set 7, [hl]
ld a, 32
ld [MusicFade], a
ld a, MUSIC_POST_CREDITS % $100
ld a, LOW(MUSIC_POST_CREDITS)
ld [MusicFadeID], a
ld a, MUSIC_POST_CREDITS / $100
ld a, HIGH(MUSIC_POST_CREDITS)
ld [MusicFadeID + 1], a
ret
@ -523,20 +523,20 @@ GetCreditsPalette: ; 109b2c
; Update the first three colors in both palette buffers.
push af
push hl
add UnknBGPals % $100
add LOW(UnknBGPals)
ld e, a
ld a, 0
adc UnknBGPals / $100
adc HIGH(UnknBGPals)
ld d, a
ld bc, 24
call CopyBytes
pop hl
pop af
add BGPals % $100
add LOW(BGPals)
ld e, a
ld a, 0
adc BGPals / $100
adc HIGH(BGPals)
ld d, a
ld bc, 24
call CopyBytes

View File

@ -3,9 +3,9 @@ Copyright_GFPresents: ; e4579
call PlayMusic
call ClearBGPalettes
call ClearTileMap
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
xor a
xor a ; LOW(VBGMap0)
ld [hBGMapAddress], a
ld [hJoyDown], a
ld [hSCX], a
@ -1922,9 +1922,9 @@ Intro_RustleGrass: ; e546d (39:546d)
ld [Requested2bppSource], a
ld a, [hli]
ld [Requested2bppSource + 1], a
ld a, (VTiles2 tile $09) % $100
ld a, LOW(VTiles2 tile $09)
ld [Requested2bppDest], a
ld a, (VTiles2 tile $09) / $100
ld a, HIGH(VTiles2 tile $09)
ld [Requested2bppDest + 1], a
ld a, 4
ld [Requested2bppSize], a

View File

@ -1069,7 +1069,7 @@ TilesetColorTest:
ld hl, VTiles1
lb bc, BANK(DebugColorTestGFX), 1
call Request2bpp
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT

View File

@ -300,7 +300,7 @@ DoBikeStep:: ; 97db3
; If we've taken at least 1024 steps, have the bike
; shop owner try to call us.
ld a, d
cp 1024 >> 8
cp HIGH(1024)
jr c, .NoCall
; If a call has already been queued, don't overwrite

View File

@ -6,7 +6,7 @@ CalcLevel: ; 50e1b
.next_level
inc d
ld a, d
cp (MAX_LEVEL + 1) % $100
cp MAX_LEVEL + 1
jr z, .got_level
call CalcExpAtLevel
push hl

View File

@ -46,9 +46,9 @@ InitDisplayForRedCredits: ; 4e8c2
ld hl, UnknBGPals
ld c, 4 tiles
.load_white_palettes
ld a, (palred 31 + palgreen 31 + palblue 31) % $100
ld a, LOW(palred 31 + palgreen 31 + palblue 31)
ld [hli], a
ld a, (palred 31 + palgreen 31 + palblue 31) / $100
ld a, HIGH(palred 31 + palgreen 31 + palblue 31)
ld [hli], a
dec c
jr nz, .load_white_palettes

View File

@ -27,7 +27,7 @@ ReanchorBGMap_NoOAMUpdate:: ; 6454
ld a, $90
ld [hWY], a
call OverworldTextModeSwitch
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
call .LoadBGMapAddrIntoHRAM
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
farcall LoadOW_BGPal7
@ -38,11 +38,11 @@ ReanchorBGMap_NoOAMUpdate:: ; 6454
ld [hBGMapMode], a
ld [hWY], a
farcall HDMATransfer_FillBGMap0WithBlack ; no need to farcall
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
call .LoadBGMapAddrIntoHRAM
xor a
xor a ; LOW(VBGMap0)
ld [wBGMapAnchor], a
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [wBGMapAnchor + 1], a
xor a
ld [hSCX], a
@ -86,13 +86,13 @@ HDMATransfer_FillBGMap0WithBlack: ; 64db
ld hl, wDecompressScratch
ld bc, wScratchAttrMap - wDecompressScratch
call ByteFill
ld a, wDecompressScratch / $100
ld a, HIGH(wDecompressScratch)
ld [rHDMA1], a
ld a, wDecompressScratch % $100
ld a, LOW(wDecompressScratch)
ld [rHDMA2], a
ld a, (VBGMap0 % $8000) / $100
ld a, HIGH(VBGMap0 % $8000)
ld [rHDMA3], a
ld a, (VBGMap0 % $8000) % $100
ld a, LOW(VBGMap0 % $8000)
ld [rHDMA4], a
ld a, $3f
ld [hDMATransfer], a

View File

@ -199,24 +199,24 @@ _ResetWRAM: ; 5bae
ld [Coins], a
ld [Coins + 1], a
IF START_MONEY / $10000
ld a, START_MONEY / $10000
IF START_MONEY >= $10000
ld a, HIGH(START_MONEY >> 8)
ENDC
ld [Money], a
ld a, START_MONEY / $100 % $100
ld a, HIGH(START_MONEY) ; mid
ld [Money + 1], a
ld a, START_MONEY % $100
ld a, LOW(START_MONEY)
ld [Money + 2], a
xor a
ld [wWhichMomItem], a
ld hl, MomItemTriggerBalance
ld [hl], MOM_MONEY / $10000
ld [hl], HIGH(MOM_MONEY >> 8)
inc hl
ld [hl], MOM_MONEY / $100 % $100
ld [hl], HIGH(MOM_MONEY) ; mid
inc hl
ld [hl], MOM_MONEY % $100
ld [hl], LOW(MOM_MONEY)
call InitializeNPCNames
@ -372,9 +372,9 @@ Continue: ; 5d65
.Check2Pass:
ld a, $8
ld [MusicFade], a
ld a, MUSIC_NONE % $100
ld a, LOW(MUSIC_NONE)
ld [MusicFadeID], a
ld a, MUSIC_NONE / $100
ld a, HIGH(MUSIC_NONE)
ld [MusicFadeID + 1], a
call ClearBGPalettes
call Continue_MobileAdapterMenu
@ -426,9 +426,9 @@ Continue_MobileAdapterMenu: ; 5df0
ret nz
ld a, 5
ld [MusicFade], a
ld a, MUSIC_MOBILE_ADAPTER_MENU % $100
ld a, LOW(MUSIC_MOBILE_ADAPTER_MENU)
ld [MusicFadeID], a
ld a, MUSIC_MOBILE_ADAPTER_MENU / $100
ld a, HIGH(MUSIC_MOBILE_ADAPTER_MENU)
ld [MusicFadeID + 1], a
ld c, 20
call DelayFrames
@ -437,9 +437,9 @@ Continue_MobileAdapterMenu: ; 5df0
farcall _SaveData
ld a, 8
ld [MusicFade], a
ld a, MUSIC_NONE % $100
ld a, LOW(MUSIC_NONE)
ld [MusicFadeID], a
ld a, MUSIC_NONE / $100
ld a, HIGH(MUSIC_NONE)
ld [MusicFadeID + 1], a
ld c, 35
call DelayFrames
@ -1405,9 +1405,9 @@ GameInit:: ; 642e
call ClearWindowData
call ClearBGPalettes
call ClearTileMap
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
xor a
xor a ; LOW(VBGMap0)
ld [hBGMapAddress], a
ld [hJoyDown], a
ld [hSCX], a

View File

@ -861,7 +861,7 @@ HeavyBallMultiplier:
.compare
ld c, a
cp 1024 >> 8 ; 102.4 kg
cp HIGH(1024) ; 102.4 kg
jr c, .lightmon
ld hl, .WeightsTable
@ -892,10 +892,10 @@ HeavyBallMultiplier:
.WeightsTable:
; weight factor, boost
db 2048 >> 8, 0
db 3072 >> 8, 20
db 4096 >> 8, 30
db 65280 >> 8, 40
db HIGH(2048), 0
db HIGH(3072), 20
db HIGH(4096), 30
db HIGH(65280), 40
LureBallMultiplier:
; multiply catch rate by 3 if this is a fishing rod battle

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

View File

@ -162,9 +162,9 @@ TimeCapsule: ; 2805d
ld [de], a
ld hl, wTimeCapsulePartyMon1Species
call Function2868a
ld a, OTPartyMonOT % $100
ld a, LOW(OTPartyMonOT)
ld [wUnusedD102], a
ld a, OTPartyMonOT / $100
ld a, HIGH(OTPartyMonOT)
ld [wUnusedD102 + 1], a
ld de, MUSIC_NONE
call PlayMusic
@ -333,10 +333,10 @@ Gen2ToGen2LinkComms: ; 28177
push bc
ld bc, MAIL_MSG_LENGTH + 1
call CopyBytes
ld a, (MAIL_STRUCT_LENGTH - (MAIL_MSG_LENGTH + 1)) % $100
ld a, LOW(MAIL_STRUCT_LENGTH - (MAIL_MSG_LENGTH + 1))
add e
ld e, a
ld a, (MAIL_STRUCT_LENGTH - (MAIL_MSG_LENGTH + 1)) / $100
ld a, HIGH(MAIL_STRUCT_LENGTH - (MAIL_MSG_LENGTH + 1))
adc d
ld d, a
pop bc
@ -346,10 +346,10 @@ Gen2ToGen2LinkComms: ; 28177
ld b, PARTY_LENGTH
.copy_author_loop
push bc
ld a, (MAIL_MSG_LENGTH + 1) % $100
ld a, LOW(MAIL_MSG_LENGTH + 1)
add e
ld e, a
ld a, (MAIL_MSG_LENGTH + 1) / $100
ld a, HIGH(MAIL_MSG_LENGTH + 1)
adc d
ld d, a
ld bc, MAIL_STRUCT_LENGTH - (MAIL_MSG_LENGTH + 1)
@ -403,9 +403,9 @@ Gen2ToGen2LinkComms: ; 28177
ld de, OTPartyMons
ld bc, OTPartyDataEnd - OTPartyMons
call CopyBytes
ld a, OTPartyMonOT % $100
ld a, LOW(OTPartyMonOT)
ld [wUnusedD102], a
ld a, OTPartyMonOT / $100
ld a, HIGH(OTPartyMonOT)
ld [wUnusedD102 + 1], a
ld de, MUSIC_NONE
call PlayMusic

View File

@ -2812,7 +2812,7 @@ _UpdateSprites:: ; 5920
.fill
ld a, [VramState]
bit 1, a
ld b, SpritesEnd % $100
ld b, LOW(SpritesEnd)
jr z, .ok
ld b, 28 * 4
.ok
@ -2820,7 +2820,7 @@ _UpdateSprites:: ; 5920
cp b
ret nc
ld l, a
ld h, Sprites / $100
ld h, HIGH(Sprites)
ld de, 4
ld a, b
ld c, SCREEN_HEIGHT_PX + 16
@ -3032,11 +3032,11 @@ PRIORITY_HIGH EQU $30
ld l, a
ld a, [hUsedSpriteIndex]
ld c, a
ld b, Sprites / $100
ld b, HIGH(Sprites)
ld a, [hli]
ld [hUsedSpriteTile], a
add c
cp SpritesEnd % $100
cp LOW(SpritesEnd)
jr nc, .full
.addsprite
ld a, [hFFC0]

View File

@ -1570,18 +1570,18 @@ CalcPkmnStatC: ; e17b
.no_overflow_4
ld a, [hQuotient + 1]
cp (1000 / $100) + 1
cp HIGH(MAX_STAT_VALUE + 1) + 1
jr nc, .max_stat
cp 1000 / $100
cp HIGH(MAX_STAT_VALUE + 1)
jr c, .stat_value_okay
ld a, [hQuotient + 2]
cp 1000 % $100
cp LOW(MAX_STAT_VALUE + 1)
jr c, .stat_value_okay
.max_stat
ld a, MAX_STAT_VALUE / $100
ld a, HIGH(MAX_STAT_VALUE)
ld [hMultiplicand + 1], a
ld a, MAX_STAT_VALUE % $100
ld a, LOW(MAX_STAT_VALUE)
ld [hMultiplicand + 2], a
.stat_value_okay
@ -1702,9 +1702,9 @@ GivePoke:: ; e277
ld hl, PartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, 01001 / $100
ld a, HIGH(01001)
ld [hli], a
ld [hl], 01001 % $100
ld [hl], LOW(01001)
pop bc
farcall SetGiftPartyMonCaughtData
jr .skip_nickname

View File

@ -264,7 +264,7 @@ Function104a95: ; 104a95 (41:4a95)
ld a, [rLY]
cp $90
jr c, .ly_loop
ld c, rRP % $100
ld c, LOW(rRP)
ld a, $c0
ld [$ff00+c], a
ld b, 240 ; This might have been intended as a 4-second timeout buffer.
@ -274,7 +274,7 @@ Function104a95: ; 104a95 (41:4a95)
call MysteryGift_ReadJoypad
ld b, $2
ld c, rRP % $100
ld c, LOW(rRP)
; Delay frame
.ly_loop2
ld a, [$ff00+c]
@ -715,7 +715,7 @@ Function104ddd: ; 104ddd (41:4ddd)
.loop
call MysteryGift_ReadJoypad
ld b, $2
ld c, rRP % $100
ld c, LOW(rRP)
ld a, [hMGJoypadReleased]
bit B_BUTTON_F, a
jr z, .next
@ -731,7 +731,7 @@ Function104ddd: ; 104ddd (41:4ddd)
jr nz, .loop
Function104dfe: ; 104dfe (41:4dfe)
ld c, rRP % $100
ld c, LOW(rRP)
ld d, $0
ld e, d
call Function104db7
@ -771,7 +771,7 @@ Function104e3a: ; 104e3a (41:4e3a)
Function104e46: ; 104e46 (41:4e46)
ld a, $2
ld [hPrintNum9], a
ld c, rRP % $100
ld c, LOW(rRP)
ld d, $0
ld e, d
ld d, $3d
@ -812,7 +812,7 @@ Function104e93: ; 104e93 (41:4e93)
ld [hPrintNum6], a
push hl
push bc
ld c, rRP % $100
ld c, LOW(rRP)
ld d, $3d
call Function104dd1
ld hl, hPrintNum2
@ -844,7 +844,7 @@ Function104e93: ; 104e93 (41:4e93)
ret
Function104ed6: ; 104ed6 (41:4ed6)
ld c, rRP % $100
ld c, LOW(rRP)
ld d, $5
call Function104dd1
ld d, $5
@ -981,7 +981,7 @@ Function104f57: ; 104f57 (41:4f57)
ret
Function104faf: ; 104faf (41:4faf)
ld c, rRP % $100
ld c, LOW(rRP)
ld d, $0
call Function104db7
jp z, Function104f42

View File

@ -235,10 +235,10 @@ NamingScreen: ; 116c1
pop de
ld b, SPRITE_ANIM_INDEX_RED_WALK
ld a, d
cp KrisSpriteGFX / $100
cp HIGH(KrisSpriteGFX)
jr nz, .not_kris
ld a, e
cp KrisSpriteGFX % $100
cp LOW(KrisSpriteGFX)
jr nz, .not_kris
ld b, SPRITE_ANIM_INDEX_BLUE_WALK
.not_kris

View File

@ -15,10 +15,10 @@ GiveOddEgg: ; 1fb4b6
; Break on $ffff.
ld a, d
cp $ffff / $100
cp HIGH($ffff)
jr nz, .not_done
ld a, e
cp $ffff % $100
cp LOW($ffff)
jr z, .done
.not_done
@ -60,14 +60,14 @@ GiveOddEgg: ; 1fb4b6
ld [wMobileMonSpeciesBuffer], a
; load pointer to (wMobileMonSpeciesBuffer - 1) in wMobileMonSpeciesPointerBuffer
ld a, (wMobileMonSpeciesBuffer - 1) % $100
ld a, LOW(wMobileMonSpeciesBuffer - 1)
ld [wMobileMonSpeciesPointerBuffer], a
ld a, (wMobileMonSpeciesBuffer - 1) / $100
ld a, HIGH(wMobileMonSpeciesBuffer - 1)
ld [wMobileMonSpeciesPointerBuffer + 1], a
; load pointer to OddEggSpecies in wMobileMonStructurePointerBuffer
ld a, OddEggSpecies % $100
ld a, LOW(OddEggSpecies)
ld [wMobileMonStructurePointerBuffer], a
ld a, OddEggSpecies / $100
ld a, HIGH(OddEggSpecies)
ld [wMobileMonStructurePointerBuffer + 1], a
; load Odd Egg Name in wTempOddEggNickname
@ -77,14 +77,14 @@ GiveOddEgg: ; 1fb4b6
call CopyBytes
; load pointer to wTempOddEggNickname in wMobileMonOTNamePointerBuffer
ld a, wTempOddEggNickname % $100
ld a, LOW(wTempOddEggNickname)
ld [wMobileMonOTNamePointerBuffer], a
ld a, wTempOddEggNickname / $100
ld a, HIGH(wTempOddEggNickname)
ld [wMobileMonOTNamePointerBuffer + 1], a
; load pointer to wOddEggName in wMobileMonNicknamePointerBuffer
ld a, wOddEggName % $100
ld a, LOW(wOddEggName)
ld [wMobileMonNicknamePointerBuffer], a
ld a, wOddEggName / $100
ld a, HIGH(wOddEggName)
ld [wMobileMonNicknamePointerBuffer + 1], a
farcall AddMobileMonToParty
ret

View File

@ -663,10 +663,10 @@ rept 4
add hl, hl
endr
ld a, l
add VTiles0 % $100
add LOW(VTiles0)
ld l, a
ld a, h
adc VTiles0 / $100
adc HIGH(VTiles0)
ld h, a
ret
; 14418

View File

@ -587,10 +587,10 @@ PlacePartyMonMobileBattleSelection: ; 50307
PartyMenuCheckEgg: ; 50389
ld a, PartySpecies % $100
ld a, LOW(PartySpecies)
add b
ld e, a
ld a, PartySpecies / $100
ld a, HIGH(PartySpecies)
adc 0
ld d, a
ld a, [de]

View File

@ -156,7 +156,7 @@ UpdateOverworldMap: ; d536 (3:5536)
ld a, [wBGMapAnchor + 1]
inc a
and $3
or VBGMap0 / $100
or HIGH(VBGMap0)
ld [wBGMapAnchor + 1], a
.not_overflowed
ld hl, wMetatileStandingY
@ -187,7 +187,7 @@ UpdateOverworldMap: ; d536 (3:5536)
ld a, [wBGMapAnchor + 1]
dec a
and $3
or VBGMap0 / $100
or HIGH(VBGMap0)
ld [wBGMapAnchor + 1], a
.not_underflowed
ld hl, wMetatileStandingY

View File

@ -35,9 +35,9 @@ PokeGear: ; 90b8d (24:4b8d)
pop af
ld [Options], a
call ClearBGPalettes
xor a
xor a ; LOW(VBGMap0)
ld [hBGMapAddress], a
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
ld a, $90
ld [hWY], a
@ -243,18 +243,18 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
ld a, [wcf65]
and a
jr nz, .kanto_0
xor a
xor a ; LOW(VBGMap0)
ld [hBGMapAddress], a
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
call .UpdateBGMap
ld a, $90
jr .finish
.kanto_0
xor a
xor a ; LOW(VBGMap1)
ld [hBGMapAddress], a
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
call .UpdateBGMap
xor a
@ -2161,9 +2161,9 @@ _FlyMap: ; 91af3
call ClearBGPalettes
ld a, $90
ld [hWY], a
xor a
xor a ; LOW(VBGMap0)
ld [hBGMapAddress], a
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
ld a, [wTownMapPlayerIconLandmark]
ld e, a
@ -3003,9 +3003,9 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
call ClearBGPalettes
ld a, $90
ld [hWY], a
xor a
xor a ; LOW(VBGMap0)
ld [hBGMapAddress], a
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
ld a, [wTownMapPlayerIconLandmark]
ld e, a

View File

@ -109,9 +109,9 @@ Printer_StartTransmittingTilemap: ; 84099 (21:4099)
call Printer_CopyPacket
; prepare to send 40 tiles
call Printer_Convert2RowsTo2bpp
ld a, (40 tiles) % $100
ld a, LOW(40 tiles)
ld [wPrinterSendByteCounter], a
ld a, (40 tiles) / $100
ld a, HIGH(40 tiles)
ld [wPrinterSendByteCounter + 1], a
; compute the checksum
call Printer_ComputeChecksum
@ -142,9 +142,9 @@ Printer_SignalSendHeader: ; 840de (21:40de)
call Printer_CopyPacket
; prepare to send 1 tile
call Printer_StageHeaderForSend
ld a, 4 % $100
ld a, LOW(4)
ld [wPrinterSendByteCounter], a
ld a, 4 / $100
ld a, HIGH(4)
ld [wPrinterSendByteCounter + 1], a
; compute the checksum
call Printer_ComputeChecksum

View File

@ -80,51 +80,51 @@ _PrintNum:: ; c4c7
jr z, .six
.seven
ld a, 1000000 / $10000 % $100
ld a, HIGH(1000000 >> 8)
ld [hPrintNum5], a
ld a, 1000000 / $100 % $100
ld a, HIGH(1000000) ; mid
ld [hPrintNum6], a
ld a, 1000000 % $100
ld a, LOW(1000000)
ld [hPrintNum7], a
call .PrintDigit
call .AdvancePointer
.six
ld a, 100000 / $10000 % $100
ld a, HIGH(100000 >> 8)
ld [hPrintNum5], a
ld a, 100000 / $100 % $100
ld a, HIGH(100000) ; mid
ld [hPrintNum6], a
ld a, 100000 % $100
ld a, LOW(100000)
ld [hPrintNum7], a
call .PrintDigit
call .AdvancePointer
.five
xor a
xor a ; HIGH(10000 >> 8)
ld [hPrintNum5], a
ld a, 10000 / $100
ld a, HIGH(10000) ; mid
ld [hPrintNum6], a
ld a, 10000 % $100
ld a, LOW(10000)
ld [hPrintNum7], a
call .PrintDigit
call .AdvancePointer
.four
xor a
xor a ; HIGH(1000 >> 8)
ld [hPrintNum5], a
ld a, 1000 / $100
ld a, HIGH(1000) ; mid
ld [hPrintNum6], a
ld a, 1000 % $100
ld a, LOW(1000)
ld [hPrintNum7], a
call .PrintDigit
call .AdvancePointer
.three
xor a
xor a ; HIGH(100 >> 8)
ld [hPrintNum5], a
xor a
xor a ; HIGH(100) ; mid
ld [hPrintNum6], a
ld a, 100
ld a, LOW(100)
ld [hPrintNum7], a
call .PrintDigit
call .AdvancePointer

View File

@ -11,7 +11,7 @@ LoadPushOAM:: ; 4031
ret
.PushOAM: ; 403f
ld a, Sprites / $100
ld a, HIGH(Sprites)
ld [rDMA], a
ld a, (SpritesEnd - Sprites) / 4 ; 40
.pushoam_loop

View File

@ -50,7 +50,7 @@ PhoneRing_CopyTilemapAtOnce: ; 4d188
ld a, SCREEN_HEIGHT
ld [hTilesPerCycle], a
ld b, 1 << 1 ; not in v/hblank
ld c, rSTAT % $100
ld c, LOW(rSTAT)
.loop
rept SCREEN_WIDTH / 2

View File

@ -47,7 +47,7 @@ SaveMenu_CopyTilemapAtOnce: ; 4cf45 (13:4f45)
ld a, SCREEN_HEIGHT
ld [hTilesPerCycle], a
ld b, 1 << 1
ld c, rSTAT % $100
ld c, LOW(rSTAT)
.loop
rept SCREEN_WIDTH / 2

View File

@ -471,10 +471,10 @@ Slots_LoadReelState: ; 929f6 (24:69f6)
Slot_CheckCoinCaseFull: ; 92a04 (24:6a04)
ld a, d
cp MAX_COINS / $100
cp HIGH(MAX_COINS)
jr c, .not_full
ld a, e
cp MAX_COINS % $100
cp LOW(MAX_COINS)
jr c, .not_full
scf
ret
@ -771,10 +771,10 @@ Function92bbe: ; 92bbe
push hl
srl a
srl a
add .Unknown_92bce % $100
add LOW(.Unknown_92bce)
ld l, a
ld a, 0
adc .Unknown_92bce / $100
adc HIGH(.Unknown_92bce)
ld h, a
ld a, [hl]
pop hl

View File

@ -617,9 +617,9 @@ SpecialGameboyCheck: ; c478
Special_FadeOutMusic: ; c48f
ld a, MUSIC_NONE % $100
ld a, LOW(MUSIC_NONE)
ld [MusicFadeID], a
ld a, MUSIC_NONE / $100
ld a, HIGH(MUSIC_NONE)
ld [MusicFadeID + 1], a
ld a, $2
ld [MusicFade], a

View File

@ -23,7 +23,7 @@ PlaySpriteAnimations: ; 8cf69
push bc
push af
ld a, Sprites % $100
ld a, LOW(Sprites)
ld [wCurrSpriteOAMAddr], a
call DoNextFrameForAllSprites
@ -60,11 +60,11 @@ DoNextFrameForAllSprites: ; 8cf7a
ld a, [wCurrSpriteOAMAddr]
ld l, a
ld h, Sprites / $100
ld h, HIGH(Sprites)
.loop2 ; Clear (Sprites + [wCurrSpriteOAMAddr] --> SpritesEnd)
ld a, l
cp SpritesEnd % $100
cp LOW(SpritesEnd)
jr nc, .done
xor a
ld [hli], a
@ -100,11 +100,11 @@ DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8)
ld a, [wCurrSpriteOAMAddr]
ld l, a
ld h, (Sprites + $40) / $100
ld h, HIGH(Sprites + 16 * 4)
.loop2 ; Clear (Sprites + [wCurrSpriteOAMAddr] --> Sprites + $40)
ld a, l
cp (Sprites + 16 * 4) % $100
cp LOW(Sprites + 16 * 4)
jr nc, .done
xor a
ld [hli], a
@ -253,7 +253,7 @@ UpdateAnimFrame: ; 8d04c
push bc
ld a, [wCurrSpriteOAMAddr]
ld e, a
ld d, Sprites / $100
ld d, HIGH(Sprites)
ld a, [hli]
ld c, a ; number of objects
.loop
@ -302,7 +302,7 @@ UpdateAnimFrame: ; 8d04c
inc de
ld a, e
ld [wCurrSpriteOAMAddr], a
cp SpritesEnd % $100
cp LOW(SpritesEnd)
jr nc, .reached_the_end
dec c
jr nz, .loop

View File

@ -191,7 +191,7 @@ ClearBattleRAM: ; 2ef18
call ClearWindowData
ld hl, hBGMapAddress
xor a
xor a ; LOW(VBGMap0)
ld [hli], a
ld [hl], VBGMap0 / $100
ld [hl], HIGH(VBGMap0)
ret

View File

@ -9,9 +9,9 @@ InitClock: ; 90672 (24:4672)
ld [wSpriteUpdatesEnabled], a
ld a, $10
ld [MusicFade], a
ld a, MUSIC_NONE % $100
ld a, LOW(MUSIC_NONE)
ld [MusicFadeID], a
ld a, MUSIC_NONE / $100
ld a, HIGH(MUSIC_NONE)
ld [MusicFadeID + 1], a
ld c, 8
call DelayFrames

View File

@ -627,7 +627,7 @@ TradeAnim_PlaceTrademonStatsOnTubeAnim: ; 292f6
push af
call ClearBGPalettes
call WaitTop
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
call ClearTileMap
hlcoord 0, 0
@ -657,7 +657,7 @@ TradeAnim_PlaceTrademonStatsOnTubeAnim: ; 292f6
call ByteFill
call WaitBGMap
call WaitTop
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
call ClearTileMap
ret
@ -776,7 +776,7 @@ TradeAnim_TextboxScrollStart: ; 293de
TradeAnim_ScrollOutRight: ; 293ea
call WaitTop
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
call WaitBGMap
ld a, $7
@ -785,7 +785,7 @@ TradeAnim_ScrollOutRight: ; 293ea
ld [hWY], a
call DelayFrame
call WaitTop
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
call ClearTileMap
call TradeAnim_IncrementJumptableIndex
@ -802,14 +802,14 @@ TradeAnim_ScrollOutRight2: ; 2940c
ret
.done
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
call WaitBGMap
ld a, $7
ld [hWX], a
ld a, $90
ld [hWY], a
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
call TradeAnim_AdvanceScriptPointer
ret
@ -1009,7 +1009,7 @@ ShowOTTrademonStats: ; 29549
TrademonStats_MonTemplate: ; 29573
call WaitTop
call TradeAnim_BlankTileMap
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 3, 0
ld b, $6
@ -1032,7 +1032,7 @@ TrademonStats_MonTemplate: ; 29573
TrademonStats_Egg: ; 295a1
call WaitTop
call TradeAnim_BlankTileMap
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 3, 0
ld b, 6
@ -1055,7 +1055,7 @@ TrademonStats_Egg: ; 295a1
TrademonStats_WaitBGMap: ; 295d8
call WaitBGMap
call WaitTop
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
ret

View File

@ -233,9 +233,9 @@ LoadMapTimeOfDay: ; 104750
ret
.ClearBGMap: ; 104770 (41:4770)
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [wBGMapAnchor + 1], a
xor a
xor a ; LOW(VBGMap0)
ld [wBGMapAnchor], a
ld [hSCY], a
ld [hSCX], a

View File

@ -36,9 +36,9 @@ HallOfFame:: ; 0x8640e
; 0x86455
RedCredits:: ; 86455
ld a, MUSIC_NONE % $100
ld a, LOW(MUSIC_NONE)
ld [MusicFadeID], a
ld a, MUSIC_NONE / $100
ld a, HIGH(MUSIC_NONE)
ld [MusicFadeID + 1], a
ld a, 10
ld [MusicFade], a
@ -59,9 +59,9 @@ RedCredits:: ; 86455
; 8648e
HallOfFame_FadeOutMusic: ; 8648e
ld a, MUSIC_NONE % $100
ld a, LOW(MUSIC_NONE)
ld [MusicFadeID], a
ld a, MUSIC_NONE / $100
ld a, HIGH(MUSIC_NONE)
ld [MusicFadeID + 1], a
ld a, 10
ld [MusicFade], a

View File

@ -159,9 +159,9 @@ DayCareStep:: ; 7282
dec hl
inc [hl]
ld a, [hl]
cp 5242880 / $10000
cp HIGH($500000 >> 8)
jr c, .day_care_lady
ld a, 5242880 / $10000
ld a, HIGH($500000 >> 8)
ld [hl], a
.day_care_lady
@ -181,9 +181,9 @@ DayCareStep:: ; 7282
dec hl
inc [hl]
ld a, [hl]
cp 5242880 / $10000
cp HIGH($500000 >> 8)
jr c, .check_egg
ld a, 5242880 / $10000
ld a, HIGH($500000 >> 8)
ld [hl], a
.check_egg

View File

@ -127,7 +127,7 @@ CalcMagikarpLength: ; fbbfc
; if bc < 10: [wMagikarpLength] = c + 190
; if bc ≥ $ff00: [wMagikarpLength] = c + 1370
; else: [wMagikarpLength] = z × 100 + (bc x) / y
; else: [wMagikarpLength] = z * 100 + (bc - x) / y
; X, Y, and Z depend on the value of b as follows:

View File

@ -83,11 +83,11 @@ CheckBalance_MomItem2: ; fd044
.check_have_2300
ld hl, hMoneyTemp
ld [hl], MOM_MONEY / $10000
ld [hl], HIGH(MOM_MONEY >> 8)
inc hl
ld [hl], MOM_MONEY / $100 % $100
ld [hl], HIGH(MOM_MONEY) ; mid
inc hl
ld [hl], MOM_MONEY % $100
ld [hl], LOW(MOM_MONEY)
.loop
ld de, MomItemTriggerBalance
ld bc, wMomsMoney

View File

@ -32,9 +32,9 @@ LoadPoisonBGPals: ; cbcdd
ld c, $20
.loop
; RGB 28, 21, 31
ld a, (palred 28 + palgreen 21 + palblue 31) % $100
ld a, LOW(palred 28 + palgreen 21 + palblue 31)
ld [hli], a
ld a, (palred 28 + palgreen 21 + palblue 31) / $100
ld a, HIGH(palred 28 + palgreen 21 + palblue 31)
ld [hli], a
dec c
jr nz, .loop

View File

@ -85,10 +85,10 @@ SpecialReturnShuckle: ; 737e
; OT ID
ld a, [hli]
cp 00518 / $100
cp HIGH(00518)
jr nz, .DontReturn
ld a, [hl]
cp 00518 % $100
cp LOW(00518)
jr nz, .DontReturn
; OT

View File

@ -59,10 +59,10 @@ SpecialAerodactylChamber: ; 8ae30
call GetSecondaryMapHeaderPointer
ld a, h
cp RuinsOfAlphAerodactylChamber_SecondMapHeader / $100
cp HIGH(RuinsOfAlphAerodactylChamber_SecondMapHeader)
jr nz, .nope
ld a, l
cp RuinsOfAlphAerodactylChamber_SecondMapHeader % $100
cp LOW(RuinsOfAlphAerodactylChamber_SecondMapHeader)
jr nz, .nope
ld de, EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
@ -87,10 +87,10 @@ SpecialKabutoChamber: ; 8ae4e
call GetSecondaryMapHeaderPointer
ld a, h
cp RuinsOfAlphKabutoChamber_SecondMapHeader / $100
cp HIGH(RuinsOfAlphKabutoChamber_SecondMapHeader)
jr nz, .done
ld a, l
cp RuinsOfAlphKabutoChamber_SecondMapHeader % $100
cp LOW(RuinsOfAlphKabutoChamber_SecondMapHeader)
jr nz, .done
ld de, EVENT_WALL_OPENED_IN_KABUTO_CHAMBER

View File

@ -606,7 +606,7 @@ CopyTilemapAtOnce:: ; 323d
ld a, SCREEN_HEIGHT
ld [hTilesPerCycle], a
ld b, 1 << 1 ; not in v/hblank
ld c, rSTAT % $100
ld c, LOW(rSTAT)
.loop
rept SCREEN_WIDTH / 2
@ -1350,14 +1350,14 @@ PushLYOverrides:: ; 3b0c
and a
ret z
ld a, LYOverridesBackup % $100
ld a, LOW(LYOverridesBackup)
ld [Requested2bppSource], a
ld a, LYOverridesBackup / $100
ld a, HIGH(LYOverridesBackup)
ld [Requested2bppSource + 1], a
ld a, LYOverrides % $100
ld a, LOW(LYOverrides)
ld [Requested2bppDest], a
ld a, LYOverrides / $100
ld a, HIGH(LYOverrides)
ld [Requested2bppDest + 1], a
ld a, (LYOverridesEnd - LYOverrides) / 16

View File

@ -72,16 +72,16 @@ OldDMATransfer:: ; dfd
call DelayFrame
; add $100 to hl and de
ld a, l
add $100 % $100
add LOW($100)
ld l, a
ld a, h
adc $100 / $100
adc HIGH($100)
ld h, a
ld a, e
add $100 % $100
add LOW($100)
ld e, a
ld a, d
adc $100 / $100
adc HIGH($100)
ld d, a
jr .loop

View File

@ -106,11 +106,11 @@ UpdateGameTimer:: ; 20ad
; Cap the timer after 1000 hours.
ld a, h
cp 1000 / $100
cp HIGH(1000)
jr c, .ok
ld a, l
cp 1000 % $100
cp LOW(1000)
jr c, .ok
ld hl, GameTimeCap

View File

@ -141,9 +141,9 @@ Init:: ; 17d
farcall InitCGBPals
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
xor a ; VBGMap1 % $100
xor a ; LOW(VBGMap1)
ld [hBGMapAddress], a
farcall StartClock
@ -201,7 +201,7 @@ ClearWRAM:: ; 25a
push af
ld [rSVBK], a
xor a
ld hl, $d000
ld hl, wRAM1Start
ld bc, $1000
call ByteFill
pop af

View File

@ -23,7 +23,7 @@ LCD:: ; 552
push bc
ld a, [rLY]
ld c, a
ld b, LYOverrides >> 8
ld b, HIGH(LYOverrides)
ld a, [bc]
ld b, a
ld a, [hLCDCPointer]

View File

@ -1241,10 +1241,10 @@ ScrollMapUp:: ; 2748
ld h, a
ld bc, $0200
add hl, bc
; cap d at VBGMap1 / $100
; cap d at HIGH(VBGMap0)
ld a, h
and %00000011
or VBGMap0 / $100
or HIGH(VBGMap0)
ld e, l
ld d, a
call UpdateBGMapRow
@ -1369,10 +1369,10 @@ UpdateBGMapColumn:: ; 27f8
ld e, a
jr nc, .skip
inc d
; cap d at VBGMap1 / $100
; cap d at HIGH(VBGMap0)
ld a, d
and $3
or VBGMap0 / $100
or HIGH(VBGMap0)
ld d, a
.skip

View File

@ -4,9 +4,9 @@ InitMovementBuffer:: ; 1b1e
ld [wMovementBufferCount], a
ld a, $0 ; useless
ld [wUnusedMovementBufferBank], a
ld a, MovementBuffer % $100
ld a, LOW(MovementBuffer)
ld [wUnusedMovementBufferPointer], a
ld a, MovementBuffer / $100
ld a, HIGH(MovementBuffer)
ld [wUnusedMovementBufferPointer + 1], a
ret
; 1b35

View File

@ -24,18 +24,18 @@ ForceUpdateCGBPals:: ; c37
ld a, [rSVBK]
push af
ld a, 5 ; BANK(BGPals)
ld a, BANK(BGPals)
ld [rSVBK], a
ld hl, BGPals ; 5:d080
ld hl, BGPals
; copy 8 pals to bgpd
ld a, %10000000 ; auto increment, index 0
ld [rBGPI], a
ld c, rBGPD % $100
ld b, 4 ; NUM_PALS / 2
ld c, LOW(rBGPD)
ld b, 8 / 2
.bgp
rept 2 palettes
rept (1 palettes) * 2
ld a, [hli]
ld [$ff00+c], a
endr
@ -43,15 +43,15 @@ endr
dec b
jr nz, .bgp
; hl is now 5:d0c0 OBPals
; hl is now OBPals
; copy 8 pals to obpd
ld a, %10000000 ; auto increment, index 0
ld [rOBPI], a
ld c, rOBPD % $100
ld b, 4 ; NUM_PALS / 2
ld c, LOW(rOBPD)
ld b, 8 / 2
.obp
rept 2 palettes
rept (1 palettes) * 2
ld a, [hli]
ld [$ff00+c], a
endr
@ -90,7 +90,7 @@ DmgToCgbBGPals:: ; c9f
ld a, [rSVBK]
push af
ld a, 5 ; gfx
ld a, BANK(BGPals)
ld [rSVBK], a
; copy & reorder bg pal buffer
@ -138,7 +138,7 @@ DmgToCgbObjPals:: ; ccb
ld a, [rSVBK]
push af
ld a, 5
ld a, BANK(OBPals)
ld [rSVBK], a
; copy & reorder obj pal buffer
@ -178,11 +178,11 @@ DmgToCgbObjPal0:: ; cf8
ld a, [rSVBK]
push af
ld a, 5 ; gfx
ld a, BANK(OBPals)
ld [rSVBK], a
ld hl, OBPals
ld de, UnknOBPals
ld hl, OBPals palette 0
ld de, UnknOBPals palette 0
ld a, [rOBP0]
ld b, a
ld c, 1
@ -216,11 +216,11 @@ DmgToCgbObjPal1:: ; d24
ld a, [rSVBK]
push af
ld a, 5 ; gfx
ld a, BANK(OBPals)
ld [rSVBK], a
ld hl, OBPals + 1 palettes
ld de, UnknOBPals + 1 palettes
ld hl, OBPals palette 1
ld de, UnknOBPals palette 1
ld a, [rOBP1]
ld b, a
ld c, 1
@ -325,10 +325,10 @@ Special_ReloadSpritesNoPalettes:: ; d91
ret z
ld a, [rSVBK]
push af
ld a, 5 ; BANK(BGPals)
ld a, BANK(BGPals)
ld [rSVBK], a
ld hl, BGPals
ld bc, $40 + $10
ld bc, (8 palettes) + (2 palettes)
xor a
call ByteFill
pop af

View File

@ -143,9 +143,9 @@ UpdateBGMap:: ; 164c
ld h, a
push hl
xor a
xor a ; LOW(VBGMap1)
ld [hBGMapAddress], a
ld a, VBGMap1 >> 8
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
ld a, [hBGMapMode]

View File

@ -108,10 +108,10 @@ Function110030:: ; 110030 (44:4030)
ld a, [$c988]
ld l, a
push hl
ld a, Function110236 % $100
ld a, LOW(Function110236)
cp l
jr nz, .okay
ld a, Function110236 / $100
ld a, HIGH(Function110236)
cp h
.okay
call nz, Function1100b4
@ -615,7 +615,7 @@ Function11032c: ; 11032c
; 110393
Function110393: ; 110393
ld c, rIE % $100
ld c, LOW(rIE)
ld a, [$ff00+c]
or $c
ld [$ff00+c], a
@ -1969,11 +1969,11 @@ Function110d37: ; 110d37
push de
ld b, 0
.check_under_10k
ld a, 10000 / $100
ld a, HIGH(10000)
cp h
jr c, .subtract_10k
jr nz, .done_10k
ld a, 10000 % $100
ld a, LOW(10000)
cp l
jr z, .subtract_10k
jr nc, .done_10k
@ -1993,11 +1993,11 @@ Function110d37: ; 110d37
inc de
ld b, 0
.check_under_1k
ld a, 1000 / $100
ld a, HIGH(1000)
cp h
jr c, .subtract_1k
jr nz, .done_1k
ld a, 1000 % $100
ld a, LOW(1000)
cp l
jr z, .subtract_1k
jr nc, .done_1k
@ -2017,10 +2017,10 @@ Function110d37: ; 110d37
inc de
ld b, 0
.check_under_100
ld a, 100 / $100
ld a, HIGH(100)
cp h
jr nz, .subtract_100
ld a, 100 % $100
ld a, LOW(100)
cp l
jr z, .subtract_100
jr nc, .check_under_10
@ -8521,14 +8521,14 @@ Function1136c1: ; 1136c1
.asm_113734
ld hl, $cc0c
ld a, Unknown_113b8e % $100
ld a, LOW(Unknown_113b8e)
ld [hli], a
ld a, Unknown_113b8e / $100
ld a, HIGH(Unknown_113b8e)
ld [hl], a
ld hl, $cc0e
ld a, Unknown_113a70 % $100
ld a, LOW(Unknown_113a70)
ld [hli], a
ld a, Unknown_113a70 / $100
ld a, HIGH(Unknown_113a70)
ld [hl], a
ld hl, $cbe7
ld de, $cc18
@ -8610,7 +8610,7 @@ endr
ld [$cc0d], a
ld a, l
ld [$cc0c], a
cp $8e ; XXX (Unknown_113b8e + $100) % $100 ???
cp $8e ; XXX ; LOW(Unknown_113b8e + $100) ???
jp nz, .asm_113751
ld de, $cc18
ld hl, $cbe7

View File

@ -19,7 +19,6 @@ INCLUDE "macros/scripts/move_anim.asm"
INCLUDE "macros/scripts/trade_anim.asm"
INCLUDE "macros/scripts/gfx_anim.asm"
percent EQUS "* $ff / 100"
tiles EQUS "* LEN_2BPP_TILE"

View File

@ -95,7 +95,7 @@ dsprite: MACRO
; conditional segment is there because not every instance of
; this macro is directly OAM
if _NARG >= 7 ; y tile, y pxl, x tile, x pxl, vtile offset, flags, palette
db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, (\6 << 3) + (\7 & 7)
db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, (\6 << 3) + (\7 & PALETTE_MASK)
else
db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6
endc

View File

@ -116,13 +116,13 @@ Function170139: ; 170139
ld a, c
ld [de], a
inc de
ld a, PartyMons % $100
ld a, LOW(PartyMons)
ld [wcd49], a
ld a, PartyMons / $100
ld a, HIGH(PartyMons)
ld [wcd4a], a
ld a, PartyMonNicknames % $100
ld a, LOW(PartyMonNicknames)
ld [wcd4b], a
ld a, PartyMonNicknames / $100
ld a, HIGH(PartyMonNicknames)
ld [wcd4c], a
ld a, 3
.CopyLoop:
@ -355,9 +355,9 @@ ReadBTTrainerParty: ; 1702b7
ld hl, wBT_OTTempTrainerClass
ld a, [hli]
ld [OtherTrainerClass], a
ld a, OTPartyMonNicknames % $100
ld a, LOW(OTPartyMonNicknames)
ld [BGMapBuffer], a
ld a, OTPartyMonNicknames / $100
ld a, HIGH(OTPartyMonNicknames)
ld [BGMapBuffer + 1], a
; Copy Pkmn into Memory from the address in hl

View File

@ -3015,26 +3015,26 @@ EZChat_GetSeenPokemonByKana: ; 11d3ba
ld a, [rSVBK]
push af
ld hl, $c648
ld a, w5_d800 % $100
ld a, LOW(w5_d800)
ld [wcd2d], a
ld [hli], a
ld a, w5_d800 / $100
ld a, HIGH(w5_d800)
ld [wcd2e], a
ld [hl], a
ld a, SortedPokemon % $100
ld a, LOW(SortedPokemon)
ld [wcd2f], a
ld a, SortedPokemon / $100
ld a, HIGH(SortedPokemon)
ld [wcd30], a
ld a, $c6a8 % $100
ld a, LOW($c6a8)
ld [wcd31], a
ld a, $c6a8 / $100
ld a, HIGH($c6a8)
ld [wcd32], a
ld a, $c64a % $100
ld a, LOW($c64a)
ld [wcd33], a
ld a, $c64a / $100
ld a, HIGH($c64a)
ld [wcd34], a
ld hl, EZChat_SortedWords

View File

@ -39,9 +39,9 @@ InitMobileProfile: ; 4802f (12:402f)
.asm_4808a
ld a, $5
ld [MusicFade], a
ld a, MUSIC_MOBILE_ADAPTER_MENU % $100
ld a, LOW(MUSIC_MOBILE_ADAPTER_MENU)
ld [MusicFadeID], a
ld a, MUSIC_MOBILE_ADAPTER_MENU / $100
ld a, HIGH(MUSIC_MOBILE_ADAPTER_MENU)
ld [MusicFadeID + 1], a
ld c, 20
call DelayFrames

View File

@ -2736,9 +2736,9 @@ LoadSelectedPartiesForColosseum: ; 1010f2
.ContinueCopy:
; Copy, via wc608...
ld a, wc608 % $100
ld a, LOW(wc608)
ld [StringBuffer2], a
ld a, wc608 / $100
ld a, HIGH(wc608)
ld [StringBuffer2 + 1], a
; ... bc bytes...
ld a, c
@ -7237,9 +7237,9 @@ Function1030cd: ; 1030cd
add a
add a
add Unknown_10327a % $100
add LOW(Unknown_10327a)
ld l, a
ld a, Unknown_10327a / $100
ld a, HIGH(Unknown_10327a)
adc 0
ld h, a

View File

@ -1297,7 +1297,7 @@ MobileTradeAnim_DisplayReceivedMon:
MobileTradeAnim_DisplayEggData
call WaitTop
call MobileTradeAnim_ClearTilemap
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 5, 0
ld b, 6
@ -1320,7 +1320,7 @@ MobileTradeAnim_DisplayEggData
Function108a33: ; 108a33
call WaitTop
call MobileTradeAnim_ClearTilemap
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 5, 0
ld b, 6
@ -1340,7 +1340,7 @@ Function108a33: ; 108a33
MobileTradeAnim_LoadMonTemplate: ; 108a5b
call WaitTop
call MobileTradeAnim_ClearTilemap
ld a, VBGMap1 / $100
ld a, HIGH(VBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 4, 0
ld b, 6
@ -1363,7 +1363,7 @@ MobileTradeAnim_LoadMonTemplate: ; 108a5b
MobileTradeAnim_MonDisplay_UpdateBGMap: ; 108a87
call WaitBGMap
call WaitTop
ld a, VBGMap0 / $100
ld a, HIGH(VBGMap0)
ld [hBGMapAddress + 1], a
ret
; 108a92

View File

@ -1,4 +1,3 @@
SECTION "bank45", ROMX
charmap " ", $20 ; revert to ascii
@ -7613,9 +7612,9 @@ Function117c4a:
ld c, 8
.loop
push hl
ld a, $7fff % $100
ld a, LOW(palred 31 + palgreen 31 + palblue 31)
ld [hli], a
ld a, $7fff / $100
ld a, HIGH(palred 31 + palgreen 31 + palblue 31)
ld [hl], a
pop hl
add hl, de

View File

@ -1901,17 +1901,17 @@ Function118f68:
and a
jr z, .asm_118fba
ld hl, $c346
ld a, $c608 % $100
ld a, LOW($c608)
ld [hli], a
ld a, $c608 / $100
ld a, HIGH($c608)
ld [hli], a
ld a, [wcd4b]
ld [hli], a
ld a, [wcd4c]
ld [hli], a
ld a, $c708 % $100
ld a, LOW($c708)
ld [hli], a
ld a, $c708 / $100
ld a, HIGH($c708)
ld [hli], a
ld a, $60
ld [hli], a
@ -2530,17 +2530,17 @@ Function1193a0:
ld [wcd3c], a
call BattleTowerRoomMenu2
ld hl, $c346
ld a, wd000 % $100
ld a, LOW(wd000)
ld [hli], a
ld a, wd000 / $100
ld a, HIGH(wd000)
ld [hli], a
ld a, [wcd3b]
ld [hli], a
xor a
ld [hli], a
ld a, $c708 % $100
ld a, LOW($c708)
ld [hli], a
ld a, $c708 / $100
ld a, HIGH($c708)
ld [hli], a
ld a, $60
ld [hli], a
@ -3358,17 +3358,17 @@ Function1198f7:
ld hl, $c608 + 2
call Function119940
ld hl, w3_d800
ld a, $c608 % $100
ld a, LOW($c608)
ld [hli], a
ld a, $c608 / $100
ld a, HIGH($c608)
ld [hli], a
ld a, $f6
ld [hli], a
xor a
ld [hli], a
ld a, $c708 % $100
ld a, LOW($c708)
ld [hli], a
ld a, $c708 / $100
ld a, HIGH($c708)
ld [hli], a
ld a, [wcd51]
ld [hli], a
@ -3794,10 +3794,10 @@ Function119b6b: ; 119b6b
cp $d
jr nz, .asm_119b93
ld a, l
cp (w3_d869) % $100
cp LOW(w3_d869)
jr nz, .asm_119be3
ld a, h
cp (w3_d869) / $100
cp HIGH(w3_d869)
jr nz, .asm_119be3
ld a, $5
call GetSRAMBank
@ -5497,9 +5497,9 @@ Function11a90f: ; 11a90f
.asm_11a94f
xor a
ld [$c31f], a
ld a, $c320 % $100
ld a, LOW($c320)
ld [$c31b], a
ld a, $c320 / $100
ld a, HIGH($c320)
ld [$c31c], a
hlcoord 1, 14
ld a, l
@ -7456,29 +7456,29 @@ Function11b6b4: ; 11b6b4
ld a, [wcd31]
ld [$c709], a
ld a, $c708 % $100
ld a, LOW($c708) ; Species
ld [wMobileMonSpeciesPointerBuffer], a
ld a, $c708 / $100
ld a, HIGH($c708)
ld [wMobileMonSpeciesPointerBuffer + 1], a
ld a, $c60d % $100 ; Partymon Struct
ld a, LOW($c60d) ; Partymon Struct
ld [wMobileMonStructurePointerBuffer], a
ld a, $c60d / $100
ld a, HIGH($c60d)
ld [wMobileMonStructurePointerBuffer + 1], a
ld a, $c63d % $100 ; OT
ld a, LOW($c63d) ; OT
ld [wMobileMonOTNamePointerBuffer], a
ld a, $c63d / $100
ld a, HIGH($c63d)
ld [wMobileMonOTNamePointerBuffer + 1], a
ld a, $c642 % $100 ; Nickname
ld a, LOW($c642) ; Nickname
ld [wMobileMonNicknamePointerBuffer], a
ld a, $c642 / $100
ld a, HIGH($c642)
ld [wMobileMonNicknamePointerBuffer + 1], a
ld a, $c647 % $100 ; ???
ld a, LOW($c647) ; Mail
ld [wMobileMonMailPointerBuffer], a
ld a, $c647 / $100
ld a, HIGH($c647)
ld [wMobileMonMailPointerBuffer + 1], a
ld a, $46
@ -7762,29 +7762,29 @@ Function11b93b: ; 11b93b
call CopyBytes
call CloseSRAM
ld a, $c608 % $100
ld a, LOW($c608)
ld [wMobileMonSpeciesPointerBuffer], a
ld a, $c608 / $100
ld a, HIGH($c608)
ld [wMobileMonSpeciesPointerBuffer + 1], a
ld a, $c611 % $100
ld a, LOW($c611)
ld [wMobileMonStructurePointerBuffer], a
ld a, $c611 / $100
ld a, HIGH($c611)
ld [wMobileMonStructurePointerBuffer + 1], a
ld a, $c641 % $100
ld a, LOW($c641)
ld [wMobileMonOTNamePointerBuffer], a
ld a, $c641 / $100
ld a, HIGH($c641)
ld [wMobileMonOTNamePointerBuffer + 1], a
ld a, $c646 % $100
ld a, LOW($c646)
ld [wMobileMonNicknamePointerBuffer], a
ld a, $c646 / $100
ld a, HIGH($c646)
ld [wMobileMonNicknamePointerBuffer + 1], a
ld a, $c64b % $100
ld a, LOW($c64b)
ld [wMobileMonMailPointerBuffer], a
ld a, $c64b / $100
ld a, HIGH($c64b)
ld [wMobileMonMailPointerBuffer + 1], a
call AddMobileMonToParty
farcall SaveAfterLinkTrade

View File

@ -475,10 +475,10 @@ AnimateWaterTile: ; fc402
add a
add a
add WaterTileFrames % $100
add LOW(WaterTileFrames)
ld l, a
ld a, 0
adc WaterTileFrames / $100
adc HIGH(WaterTileFrames)
ld h, a
; Stack now points to the start of the tile for this frame.
@ -513,10 +513,10 @@ ForestTreeLeftAnimation: ; fc45c
add a
add a
add a
add ForestTreeLeftFrames % $100
add LOW(ForestTreeLeftFrames)
ld l, a
ld a, 0
adc ForestTreeLeftFrames / $100
adc HIGH(ForestTreeLeftFrames)
ld h, a
.asm_fc47d
@ -555,10 +555,10 @@ ForestTreeRightAnimation: ; fc4c4
add a
add a
add a
add ForestTreeLeftFrames % $100
add LOW(ForestTreeLeftFrames)
ld l, a
ld a, 0
adc ForestTreeLeftFrames / $100
adc HIGH(ForestTreeLeftFrames)
ld h, a
push bc
ld bc, ForestTreeRightFrames - ForestTreeLeftFrames
@ -591,10 +591,10 @@ ForestTreeLeftAnimation2: ; fc4f2
add a
add a
add a
add ForestTreeLeftFrames % $100
add LOW(ForestTreeLeftFrames)
ld l, a
ld a, 0
adc ForestTreeLeftFrames / $100
adc HIGH(ForestTreeLeftFrames)
ld h, a
.asm_fc515
@ -623,10 +623,10 @@ ForestTreeRightAnimation2: ; fc51c
add a
add a
add a
add ForestTreeLeftFrames % $100
add LOW(ForestTreeLeftFrames)
ld l, a
ld a, 0
adc ForestTreeLeftFrames / $100
adc HIGH(ForestTreeLeftFrames)
ld h, a
push bc
ld bc, ForestTreeRightFrames - ForestTreeLeftFrames