You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-12-11 05:02:16 -08:00
HDMA transfer functions
This commit is contained in:
@@ -56,7 +56,7 @@ Predef_StartBattle: ; 8c20f
|
||||
ld a, [wLinkMode]
|
||||
cp LINK_MOBILE
|
||||
jr z, .mobile
|
||||
callba Function6454
|
||||
callba ReanchorBGMap_NoOAMUpdate
|
||||
call UpdateSprites
|
||||
call DelayFrame
|
||||
call .NonMobile_LoadPokeballTiles
|
||||
|
||||
@@ -45,7 +45,7 @@ ReturnFromMapSetupScript:: ; b8000
|
||||
ld [wLandmarkSignTimer], a
|
||||
call LoadMapNameSignGFX
|
||||
call InitMapNameFrame
|
||||
callba Function104303
|
||||
callba HDMATransfer_OnlyTopFourRows
|
||||
ret
|
||||
|
||||
.dont_do_map_sign
|
||||
@@ -113,7 +113,7 @@ PlaceMapNameSign:: ; b8098 (2e:4098)
|
||||
jr nz, .skip2
|
||||
call InitMapNameFrame
|
||||
call PlaceMapNameCenterAlign
|
||||
callba Function104303
|
||||
callba HDMATransfer_OnlyTopFourRows
|
||||
.skip2
|
||||
ld a, $80
|
||||
ld a, $70
|
||||
|
||||
@@ -2209,7 +2209,7 @@ Function55e0:: ; 55e0
|
||||
xor a
|
||||
.loop
|
||||
ld [hMapObjectIndexBuffer], a
|
||||
call GetObjectSprite
|
||||
call DoesObjectHaveASprite
|
||||
jr z, .ok
|
||||
call Function565c
|
||||
.ok
|
||||
@@ -2260,7 +2260,7 @@ Function5629: ; 5629
|
||||
cp NUM_OBJECT_STRUCTS
|
||||
ret nc
|
||||
call GetObjectStruct
|
||||
call GetObjectSprite
|
||||
call DoesObjectHaveASprite
|
||||
ret z
|
||||
call Function5673
|
||||
ret
|
||||
@@ -2363,7 +2363,7 @@ Function56a3: ; 56a3
|
||||
; 56cd
|
||||
|
||||
Function56cd: ; 56cd
|
||||
ld a, [wFollowNotExactPersonX]
|
||||
ld a, [wPlayerBGMapOffsetX]
|
||||
ld d, a
|
||||
ld hl, OBJECT_SPRITE_X_OFFSET
|
||||
add hl, bc
|
||||
@@ -2392,7 +2392,7 @@ Function56cd: ; 56cd
|
||||
sub $20
|
||||
.ok3
|
||||
ld [hUsedSpriteIndex], a
|
||||
ld a, [wFollowNotExactPersonY]
|
||||
ld a, [wPlayerBGMapOffsetY]
|
||||
ld e, a
|
||||
ld hl, OBJECT_SPRITE_Y_OFFSET
|
||||
add hl, bc
|
||||
@@ -2489,7 +2489,7 @@ HandleNPCStep:: ; 576a
|
||||
xor a
|
||||
.loop
|
||||
ld [hMapObjectIndexBuffer], a
|
||||
call GetObjectSprite
|
||||
call DoesObjectHaveASprite
|
||||
jr z, .next
|
||||
call Function437b
|
||||
.next
|
||||
@@ -2662,7 +2662,7 @@ Function587a: ; 587a
|
||||
xor a
|
||||
.loop
|
||||
push af
|
||||
call GetObjectSprite
|
||||
call DoesObjectHaveASprite
|
||||
jr z, .next
|
||||
ld hl, OBJECT_FLAGS2
|
||||
add hl, bc
|
||||
@@ -2707,7 +2707,7 @@ Function58b9:: ; 58b9
|
||||
xor a
|
||||
.loop
|
||||
push af
|
||||
call GetObjectSprite
|
||||
call DoesObjectHaveASprite
|
||||
jr z, .next
|
||||
ld hl, OBJECT_FLAGS2
|
||||
add hl, bc
|
||||
@@ -2817,19 +2817,19 @@ _UpdateSprites:: ; 5920
|
||||
ret
|
||||
; 5958
|
||||
|
||||
Function5958: ; 5958
|
||||
ApplyBGMapAnchorToObjects: ; 5958
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
ld a, [wFollowNotExactPersonX]
|
||||
ld a, [wPlayerBGMapOffsetX]
|
||||
ld d, a
|
||||
ld a, [wFollowNotExactPersonY]
|
||||
ld a, [wPlayerBGMapOffsetY]
|
||||
ld e, a
|
||||
ld bc, ObjectStructs
|
||||
ld a, NUM_OBJECT_STRUCTS
|
||||
.loop
|
||||
push af
|
||||
call GetObjectSprite
|
||||
call DoesObjectHaveASprite
|
||||
jr z, .skip
|
||||
ld hl, OBJECT_SPRITE_X
|
||||
add hl, bc
|
||||
@@ -2850,8 +2850,8 @@ Function5958: ; 5958
|
||||
dec a
|
||||
jr nz, .loop
|
||||
xor a
|
||||
ld [wFollowNotExactPersonX], a
|
||||
ld [wFollowNotExactPersonY], a
|
||||
ld [wPlayerBGMapOffsetX], a
|
||||
ld [wPlayerBGMapOffsetY], a
|
||||
pop bc
|
||||
pop de
|
||||
pop hl
|
||||
@@ -2881,7 +2881,7 @@ PRIORITY_HIGH EQU $30
|
||||
ld hl, wMovementPointer
|
||||
.loop
|
||||
push hl
|
||||
call GetObjectSprite
|
||||
call DoesObjectHaveASprite
|
||||
jr z, .skip
|
||||
ld hl, OBJECT_FACING_STEP
|
||||
add hl, bc
|
||||
@@ -2986,7 +2986,7 @@ PRIORITY_HIGH EQU $30
|
||||
add [hl]
|
||||
add 8
|
||||
ld e, a
|
||||
ld a, [wFollowNotExactPersonX]
|
||||
ld a, [wPlayerBGMapOffsetX]
|
||||
add e
|
||||
ld [hFFBF], a
|
||||
ld hl, OBJECT_SPRITE_Y
|
||||
@@ -2997,7 +2997,7 @@ PRIORITY_HIGH EQU $30
|
||||
add [hl]
|
||||
add 12
|
||||
ld e, a
|
||||
ld a, [wFollowNotExactPersonY]
|
||||
ld a, [wPlayerBGMapOffsetY]
|
||||
add e
|
||||
ld [hFFC0], a
|
||||
ld hl, OBJECT_FACING_STEP
|
||||
|
||||
@@ -296,7 +296,7 @@ Function241d5: ; 241d5
|
||||
call Place2DMenuCursor
|
||||
.loop
|
||||
call Move2DMenuCursor
|
||||
call Function10402d ; BUG: This function is in another bank.
|
||||
call HDMATransferTileMapToWRAMBank3 ; BUG: This function is in another bank.
|
||||
; Pointer in current bank (9) is bogus.
|
||||
call .loop2
|
||||
jr nc, .done
|
||||
|
||||
@@ -320,7 +320,7 @@ IsNPCAtCoord: ; 7041
|
||||
xor a
|
||||
.loop
|
||||
ld [hObjectStructIndexBuffer], a
|
||||
call GetObjectSprite
|
||||
call DoesObjectHaveASprite
|
||||
jr z, .next
|
||||
|
||||
ld hl, OBJECT_FLAGS1
|
||||
@@ -490,7 +490,7 @@ Function7113: ; unreferenced
|
||||
xor a
|
||||
.loop
|
||||
ld [hObjectStructIndexBuffer], a
|
||||
call GetObjectSprite
|
||||
call DoesObjectHaveASprite
|
||||
jr z, .next
|
||||
ld hl, OBJECT_MOVEMENTTYPE
|
||||
add hl, bc
|
||||
|
||||
@@ -474,7 +474,7 @@ CopyTempObjectToObjectStruct: ; 8286
|
||||
sub [hl]
|
||||
and $f
|
||||
swap a
|
||||
ld hl, wFollowNotExactPersonY
|
||||
ld hl, wPlayerBGMapOffsetY
|
||||
sub [hl]
|
||||
ld hl, OBJECT_SPRITE_Y
|
||||
add hl, de
|
||||
@@ -492,7 +492,7 @@ CopyTempObjectToObjectStruct: ; 8286
|
||||
sub [hl]
|
||||
and $f
|
||||
swap a
|
||||
ld hl, wFollowNotExactPersonX
|
||||
ld hl, wPlayerBGMapOffsetX
|
||||
sub [hl]
|
||||
ld hl, OBJECT_SPRITE_X
|
||||
add hl, de
|
||||
@@ -660,7 +660,7 @@ FollowNotExact:: ; 839e
|
||||
sub [hl]
|
||||
and $f
|
||||
swap a
|
||||
ld hl, wFollowNotExactPersonX
|
||||
ld hl, wPlayerBGMapOffsetX
|
||||
sub [hl]
|
||||
ld hl, OBJECT_SPRITE_X
|
||||
add hl, de
|
||||
@@ -673,7 +673,7 @@ FollowNotExact:: ; 839e
|
||||
sub [hl]
|
||||
and $f
|
||||
swap a
|
||||
ld hl, wFollowNotExactPersonY
|
||||
ld hl, wPlayerBGMapOffsetY
|
||||
sub [hl]
|
||||
ld hl, OBJECT_SPRITE_Y
|
||||
add hl, de
|
||||
|
||||
@@ -26,12 +26,12 @@ _HandlePlayerStep:: ; d497 (3:5497)
|
||||
ld d, a
|
||||
ld a, [wPlayerStepVectorY]
|
||||
ld e, a
|
||||
ld a, [wFollowNotExactPersonX]
|
||||
ld a, [wPlayerBGMapOffsetX]
|
||||
sub d
|
||||
ld [wFollowNotExactPersonX], a
|
||||
ld a, [wFollowNotExactPersonY]
|
||||
ld [wPlayerBGMapOffsetX], a
|
||||
ld a, [wPlayerBGMapOffsetY]
|
||||
sub e
|
||||
ld [wFollowNotExactPersonY], a
|
||||
ld [wPlayerBGMapOffsetY], a
|
||||
ret
|
||||
|
||||
ScrollScreen:: ; d4d2 (3:54d2)
|
||||
|
||||
@@ -3054,7 +3054,7 @@ Script_loadbytec2cf: ; 97b27
|
||||
Script_closetext: ; 97b2f
|
||||
; script command 0x49
|
||||
|
||||
call Function2e20
|
||||
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
|
||||
call CloseText
|
||||
ret
|
||||
; 97b36
|
||||
|
||||
@@ -5,7 +5,7 @@ StartMenu:: ; 125cd
|
||||
ld de, SFX_MENU
|
||||
call PlaySFX
|
||||
|
||||
callba Function6454
|
||||
callba ReanchorBGMap_NoOAMUpdate
|
||||
|
||||
ld hl, StatusFlags2
|
||||
bit 2, [hl] ; bug catching contest
|
||||
@@ -22,8 +22,8 @@ StartMenu:: ; 125cd
|
||||
call MenuFunc_1e7f
|
||||
call .DrawBugContestStatusBox
|
||||
call Function2e31
|
||||
call Function2e20
|
||||
callba Function64bf
|
||||
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
|
||||
callba LoadFonts_NoOAMUpdate
|
||||
call .DrawBugContestStatus
|
||||
call UpdateTimePals
|
||||
jr .Select
|
||||
|
||||
@@ -129,7 +129,7 @@ StatsScreen_WaitAnim: ; 4dd3a (13:5d3a)
|
||||
.finish
|
||||
ld hl, wcf64
|
||||
res 5, [hl]
|
||||
callba Function10402d
|
||||
callba HDMATransferTileMapToWRAMBank3
|
||||
ret
|
||||
|
||||
StatsScreen_SetJumptableIndex: ; 4dd62 (13:5d62)
|
||||
@@ -149,7 +149,7 @@ MonStatsInit: ; 4dd72 (13:5d72)
|
||||
res 6, [hl]
|
||||
call ClearBGPalettes
|
||||
call ClearTileMap
|
||||
callba Function10402d
|
||||
callba HDMATransferTileMapToWRAMBank3
|
||||
call StatsScreen_CopyToTempMon
|
||||
ld a, [CurPartySpecies]
|
||||
cp EGG
|
||||
@@ -1014,7 +1014,7 @@ EggStatsScreen: ; 4e33a
|
||||
call DelayFrame
|
||||
hlcoord 0, 0
|
||||
call PrepMonFrontpic
|
||||
callba Function10402d
|
||||
callba HDMATransferTileMapToWRAMBank3
|
||||
call StatsScreen_AnimateEgg
|
||||
|
||||
ld a, [TempMonHappiness]
|
||||
|
||||
@@ -250,7 +250,7 @@ Function104770: ; 104770 (41:4770)
|
||||
ld [wBGMapAnchor], a
|
||||
ld [hSCY], a
|
||||
ld [hSCX], a
|
||||
callba Function5958
|
||||
callba ApplyBGMapAnchorToObjects
|
||||
ld a, [rVBK]
|
||||
push af
|
||||
ld a, $1
|
||||
|
||||
Reference in New Issue
Block a user