Fix wVirtualOAM labels, part 2.

This commit is contained in:
luckytyphlosion 2018-01-30 14:52:46 -05:00
parent 3c7ba37de7
commit 0b45e2e846
29 changed files with 106 additions and 105 deletions

View File

@ -9327,7 +9327,7 @@ CopyBackpic: ; 3fc30
; 3fc5b
.LoadTrainerBackpicAsOAM: ; 3fc5b
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
xor a
ld [hMapObjectIndexBuffer], a
ld b, 6

View File

@ -60,7 +60,7 @@ BattleIntroSlidingPics: ; 4e980
; 4e9d6
.subfunction3 ; 4e9d6
ld hl, wSprite01XCoord
ld hl, wVirtualOAMSprite00XCoord
ld c, $12 ; 18
ld de, SPRITEOAMSTRUCT_LENGTH
.loop3

View File

@ -28,7 +28,7 @@ ShowPlayerMonsRemaining: ; 2c01c
ld [hl], a
ld a, 8
ld [wPlaceBallsDirection], a
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
jp LoadTrainerHudOAM
; 2c03a
@ -44,7 +44,7 @@ ShowOTTrainerMonsRemaining: ; 2c03a
ld [hl], 4 * 8
ld a, -8
ld [wPlaceBallsDirection], a
ld hl, wSprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
jp LoadTrainerHudOAM
; 2c059
@ -193,7 +193,7 @@ LinkBattle_TrainerHuds: ; 2c10d
ld [hl], 8 * 8
ld a, $8
ld [wPlaceBallsDirection], a
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
call LoadTrainerHudOAM
ld hl, wOTPartyMon1HP
@ -203,7 +203,7 @@ LinkBattle_TrainerHuds: ; 2c10d
ld a, 10 * 8
ld [hli], a
ld [hl], 13 * 8
ld hl, wSprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
jp LoadTrainerHudOAM
; 2c143

View File

@ -257,7 +257,7 @@ BattleAnim_ClearCGB_OAMFlags: ; cc23d
bit 3, a
jr z, .delete
ld hl, wSprite01Attributes
ld hl, wVirtualOAMSprite00Attributes
ld c, NUM_SPRITE_OAM_STRUCTS
.loop
ld a, [hl]

View File

@ -1498,7 +1498,7 @@ BillsPC_UpdateSelectionCursor: ; e2e01 (38:6e01)
.place_cursor
ld hl, .OAM
ld de, wSprite01
ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp -1
@ -1548,7 +1548,7 @@ endr
BillsPC_UpdateInsertCursor: ; e2e8c
ld hl, .OAM
ld de, wSprite01
ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp -1

View File

@ -601,7 +601,7 @@ CardFlip_CopyToBox: ; e04f7 (38:44f7)
; e0509 (38:4509)
CardFlip_CopyOAM: ; e0509
ld de, wSprite01
ld de, wVirtualOAMSprite00
ld a, [hli]
.loop
push af

View File

@ -52,7 +52,7 @@ Special_CelebiShrineEvent: ; 4989a
; 498f9
.RestorePlayerSprite_DespawnLeaves: ; 498f9
ld hl, wSprite01TileID
ld hl, wVirtualOAMSprite00TileID
xor a
ld c, 4
.OAMloop:
@ -63,8 +63,8 @@ endr
inc a
dec c
jr nz, .OAMloop
ld hl, wSprite05
ld bc, wSpritesEnd - wSprite05
ld hl, wVirtualOAMSprite04
ld bc, wSpritesEnd - wVirtualOAMSprite04
xor a
call ByteFill
ret

View File

@ -62,8 +62,8 @@ ShakeHeadbuttTree: ; 8c80a
xor a
ld [hBGMapMode], a
farcall ClearSpriteAnims
ld hl, wSprite37
ld bc, wSpritesEnd - wSprite37
ld hl, wVirtualOAMSprite36
ld bc, wSpritesEnd - wVirtualOAMSprite36
xor a
call ByteFill
ld de, Font
@ -393,7 +393,7 @@ FlyToAnim: ; 8cb33
ret
.RestorePlayerSprite_DespawnLeaves: ; 8cb82 (23:4b82)
ld hl, wSprite01TileID
ld hl, wVirtualOAMSprite00TileID
xor a
ld c, 4
.OAMloop
@ -404,8 +404,8 @@ endr
inc a
dec c
jr nz, .OAMloop
ld hl, wSprite05
ld bc, wSpritesEnd - wSprite05
ld hl, wVirtualOAMSprite04
ld bc, wSpritesEnd - wVirtualOAMSprite04
xor a
call ByteFill
ret

View File

@ -97,14 +97,14 @@ ENDM
; 12393
.PC_LoadBallsOntoMachine: ; 12393
ld hl, wSprite33
ld hl, wVirtualOAMSprite32
ld de, .PC_ElmsLab_OAM
call .PlaceHealingMachineTile
call .PlaceHealingMachineTile
jr .LoadBallsOntoMachine
.HOF_LoadBallsOntoMachine: ; 123a1
ld hl, wSprite33
ld hl, wVirtualOAMSprite32
ld de, .HOF_OAM
.LoadBallsOntoMachine: ; 123a7

View File

@ -346,7 +346,7 @@ EvolutionAnimation: ; 4e5e1
inc a
and $7
ld b, a
ld hl, wSprite01Attributes
ld hl, wVirtualOAMSprite00Attributes
ld c, NUM_SPRITE_OAM_STRUCTS
.loop6
ld a, [hl]

View File

@ -969,7 +969,7 @@ Intro_PlacePlayerSprite: ; 61cd
ld hl, vTiles0
call Request2bpp
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
ld de, .sprites
ld a, [de]
inc de

View File

@ -1458,7 +1458,7 @@ Function105688: ; 105688 (41:5688)
Function1056eb: ; 1056eb (41:56eb)
ld c, 16
.loop
ld hl, wSprite01YCoord
ld hl, wVirtualOAMSprite00YCoord
ld b, 8
.dec_y_loop
dec [hl]
@ -1467,7 +1467,7 @@ rept SPRITEOAMSTRUCT_LENGTH
endr
dec b
jr nz, .dec_y_loop
ld hl, wSprite09YCoord
ld hl, wVirtualOAMSprite08YCoord
ld b, 8
.inc_y_loop
inc [hl]
@ -1656,7 +1656,7 @@ Function1057d7: ; 1057d7 (41:57d7)
ld [hl], $3c
hlcoord 17, 15
ld [hl], $3e
ld de, wSprite01
ld de, wVirtualOAMSprite00
ld hl, .OAM_data
ld bc, 16 * SPRITEOAMSTRUCT_LENGTH
call CopyBytes

View File

@ -2117,7 +2117,7 @@ Pokedex_UpdateSearchResultsCursorOAM: ; 41281 (10:5281)
db -1
Pokedex_LoadCursorOAM: ; 412f1 (10:52f1)
ld de, wSprite01
ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp -1

View File

@ -41,7 +41,7 @@ AnimateDexSearchSlowpoke: ; 441cf
DoDexSearchSlowpokeFrame: ; 44207
ld a, [wDexSearchSlowpokeFrame]
ld hl, .SlowpokeSpriteData
ld de, wSprite01
ld de, wVirtualOAMSprite00
.loop
ld a, [hli]
cp -1

View File

@ -2627,7 +2627,7 @@ Pokedex_GetArea: ; 91d11
ld e, a
farcall FindNest ; load nest landmarks into wTileMap[0,0]
decoord 0, 0
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
.nestloop
ld a, [de]
and a
@ -2671,7 +2671,7 @@ Pokedex_GetArea: ; 91d11
ld c, e
ld b, d
ld de, .PlayerOAM
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
.ShowPlayerLoop:
ld a, [de]
cp $80
@ -2700,8 +2700,8 @@ Pokedex_GetArea: ; 91d11
jr .ShowPlayerLoop
.clear_oam
ld hl, wSprite05
ld bc, wSpritesEnd - wSprite05
ld hl, wVirtualOAMSprite04
ld bc, wSpritesEnd - wVirtualOAMSprite04
xor a
call ByteFill
ret

View File

@ -25,7 +25,7 @@ _SwitchPartyMons:
ld a, " "
call ByteFill
pop af
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
ld bc, 4 * SPRITEOAMSTRUCT_LENGTH
call AddNTimes
ld de, SPRITEOAMSTRUCT_LENGTH

View File

@ -261,7 +261,7 @@ Unreferenced_Function9282c: ; 9282c
inc [hl]
and $7
ret nz
ld hl, wSprite17TileID
ld hl, wVirtualOAMSprite16TileID
ld c, NUM_SPRITE_OAM_STRUCTS - 16
.loop
ld a, [hl]
@ -671,7 +671,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98)
ld bc, wReel1
ld hl, REEL_OAM_ADDR
add hl, bc
ld de, wSprite17
ld de, wVirtualOAMSprite16
ld [hl], e
inc hl
ld [hl], d
@ -689,7 +689,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98)
ld bc, wReel2
ld hl, REEL_OAM_ADDR
add hl, bc
ld de, wSprite25
ld de, wVirtualOAMSprite24
ld [hl], e
inc hl
ld [hl], d
@ -707,7 +707,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98)
ld bc, wReel3
ld hl, REEL_OAM_ADDR
add hl, bc
ld de, wSprite33
ld de, wVirtualOAMSprite32
ld [hl], e
inc hl
ld [hl], d

View File

@ -100,11 +100,11 @@ DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8)
ld a, [wCurrSpriteOAMAddr]
ld l, a
ld h, HIGH(wSprite17)
ld h, HIGH(wVirtualOAMSprite16)
.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> Sprites + $40)
ld a, l
cp LOW(wSprite17)
cp LOW(wVirtualOAMSprite16)
jr nc, .done
xor a
ld [hli], a
@ -649,7 +649,7 @@ AnimateEndOfExpBar: ; 8e79d
; 8e7c6
.AnimateFrame: ; 8e7c6
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
ld c, 8 ; number of animated circles
.anim_loop
ld a, c

View File

@ -323,7 +323,7 @@ DrawTitleGraphic: ; 10eeef
; 10ef06
InitializeBackground: ; 10ef06
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
ld d, -$22
ld e, $0
ld c, 5
@ -366,7 +366,7 @@ AnimateTitleCrystal: ; 10ef32
; Stop at y=6
; y is really from the bottom of the sprite, which is two tiles high
ld hl, wSprite01YCoord
ld hl, wVirtualOAMSprite00YCoord
ld a, [hl]
cp 6 + 2 * TILE_WIDTH
ret z

View File

@ -479,7 +479,7 @@ TrainerCard_Page2_3_OAMUpdate: ; 25448 (9:5448)
ld d, a
ld a, [de]
ld c, a
ld de, wSprite01
ld de, wVirtualOAMSprite00
ld b, NUM_JOHTO_BADGES
.loop
srl c

View File

@ -549,7 +549,7 @@ RedrawUnownPuzzlePieces: ; e14d9
ld hl, .OAM_NotHoldingPiece
.load
ld de, wSprite01
ld de, wVirtualOAMSprite00
.loop
ld a, [hli]
cp -1

View File

@ -49,7 +49,7 @@ UnusedTitleScreen: ; 10c000
jr nz, .copy
ld hl, UnusedTitleFG_OAM
ld de, wSprite01
ld de, wVirtualOAMSprite00
ld bc, SPRITEOAMSTRUCT_LENGTH * NUM_SPRITE_OAM_STRUCTS
call CopyBytes

View File

@ -181,7 +181,7 @@ ClearSprites:: ; 300b
HideSprites:: ; 3016
; Set all OAM y-positions to 160 to hide them offscreen
ld hl, wSprite01YCoord
ld hl, wVirtualOAMSprite00YCoord
ld de, SPRITEOAMSTRUCT_LENGTH
ld b, NUM_SPRITE_OAM_STRUCTS
ld a, SCREEN_WIDTH_PX

View File

@ -506,15 +506,15 @@ Unreferenced_Function3d9f:: ; 3d9f
; Places a BCD number at the
; upper center of the screen.
ld a, 4 * TILE_WIDTH
ld [wSprite39YCoord], a
ld [wSprite40YCoord], a
ld [wVirtualOAMSprite38YCoord], a
ld [wVirtualOAMSprite39YCoord], a
ld a, 10 * TILE_WIDTH
ld [wSprite39XCoord], a
ld [wVirtualOAMSprite38XCoord], a
ld a, 11 * TILE_WIDTH
ld [wSprite40XCoord], a
ld [wVirtualOAMSprite39XCoord], a
xor a
ld [wSprite39Attributes], a
ld [wSprite40Attributes], a
ld [wVirtualOAMSprite38Attributes], a
ld [wVirtualOAMSprite39Attributes], a
ld a, [wc296]
cp 100
jr nc, .max
@ -524,17 +524,17 @@ Unreferenced_Function3d9f:: ; 3d9f
swap a
and $f
add "0"
ld [wSprite39TileID], a
ld [wVirtualOAMSprite38TileID], a
ld a, b
and $f
add "0"
ld [wSprite40TileID], a
ld [wVirtualOAMSprite39TileID], a
ret
.max
ld a, "9"
ld [wSprite39TileID], a
ld [wSprite40TileID], a
ld [wVirtualOAMSprite38TileID], a
ld [wVirtualOAMSprite39TileID], a
ret
; 3dde

View File

@ -1923,7 +1923,7 @@ Function89b97: ; 89b97 (22:5b97)
ld a, [hli]
ld h, [hl]
ld l, a
ld de, wSprite01
ld de, wVirtualOAMSprite00
.asm_89bb4
ld a, [hli]
cp $ff
@ -2013,7 +2013,7 @@ Function89c44: ; 89c44 (22:5c44)
pop de
ret
.asm_89c4f
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
push de
ld a, b
ld [hli], a ; y
@ -2123,7 +2123,7 @@ Function89cdf: ; 89cdf (22:5cdf)
ld c, a
ld e, $2
ld a, $2
ld hl, wSprite01
ld hl, wVirtualOAMSprite00
.asm_89cee
push af
push bc

View File

@ -22,7 +22,7 @@ Function115dc3: ; 115dc3
xor a
ld [wc305], a
ld a, $a0
ld hl, wSprite32
ld hl, wVirtualOAMSprite31
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
ret
@ -34,7 +34,7 @@ Function115dd3: ; 115dd3
and a
ret z
ld a, $a0
ld hl, wSprite32
ld hl, wVirtualOAMSprite31
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
call Function115e22
@ -50,7 +50,7 @@ Function115dd3: ; 115dd3
ld d, a
push de
pop hl
ld de, wSprite32
ld de, wVirtualOAMSprite31
ld a, [wc307]
ld c, a
ld a, [wc308]
@ -585,7 +585,7 @@ Function1162f2: ; 1162f2
ld e, a
ld a, [hli]
sub e
ld de, wSprite10
ld de, wVirtualOAMSprite09
.asm_116321
push af
ld a, [hli]
@ -626,7 +626,7 @@ Function1162f2: ; 1162f2
ld e, a
ld a, [hli]
sub e
ld de, wSprite01
ld de, wVirtualOAMSprite00
.asm_11635a
push af
ld a, [hli]

View File

@ -6921,7 +6921,7 @@ Function11b31b: ; 11b31b
db $39 ; 13
Function11b397: ; 11b397
ld de, wSprite01
ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp $ff
@ -6979,7 +6979,7 @@ Unreferenced_Function11b3b6: ; 11b3b6
; 11b3d9
Function11b3d9: ; 11b3d9
ld de, wSprite29
ld de, wVirtualOAMSprite28
push de
ld a, [wc7d2]
dec a

1
replace.sh Normal file
View File

@ -0,0 +1 @@
sed -i 's/\<'$1'\>/'$2'/' $(grep -lwr --include="*.asm" --exclude-dir=".git" --exclude-dir="tools" --exclude-dir="extras" --exclude-dir="crowdmap" $1)

View File

@ -303,46 +303,46 @@ wc3fc:: ds 1
SECTION "Sprites", WRAM0
wVirtualOAM:: ; c400
wSprite01:: sprite_oam_struct wSprite01
wSprite02:: sprite_oam_struct wSprite02
wSprite03:: sprite_oam_struct wSprite03
wSprite04:: sprite_oam_struct wSprite04
wSprite05:: sprite_oam_struct wSprite05
wSprite06:: sprite_oam_struct wSprite06
wSprite07:: sprite_oam_struct wSprite07
wSprite08:: sprite_oam_struct wSprite08
wSprite09:: sprite_oam_struct wSprite09
wSprite10:: sprite_oam_struct wSprite10
wSprite11:: sprite_oam_struct wSprite11
wSprite12:: sprite_oam_struct wSprite12
wSprite13:: sprite_oam_struct wSprite13
wSprite14:: sprite_oam_struct wSprite14
wSprite15:: sprite_oam_struct wSprite15
wSprite16:: sprite_oam_struct wSprite16
wSprite17:: sprite_oam_struct wSprite17
wSprite18:: sprite_oam_struct wSprite18
wSprite19:: sprite_oam_struct wSprite19
wSprite20:: sprite_oam_struct wSprite20
wSprite21:: sprite_oam_struct wSprite21
wSprite22:: sprite_oam_struct wSprite22
wSprite23:: sprite_oam_struct wSprite23
wSprite24:: sprite_oam_struct wSprite24
wSprite25:: sprite_oam_struct wSprite25
wSprite26:: sprite_oam_struct wSprite26
wSprite27:: sprite_oam_struct wSprite27
wSprite28:: sprite_oam_struct wSprite28
wSprite29:: sprite_oam_struct wSprite29
wSprite30:: sprite_oam_struct wSprite30
wSprite31:: sprite_oam_struct wSprite31
wSprite32:: sprite_oam_struct wSprite32
wSprite33:: sprite_oam_struct wSprite33
wSprite34:: sprite_oam_struct wSprite34
wSprite35:: sprite_oam_struct wSprite35
wSprite36:: sprite_oam_struct wSprite36
wSprite37:: sprite_oam_struct wSprite37
wSprite38:: sprite_oam_struct wSprite38
wSprite39:: sprite_oam_struct wSprite39
wSprite40:: sprite_oam_struct wSprite40
wVirtualOAMSprite00:: sprite_oam_struct wVirtualOAMSprite00
wVirtualOAMSprite01:: sprite_oam_struct wVirtualOAMSprite01
wVirtualOAMSprite02:: sprite_oam_struct wVirtualOAMSprite02
wVirtualOAMSprite03:: sprite_oam_struct wVirtualOAMSprite03
wVirtualOAMSprite04:: sprite_oam_struct wVirtualOAMSprite04
wVirtualOAMSprite05:: sprite_oam_struct wVirtualOAMSprite05
wVirtualOAMSprite06:: sprite_oam_struct wVirtualOAMSprite06
wVirtualOAMSprite07:: sprite_oam_struct wVirtualOAMSprite07
wVirtualOAMSprite08:: sprite_oam_struct wVirtualOAMSprite08
wVirtualOAMSprite09:: sprite_oam_struct wVirtualOAMSprite09
wVirtualOAMSprite10:: sprite_oam_struct wVirtualOAMSprite10
wVirtualOAMSprite11:: sprite_oam_struct wVirtualOAMSprite11
wVirtualOAMSprite12:: sprite_oam_struct wVirtualOAMSprite12
wVirtualOAMSprite13:: sprite_oam_struct wVirtualOAMSprite13
wVirtualOAMSprite14:: sprite_oam_struct wVirtualOAMSprite14
wVirtualOAMSprite15:: sprite_oam_struct wVirtualOAMSprite15
wVirtualOAMSprite16:: sprite_oam_struct wVirtualOAMSprite16
wVirtualOAMSprite17:: sprite_oam_struct wVirtualOAMSprite17
wVirtualOAMSprite18:: sprite_oam_struct wVirtualOAMSprite18
wVirtualOAMSprite19:: sprite_oam_struct wVirtualOAMSprite19
wVirtualOAMSprite20:: sprite_oam_struct wVirtualOAMSprite20
wVirtualOAMSprite21:: sprite_oam_struct wVirtualOAMSprite21
wVirtualOAMSprite22:: sprite_oam_struct wVirtualOAMSprite22
wVirtualOAMSprite23:: sprite_oam_struct wVirtualOAMSprite23
wVirtualOAMSprite24:: sprite_oam_struct wVirtualOAMSprite24
wVirtualOAMSprite25:: sprite_oam_struct wVirtualOAMSprite25
wVirtualOAMSprite26:: sprite_oam_struct wVirtualOAMSprite26
wVirtualOAMSprite27:: sprite_oam_struct wVirtualOAMSprite27
wVirtualOAMSprite28:: sprite_oam_struct wVirtualOAMSprite28
wVirtualOAMSprite29:: sprite_oam_struct wVirtualOAMSprite29
wVirtualOAMSprite30:: sprite_oam_struct wVirtualOAMSprite30
wVirtualOAMSprite31:: sprite_oam_struct wVirtualOAMSprite31
wVirtualOAMSprite32:: sprite_oam_struct wVirtualOAMSprite32
wVirtualOAMSprite33:: sprite_oam_struct wVirtualOAMSprite33
wVirtualOAMSprite34:: sprite_oam_struct wVirtualOAMSprite34
wVirtualOAMSprite35:: sprite_oam_struct wVirtualOAMSprite35
wVirtualOAMSprite36:: sprite_oam_struct wVirtualOAMSprite36
wVirtualOAMSprite37:: sprite_oam_struct wVirtualOAMSprite37
wVirtualOAMSprite38:: sprite_oam_struct wVirtualOAMSprite38
wVirtualOAMSprite39:: sprite_oam_struct wVirtualOAMSprite39
wSpritesEnd::