mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-01-23 09:16:20 -08:00
commit
8c435054a0
@ -1,7 +1,7 @@
|
||||
; wInputType:: ; c2c7
|
||||
AUTO_INPUT EQU $ff
|
||||
|
||||
; wCurrentDexMode:: ; c7d4
|
||||
; wCurDexMode:: ; c7d4
|
||||
const_def
|
||||
const DEXMODE_NEW
|
||||
const DEXMODE_OLD
|
||||
|
@ -32,7 +32,7 @@ CelebiShrineEvent:
|
||||
inc d
|
||||
push de
|
||||
ld a, 36 * SPRITEOAMSTRUCT_LENGTH
|
||||
ld [wCurrSpriteOAMAddr], a
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
farcall DoNextFrameForAllSprites
|
||||
call CelebiEvent_CountDown
|
||||
ld c, 2
|
||||
|
@ -10,15 +10,15 @@ CheckForHiddenItems:
|
||||
add SCREEN_HEIGHT / 4
|
||||
ld [wBuffer3], a
|
||||
; Get the pointer for the first bg_event in the map...
|
||||
ld hl, wCurrMapBGEventsPointer
|
||||
ld hl, wCurMapBGEventsPointer
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
; ... before even checking to see if there are any BG events on this map.
|
||||
ld a, [wCurrMapBGEventCount]
|
||||
ld a, [wCurMapBGEventCount]
|
||||
and a
|
||||
jr z, .nobgeventitems
|
||||
; For i = 1:wCurrMapBGEventCount...
|
||||
; For i = 1:wCurMapBGEventCount...
|
||||
.loop
|
||||
; Store the counter in wBuffer2, and store the bg_event pointer in the stack.
|
||||
ld [wBuffer2], a
|
||||
|
@ -38,7 +38,7 @@ ShakeHeadbuttTree:
|
||||
add hl, bc
|
||||
ld [hl], FIELDMOVE_TREE
|
||||
ld a, 36 * SPRITEOAMSTRUCT_LENGTH
|
||||
ld [wCurrSpriteOAMAddr], a
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
farcall DoNextFrameForAllSprites
|
||||
call HideHeadbuttTree
|
||||
ld a, 32
|
||||
@ -53,7 +53,7 @@ ShakeHeadbuttTree:
|
||||
jr z, .done
|
||||
dec [hl]
|
||||
ld a, 36 * SPRITEOAMSTRUCT_LENGTH
|
||||
ld [wCurrSpriteOAMAddr], a
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
farcall DoNextFrameForAllSprites
|
||||
call DelayFrame
|
||||
jr .loop
|
||||
@ -126,7 +126,7 @@ OWCutAnimation:
|
||||
bit 7, a
|
||||
jr nz, .finish
|
||||
ld a, 36 * SPRITEOAMSTRUCT_LENGTH
|
||||
ld [wCurrSpriteOAMAddr], a
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
callfar DoNextFrameForAllSprites
|
||||
call OWCutJumptable
|
||||
call DelayFrame
|
||||
@ -328,7 +328,7 @@ FlyFromAnim:
|
||||
bit 7, a
|
||||
jr nz, .exit
|
||||
ld a, 0 * SPRITEOAMSTRUCT_LENGTH
|
||||
ld [wCurrSpriteOAMAddr], a
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
callfar DoNextFrameForAllSprites
|
||||
call FlyFunction_FrameTimer
|
||||
call DelayFrame
|
||||
@ -365,7 +365,7 @@ FlyToAnim:
|
||||
bit 7, a
|
||||
jr nz, .exit
|
||||
ld a, 0 * SPRITEOAMSTRUCT_LENGTH
|
||||
ld [wCurrSpriteOAMAddr], a
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
callfar DoNextFrameForAllSprites
|
||||
call FlyFunction_FrameTimer
|
||||
call DelayFrame
|
||||
|
@ -13,7 +13,7 @@ ReturnFromMapSetupScript::
|
||||
ld a, [wMapNumber]
|
||||
ld c, a
|
||||
call GetWorldMapLocation
|
||||
ld [wCurrentLandmark], a
|
||||
ld [wCurLandmark], a
|
||||
call .CheckNationalParkGate
|
||||
jr z, .nationalparkgate
|
||||
|
||||
@ -23,7 +23,7 @@ ReturnFromMapSetupScript::
|
||||
|
||||
.nationalparkgate
|
||||
ld a, -1
|
||||
ld [wCurrentLandmark], a
|
||||
ld [wCurLandmark], a
|
||||
|
||||
.not_gate
|
||||
ld hl, wEnteredMapFromContinue
|
||||
@ -33,8 +33,8 @@ ReturnFromMapSetupScript::
|
||||
|
||||
call .CheckMovingWithinLandmark
|
||||
jr z, .dont_do_map_sign
|
||||
ld a, [wCurrentLandmark]
|
||||
ld [wPreviousLandmark], a
|
||||
ld a, [wCurLandmark]
|
||||
ld [wPrevLandmark], a
|
||||
|
||||
call .CheckSpecialMap
|
||||
jr z, .dont_do_map_sign
|
||||
@ -48,8 +48,8 @@ ReturnFromMapSetupScript::
|
||||
ret
|
||||
|
||||
.dont_do_map_sign
|
||||
ld a, [wCurrentLandmark]
|
||||
ld [wPreviousLandmark], a
|
||||
ld a, [wCurLandmark]
|
||||
ld [wPrevLandmark], a
|
||||
ld a, $90
|
||||
ldh [rWY], a
|
||||
ldh [hWY], a
|
||||
@ -58,9 +58,9 @@ ReturnFromMapSetupScript::
|
||||
ret
|
||||
|
||||
.CheckMovingWithinLandmark:
|
||||
ld a, [wCurrentLandmark]
|
||||
ld a, [wCurLandmark]
|
||||
ld c, a
|
||||
ld a, [wPreviousLandmark]
|
||||
ld a, [wPrevLandmark]
|
||||
cp c
|
||||
ret z
|
||||
cp SPECIAL_MAP
|
||||
@ -140,7 +140,7 @@ InitMapNameFrame:
|
||||
ret
|
||||
|
||||
PlaceMapNameCenterAlign:
|
||||
ld a, [wCurrentLandmark]
|
||||
ld a, [wCurLandmark]
|
||||
ld e, a
|
||||
farcall GetLandmarkName
|
||||
call .GetNameLength
|
||||
|
@ -38,7 +38,7 @@ MomTriesToBuySomething::
|
||||
inc [hl]
|
||||
.ok
|
||||
ld a, PHONE_MOM
|
||||
ld [wCurrentCaller], a
|
||||
ld [wCurCaller], a
|
||||
ld bc, wEngineBuffer2
|
||||
ld hl, 0
|
||||
add hl, bc
|
||||
|
@ -182,7 +182,7 @@ SlotsLoop:
|
||||
call SlotsJumptable
|
||||
call Slots_SpinReels
|
||||
xor a
|
||||
ld [wCurrSpriteOAMAddr], a
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
callfar DoNextFrameForFirst16Sprites
|
||||
call .PrintCoinsAndPayout
|
||||
call .Stubbed_Function927d3
|
||||
@ -778,9 +778,9 @@ Slots_UpdateReelPositionAndOAM:
|
||||
ld hl, REEL_X_COORD
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld [wCurrReelXCoord], a
|
||||
ld [wCurReelXCoord], a
|
||||
ld a, 10 * 8
|
||||
ld [wCurrReelYCoord], a
|
||||
ld [wCurReelYCoord], a
|
||||
ld hl, REEL_POSITION
|
||||
add hl, bc
|
||||
ld e, [hl]
|
||||
@ -813,9 +813,9 @@ Slots_UpdateReelPositionAndOAM:
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
.loop
|
||||
ld a, [wCurrReelYCoord]
|
||||
ld a, [wCurReelYCoord]
|
||||
ld [hli], a ; y
|
||||
ld a, [wCurrReelXCoord]
|
||||
ld a, [wCurReelXCoord]
|
||||
ld [hli], a ; x
|
||||
ld a, [de]
|
||||
ld [hli], a ; tile id
|
||||
@ -824,9 +824,9 @@ Slots_UpdateReelPositionAndOAM:
|
||||
set OAM_PRIORITY, a
|
||||
ld [hli], a ; attributes
|
||||
|
||||
ld a, [wCurrReelYCoord]
|
||||
ld a, [wCurReelYCoord]
|
||||
ld [hli], a ; y
|
||||
ld a, [wCurrReelXCoord]
|
||||
ld a, [wCurReelXCoord]
|
||||
add 1 * TILE_WIDTH
|
||||
ld [hli], a ; x
|
||||
ld a, [de]
|
||||
@ -838,9 +838,9 @@ Slots_UpdateReelPositionAndOAM:
|
||||
set OAM_PRIORITY, a
|
||||
ld [hli], a ; attributes
|
||||
inc de
|
||||
ld a, [wCurrReelYCoord]
|
||||
ld a, [wCurReelYCoord]
|
||||
sub 2 * TILE_WIDTH
|
||||
ld [wCurrReelYCoord], a
|
||||
ld [wCurReelYCoord], a
|
||||
cp 2 * TILE_WIDTH
|
||||
jr nz, .loop
|
||||
ret
|
||||
@ -1412,35 +1412,35 @@ Slots_CheckMatchedFirstTwoReels:
|
||||
ret
|
||||
|
||||
.CheckBottomRow:
|
||||
ld hl, wCurrReelStopped
|
||||
ld hl, wCurReelStopped
|
||||
ld a, [wReel1Stopped]
|
||||
cp [hl]
|
||||
call z, .StoreResult
|
||||
ret
|
||||
|
||||
.CheckUpwardsDiag:
|
||||
ld hl, wCurrReelStopped + 1
|
||||
ld hl, wCurReelStopped + 1
|
||||
ld a, [wReel1Stopped]
|
||||
cp [hl]
|
||||
call z, .StoreResult
|
||||
ret
|
||||
|
||||
.CheckMiddleRow:
|
||||
ld hl, wCurrReelStopped + 1
|
||||
ld hl, wCurReelStopped + 1
|
||||
ld a, [wReel1Stopped + 1]
|
||||
cp [hl]
|
||||
call z, .StoreResult
|
||||
ret
|
||||
|
||||
.CheckDownwardsDiag:
|
||||
ld hl, wCurrReelStopped + 1
|
||||
ld hl, wCurReelStopped + 1
|
||||
ld a, [wReel1Stopped + 2]
|
||||
cp [hl]
|
||||
call z, .StoreResult
|
||||
ret
|
||||
|
||||
.CheckTopRow:
|
||||
ld hl, wCurrReelStopped + 2
|
||||
ld hl, wCurReelStopped + 2
|
||||
ld a, [wReel1Stopped + 2]
|
||||
cp [hl]
|
||||
call z, .StoreResult
|
||||
@ -1509,7 +1509,7 @@ Slots_CheckMatchedAllThreeReels:
|
||||
ret
|
||||
|
||||
.CheckBottomRow:
|
||||
ld hl, wCurrReelStopped
|
||||
ld hl, wCurReelStopped
|
||||
ld a, [wReel1Stopped]
|
||||
cp [hl]
|
||||
ret nz
|
||||
@ -1519,7 +1519,7 @@ Slots_CheckMatchedAllThreeReels:
|
||||
ret
|
||||
|
||||
.CheckUpwardsDiag:
|
||||
ld hl, wCurrReelStopped + 2
|
||||
ld hl, wCurReelStopped + 2
|
||||
ld a, [wReel1Stopped]
|
||||
cp [hl]
|
||||
ret nz
|
||||
@ -1529,7 +1529,7 @@ Slots_CheckMatchedAllThreeReels:
|
||||
ret
|
||||
|
||||
.CheckMiddleRow:
|
||||
ld hl, wCurrReelStopped + 1
|
||||
ld hl, wCurReelStopped + 1
|
||||
ld a, [wReel1Stopped + 1]
|
||||
cp [hl]
|
||||
ret nz
|
||||
@ -1539,7 +1539,7 @@ Slots_CheckMatchedAllThreeReels:
|
||||
ret
|
||||
|
||||
.CheckDownwardsDiag:
|
||||
ld hl, wCurrReelStopped
|
||||
ld hl, wCurReelStopped
|
||||
ld a, [wReel1Stopped + 2]
|
||||
cp [hl]
|
||||
ret nz
|
||||
@ -1549,7 +1549,7 @@ Slots_CheckMatchedAllThreeReels:
|
||||
ret
|
||||
|
||||
.CheckTopRow:
|
||||
ld hl, wCurrReelStopped + 2
|
||||
ld hl, wCurReelStopped + 2
|
||||
ld a, [wReel1Stopped + 2]
|
||||
cp [hl]
|
||||
ret nz
|
||||
@ -1563,7 +1563,7 @@ Slots_CheckMatchedAllThreeReels:
|
||||
ret
|
||||
|
||||
Slots_CopyReelState:
|
||||
ld de, wCurrReelStopped
|
||||
ld de, wCurReelStopped
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
inc de
|
||||
|
@ -22,7 +22,7 @@ PlaySpriteAnimations:
|
||||
push af
|
||||
|
||||
ld a, LOW(wVirtualOAM)
|
||||
ld [wCurrSpriteOAMAddr], a
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
call DoNextFrameForAllSprites
|
||||
|
||||
pop af
|
||||
@ -55,11 +55,11 @@ DoNextFrameForAllSprites:
|
||||
dec e
|
||||
jr nz, .loop
|
||||
|
||||
ld a, [wCurrSpriteOAMAddr]
|
||||
ld a, [wCurSpriteOAMAddr]
|
||||
ld l, a
|
||||
ld h, HIGH(wVirtualOAM)
|
||||
|
||||
.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> wVirtualOAMEnd)
|
||||
.loop2 ; Clear (wVirtualOAM + [wCurSpriteOAMAddr] --> wVirtualOAMEnd)
|
||||
ld a, l
|
||||
cp LOW(wVirtualOAMEnd)
|
||||
jr nc, .done
|
||||
@ -94,11 +94,11 @@ DoNextFrameForFirst16Sprites:
|
||||
dec e
|
||||
jr nz, .loop
|
||||
|
||||
ld a, [wCurrSpriteOAMAddr]
|
||||
ld a, [wCurSpriteOAMAddr]
|
||||
ld l, a
|
||||
ld h, HIGH(wVirtualOAMSprite16)
|
||||
|
||||
.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> Sprites + $40)
|
||||
.loop2 ; Clear (wVirtualOAM + [wCurSpriteOAMAddr] --> Sprites + $40)
|
||||
ld a, l
|
||||
cp LOW(wVirtualOAMSprite16)
|
||||
jr nc, .done
|
||||
@ -233,27 +233,27 @@ UpdateAnimFrame:
|
||||
cp -4
|
||||
jr z, .delete
|
||||
call GetFrameOAMPointer
|
||||
; add byte to [wCurrAnimVTile]
|
||||
ld a, [wCurrAnimVTile]
|
||||
; add byte to [wCurAnimVTile]
|
||||
ld a, [wCurAnimVTile]
|
||||
add [hl]
|
||||
ld [wCurrAnimVTile], a
|
||||
ld [wCurAnimVTile], a
|
||||
inc hl
|
||||
; load pointer into hl
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
push bc
|
||||
ld a, [wCurrSpriteOAMAddr]
|
||||
ld a, [wCurSpriteOAMAddr]
|
||||
ld e, a
|
||||
ld d, HIGH(wVirtualOAM)
|
||||
ld a, [hli]
|
||||
ld c, a ; number of objects
|
||||
.loop
|
||||
; first byte: y (px)
|
||||
; [de] = [wCurrAnimYCoord] + [wCurrAnimYOffset] + [wGlobalAnimYOffset] + AddOrSubtractY([hl])
|
||||
ld a, [wCurrAnimYCoord]
|
||||
; [de] = [wCurAnimYCoord] + [wCurAnimYOffset] + [wGlobalAnimYOffset] + AddOrSubtractY([hl])
|
||||
ld a, [wCurAnimYCoord]
|
||||
ld b, a
|
||||
ld a, [wCurrAnimYOffset]
|
||||
ld a, [wCurAnimYOffset]
|
||||
add b
|
||||
ld b, a
|
||||
ld a, [wGlobalAnimYOffset]
|
||||
@ -265,10 +265,10 @@ UpdateAnimFrame:
|
||||
inc hl
|
||||
inc de
|
||||
; second byte: x (px)
|
||||
; [de] = [wCurrAnimXCoord] + [wCurrAnimXOffset] + [wGlobalAnimXOffset] + AddOrSubtractX([hl])
|
||||
ld a, [wCurrAnimXCoord]
|
||||
; [de] = [wCurAnimXCoord] + [wCurAnimXOffset] + [wGlobalAnimXOffset] + AddOrSubtractX([hl])
|
||||
ld a, [wCurAnimXCoord]
|
||||
ld b, a
|
||||
ld a, [wCurrAnimXOffset]
|
||||
ld a, [wCurAnimXOffset]
|
||||
add b
|
||||
ld b, a
|
||||
ld a, [wGlobalAnimXOffset]
|
||||
@ -280,8 +280,8 @@ UpdateAnimFrame:
|
||||
inc hl
|
||||
inc de
|
||||
; third byte: vtile
|
||||
; [de] = [wCurrAnimVTile] + [hl]
|
||||
ld a, [wCurrAnimVTile]
|
||||
; [de] = [wCurAnimVTile] + [hl]
|
||||
ld a, [wCurAnimVTile]
|
||||
add [hl]
|
||||
ld [de], a
|
||||
inc hl
|
||||
@ -293,7 +293,7 @@ UpdateAnimFrame:
|
||||
inc hl
|
||||
inc de
|
||||
ld a, e
|
||||
ld [wCurrSpriteOAMAddr], a
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
cp LOW(wVirtualOAMEnd)
|
||||
jr nc, .reached_the_end
|
||||
dec c
|
||||
@ -315,7 +315,7 @@ UpdateAnimFrame:
|
||||
AddOrSubtractY:
|
||||
push hl
|
||||
ld a, [hl]
|
||||
ld hl, wCurrSpriteAddSubFlags
|
||||
ld hl, wCurSpriteAddSubFlags
|
||||
bit 6, [hl]
|
||||
jr z, .ok
|
||||
; 8 - a
|
||||
@ -330,7 +330,7 @@ AddOrSubtractY:
|
||||
AddOrSubtractX:
|
||||
push hl
|
||||
ld a, [hl]
|
||||
ld hl, wCurrSpriteAddSubFlags
|
||||
ld hl, wCurSpriteAddSubFlags
|
||||
bit 5, [hl] ; x flip
|
||||
jr z, .ok
|
||||
; 8 - a
|
||||
@ -343,7 +343,7 @@ AddOrSubtractX:
|
||||
ret
|
||||
|
||||
GetSpriteOAMAttr:
|
||||
ld a, [wCurrSpriteAddSubFlags]
|
||||
ld a, [wCurSpriteAddSubFlags]
|
||||
ld b, a
|
||||
ld a, [hl]
|
||||
xor b
|
||||
@ -356,19 +356,19 @@ GetSpriteOAMAttr:
|
||||
|
||||
InitSpriteAnimBuffer:
|
||||
xor a
|
||||
ld [wCurrSpriteAddSubFlags], a
|
||||
ld [wCurSpriteAddSubFlags], a
|
||||
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
ld [wCurrAnimVTile], a
|
||||
ld [wCurAnimVTile], a
|
||||
ld a, [hli]
|
||||
ld [wCurrAnimXCoord], a
|
||||
ld [wCurAnimXCoord], a
|
||||
ld a, [hli]
|
||||
ld [wCurrAnimYCoord], a
|
||||
ld [wCurAnimYCoord], a
|
||||
ld a, [hli]
|
||||
ld [wCurrAnimXOffset], a
|
||||
ld [wCurAnimXOffset], a
|
||||
ld a, [hli]
|
||||
ld [wCurrAnimYOffset], a
|
||||
ld [wCurAnimYOffset], a
|
||||
ret
|
||||
|
||||
GetSpriteAnimVTile:
|
||||
@ -448,7 +448,7 @@ GetSpriteAnimFrame:
|
||||
ld a, [hl]
|
||||
and $c0
|
||||
srl a
|
||||
ld [wCurrSpriteAddSubFlags], a
|
||||
ld [wCurSpriteAddSubFlags], a
|
||||
pop af
|
||||
ret
|
||||
|
||||
|
@ -26,7 +26,7 @@ Pack:
|
||||
jr .loop
|
||||
|
||||
.done
|
||||
ld a, [wCurrPocket]
|
||||
ld a, [wCurPocket]
|
||||
ld [wLastPocket], a
|
||||
ld hl, wOptions
|
||||
res NO_TEXT_SCROLL, [hl]
|
||||
@ -63,7 +63,7 @@ Pack:
|
||||
|
||||
.InitItemsPocket:
|
||||
xor a ; ITEM_POCKET
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
call ClearPocketList
|
||||
call DrawPocketName
|
||||
call WaitBGMap_DrawPackGFX
|
||||
@ -91,7 +91,7 @@ Pack:
|
||||
|
||||
.InitKeyItemsPocket:
|
||||
ld a, KEY_ITEM_POCKET
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
call ClearPocketList
|
||||
call DrawPocketName
|
||||
call WaitBGMap_DrawPackGFX
|
||||
@ -119,7 +119,7 @@ Pack:
|
||||
|
||||
.InitTMHMPocket:
|
||||
ld a, TM_HM_POCKET
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
call ClearPocketList
|
||||
call DrawPocketName
|
||||
xor a
|
||||
@ -213,7 +213,7 @@ Pack:
|
||||
|
||||
.InitBallsPocket:
|
||||
ld a, BALL_POCKET
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
call ClearPocketList
|
||||
call DrawPocketName
|
||||
call WaitBGMap_DrawPackGFX
|
||||
@ -500,7 +500,7 @@ TossMenu:
|
||||
ret
|
||||
|
||||
Unreferenced_ResetPocketCursorPositions:
|
||||
ld a, [wCurrPocket]
|
||||
ld a, [wCurPocket]
|
||||
and a ; ITEM_POCKET
|
||||
jr z, .items
|
||||
dec a ; BALL_POCKET
|
||||
@ -532,7 +532,7 @@ RegisterItem:
|
||||
ld a, [wItemAttributeParamBuffer]
|
||||
and a
|
||||
jr nz, .cant_register
|
||||
ld a, [wCurrPocket]
|
||||
ld a, [wCurPocket]
|
||||
rrca
|
||||
rrca
|
||||
and REGISTERED_POCKET
|
||||
@ -636,7 +636,7 @@ BattlePack:
|
||||
jr .loop
|
||||
|
||||
.end
|
||||
ld a, [wCurrPocket]
|
||||
ld a, [wCurPocket]
|
||||
ld [wLastPocket], a
|
||||
ld hl, wOptions
|
||||
res NO_TEXT_SCROLL, [hl]
|
||||
@ -673,7 +673,7 @@ BattlePack:
|
||||
|
||||
.InitItemsPocket:
|
||||
xor a ; ITEM_POCKET
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
call ClearPocketList
|
||||
call DrawPocketName
|
||||
call WaitBGMap_DrawPackGFX
|
||||
@ -701,7 +701,7 @@ BattlePack:
|
||||
|
||||
.InitKeyItemsPocket:
|
||||
ld a, KEY_ITEM_POCKET
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
call ClearPocketList
|
||||
call DrawPocketName
|
||||
call WaitBGMap_DrawPackGFX
|
||||
@ -729,7 +729,7 @@ BattlePack:
|
||||
|
||||
.InitTMHMPocket:
|
||||
ld a, TM_HM_POCKET
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
call ClearPocketList
|
||||
call DrawPocketName
|
||||
xor a
|
||||
@ -752,7 +752,7 @@ BattlePack:
|
||||
|
||||
.InitBallsPocket:
|
||||
ld a, BALL_POCKET
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
call ClearPocketList
|
||||
call DrawPocketName
|
||||
call WaitBGMap_DrawPackGFX
|
||||
@ -903,7 +903,7 @@ InitPackBuffers:
|
||||
; pocket id -> jumptable index
|
||||
ld a, [wLastPocket]
|
||||
maskbits NUM_POCKETS
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
inc a
|
||||
add a
|
||||
dec a
|
||||
@ -919,7 +919,7 @@ DepositSellInitPackBuffers:
|
||||
ldh [hBGMapMode], a
|
||||
ld [wJumptableIndex], a ; PACKSTATE_INITGFX
|
||||
ld [wPackJumptableIndex], a ; PACKSTATE_INITGFX
|
||||
ld [wCurrPocket], a ; ITEM_POCKET
|
||||
ld [wCurPocket], a ; ITEM_POCKET
|
||||
ld [wPackUsedItem], a
|
||||
ld [wSwitchItem], a
|
||||
call Pack_InitGFX
|
||||
@ -1004,7 +1004,7 @@ DepositSellPack:
|
||||
ret
|
||||
|
||||
InitPocket:
|
||||
ld [wCurrPocket], a
|
||||
ld [wCurPocket], a
|
||||
call ClearPocketList
|
||||
call DrawPocketName
|
||||
call WaitBGMap_DrawPackGFX
|
||||
@ -1209,7 +1209,7 @@ Pack_PrintTextNoScroll:
|
||||
WaitBGMap_DrawPackGFX:
|
||||
call WaitBGMap
|
||||
DrawPackGFX:
|
||||
ld a, [wCurrPocket]
|
||||
ld a, [wCurPocket]
|
||||
maskbits NUM_POCKETS
|
||||
ld e, a
|
||||
ld d, 0
|
||||
@ -1381,7 +1381,7 @@ PlacePackGFX:
|
||||
ret
|
||||
|
||||
DrawPocketName:
|
||||
ld a, [wCurrPocket]
|
||||
ld a, [wCurPocket]
|
||||
; * 15
|
||||
ld d, a
|
||||
swap a
|
||||
|
@ -4,7 +4,7 @@ _Multiply::
|
||||
ld b, a
|
||||
|
||||
xor a
|
||||
ldh [hProduct], a
|
||||
ldh [hMultiplicand - 1], a
|
||||
ldh [hMathBuffer + 1], a
|
||||
ldh [hMathBuffer + 2], a
|
||||
ldh [hMathBuffer + 3], a
|
||||
@ -36,7 +36,7 @@ _Multiply::
|
||||
|
||||
ldh a, [hMathBuffer + 1]
|
||||
ld c, a
|
||||
ldh a, [hProduct]
|
||||
ldh a, [hMultiplicand - 1]
|
||||
adc c
|
||||
ldh [hMathBuffer + 1], a
|
||||
|
||||
@ -58,9 +58,9 @@ _Multiply::
|
||||
rla
|
||||
ldh [hMultiplicand + 0], a
|
||||
|
||||
ldh a, [hProduct]
|
||||
ldh a, [hMultiplicand - 1]
|
||||
rla
|
||||
ldh [hProduct], a
|
||||
ldh [hMultiplicand - 1], a
|
||||
|
||||
jr .loop
|
||||
|
||||
|
@ -67,7 +67,7 @@ NewGame:
|
||||
call OakSpeech
|
||||
call InitializeWorld
|
||||
ld a, 1
|
||||
ld [wPreviousLandmark], a
|
||||
ld [wPrevLandmark], a
|
||||
|
||||
ld a, SPAWN_HOME
|
||||
ld [wDefaultSpawnpoint], a
|
||||
|
@ -672,7 +672,7 @@ NamingScreen_TryAddCharacter:
|
||||
MailComposition_TryAddCharacter:
|
||||
ld a, [wNamingScreenMaxNameLength]
|
||||
ld c, a
|
||||
ld a, [wNamingScreenCurrNameLength]
|
||||
ld a, [wNamingScreenCurNameLength]
|
||||
cp c
|
||||
ret nc
|
||||
|
||||
@ -683,7 +683,7 @@ NamingScreen_LoadNextCharacter:
|
||||
ld [hl], a
|
||||
|
||||
NamingScreen_AdvanceCursor_CheckEndOfString:
|
||||
ld hl, wNamingScreenCurrNameLength
|
||||
ld hl, wNamingScreenCurNameLength
|
||||
inc [hl]
|
||||
call NamingScreen_GetTextCursorPosition
|
||||
ld a, [hl]
|
||||
@ -698,11 +698,11 @@ NamingScreen_AdvanceCursor_CheckEndOfString:
|
||||
ret
|
||||
|
||||
; unused
|
||||
ld a, [wNamingScreenCurrNameLength]
|
||||
ld a, [wNamingScreenCurNameLength]
|
||||
and a
|
||||
ret z
|
||||
push hl
|
||||
ld hl, wNamingScreenCurrNameLength
|
||||
ld hl, wNamingScreenCurNameLength
|
||||
dec [hl]
|
||||
call NamingScreen_GetTextCursorPosition
|
||||
ld c, [hl]
|
||||
@ -724,7 +724,7 @@ NamingScreen_AdvanceCursor_CheckEndOfString:
|
||||
INCLUDE "data/text/unused_dakutens.asm"
|
||||
|
||||
NamingScreen_DeleteCharacter:
|
||||
ld hl, wNamingScreenCurrNameLength
|
||||
ld hl, wNamingScreenCurNameLength
|
||||
ld a, [hl]
|
||||
and a
|
||||
ret z
|
||||
@ -744,7 +744,7 @@ NamingScreen_GetTextCursorPosition:
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld a, [wNamingScreenCurrNameLength]
|
||||
ld a, [wNamingScreenCurNameLength]
|
||||
ld e, a
|
||||
ld d, 0
|
||||
add hl, de
|
||||
@ -874,7 +874,7 @@ LoadNamingScreenGFX:
|
||||
ld [wJumptableIndex], a
|
||||
ld [wNamingScreenLetterCase], a
|
||||
ldh [hBGMapMode], a
|
||||
ld [wNamingScreenCurrNameLength], a
|
||||
ld [wNamingScreenCurNameLength], a
|
||||
ld a, $7
|
||||
ldh [hWX], a
|
||||
ret
|
||||
@ -1109,7 +1109,7 @@ INCBIN "gfx/icons/mail_big.2bpp"
|
||||
call NamingScreen_GetLastCharacter
|
||||
call MailComposition_TryAddLastCharacter
|
||||
jr c, .start
|
||||
ld hl, wNamingScreenCurrNameLength
|
||||
ld hl, wNamingScreenCurNameLength
|
||||
ld a, [hl]
|
||||
cp MAIL_LINE_LENGTH
|
||||
ret nz
|
||||
@ -1135,7 +1135,7 @@ INCBIN "gfx/icons/mail_big.2bpp"
|
||||
|
||||
.b
|
||||
call NamingScreen_DeleteCharacter
|
||||
ld hl, wNamingScreenCurrNameLength
|
||||
ld hl, wNamingScreenCurNameLength
|
||||
ld a, [hl]
|
||||
cp MAIL_LINE_LENGTH
|
||||
ret nz
|
||||
@ -1350,20 +1350,20 @@ MailComposition_TryAddLastCharacter:
|
||||
jp MailComposition_TryAddCharacter
|
||||
|
||||
; unused
|
||||
ld a, [wNamingScreenCurrNameLength]
|
||||
ld a, [wNamingScreenCurNameLength]
|
||||
and a
|
||||
ret z
|
||||
cp $11
|
||||
jr nz, .asm_121c3
|
||||
push hl
|
||||
ld hl, wNamingScreenCurrNameLength
|
||||
ld hl, wNamingScreenCurNameLength
|
||||
dec [hl]
|
||||
dec [hl]
|
||||
jr .asm_121c8
|
||||
|
||||
.asm_121c3
|
||||
push hl
|
||||
ld hl, wNamingScreenCurrNameLength
|
||||
ld hl, wNamingScreenCurNameLength
|
||||
dec [hl]
|
||||
|
||||
.asm_121c8
|
||||
|
@ -489,9 +489,9 @@ SavePlayerData:
|
||||
ld de, sPlayerData
|
||||
ld bc, wPlayerDataEnd - wPlayerData
|
||||
call CopyBytes
|
||||
ld hl, wCurrMapData
|
||||
ld de, sCurrMapData
|
||||
ld bc, wCurrMapDataEnd - wCurrMapData
|
||||
ld hl, wCurMapData
|
||||
ld de, sCurMapData
|
||||
ld bc, wCurMapDataEnd - wCurMapData
|
||||
call CopyBytes
|
||||
jp CloseSRAM
|
||||
|
||||
@ -550,9 +550,9 @@ SaveBackupPlayerData:
|
||||
ld de, sBackupPlayerData
|
||||
ld bc, wPlayerDataEnd - wPlayerData
|
||||
call CopyBytes
|
||||
ld hl, wCurrMapData
|
||||
ld de, sBackupCurrMapData
|
||||
ld bc, wCurrMapDataEnd - wCurrMapData
|
||||
ld hl, wCurMapData
|
||||
ld de, sBackupCurMapData
|
||||
ld bc, wCurMapDataEnd - wCurMapData
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ret
|
||||
@ -724,9 +724,9 @@ LoadPlayerData:
|
||||
ld de, wPlayerData
|
||||
ld bc, wPlayerDataEnd - wPlayerData
|
||||
call CopyBytes
|
||||
ld hl, sCurrMapData
|
||||
ld de, wCurrMapData
|
||||
ld bc, wCurrMapDataEnd - wCurrMapData
|
||||
ld hl, sCurMapData
|
||||
ld de, wCurMapData
|
||||
ld bc, wCurMapDataEnd - wCurMapData
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld a, BANK(sBattleTowerChallengeState)
|
||||
@ -779,9 +779,9 @@ LoadBackupPlayerData:
|
||||
ld de, wPlayerData
|
||||
ld bc, wPlayerDataEnd - wPlayerData
|
||||
call CopyBytes
|
||||
ld hl, sBackupCurrMapData
|
||||
ld de, wCurrMapData
|
||||
ld bc, wCurrMapDataEnd - wCurrMapData
|
||||
ld hl, sBackupCurMapData
|
||||
ld de, wCurMapData
|
||||
ld bc, wCurMapDataEnd - wCurMapData
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ret
|
||||
|
@ -401,7 +401,7 @@ Dummy_CheckScriptFlags3Bit5:
|
||||
ret
|
||||
|
||||
RunSceneScript:
|
||||
ld a, [wCurrMapSceneScriptCount]
|
||||
ld a, [wCurMapSceneScriptCount]
|
||||
and a
|
||||
jr z, .nope
|
||||
|
||||
@ -412,7 +412,7 @@ RunSceneScript:
|
||||
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, wCurrMapSceneScriptsPointer
|
||||
ld hl, wCurMapSceneScriptsPointer
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
|
@ -61,7 +61,7 @@ _GetVarAction::
|
||||
dwb wSpecialPhoneCallID, RETVAR_STRBUF2
|
||||
dwb wNrOfBeatenBattleTowerTrainers, RETVAR_STRBUF2
|
||||
dwb wKurtApricornQuantity, RETVAR_STRBUF2
|
||||
dwb wCurrentCaller, RETVAR_ADDR_DE
|
||||
dwb wCurCaller, RETVAR_ADDR_DE
|
||||
dwb wBlueCardBalance, RETVAR_ADDR_DE
|
||||
dwb wBuenasPassword, RETVAR_ADDR_DE
|
||||
dwb wKenjiBreakTimer, RETVAR_STRBUF2
|
||||
|
@ -738,14 +738,14 @@ JumpRoamMon:
|
||||
ret
|
||||
|
||||
_BackUpMapIndices:
|
||||
ld a, [wRoamMons_CurrentMapNumber]
|
||||
ld a, [wRoamMons_CurMapNumber]
|
||||
ld [wRoamMons_LastMapNumber], a
|
||||
ld a, [wRoamMons_CurrentMapGroup]
|
||||
ld a, [wRoamMons_CurMapGroup]
|
||||
ld [wRoamMons_LastMapGroup], a
|
||||
ld a, [wMapNumber]
|
||||
ld [wRoamMons_CurrentMapNumber], a
|
||||
ld [wRoamMons_CurMapNumber], a
|
||||
ld a, [wMapGroup]
|
||||
ld [wRoamMons_CurrentMapGroup], a
|
||||
ld [wRoamMons_CurMapGroup], a
|
||||
ret
|
||||
|
||||
INCLUDE "data/wild/roammon_maps.asm"
|
||||
|
@ -321,7 +321,7 @@ Function90199:
|
||||
jr nz, .OutOfArea
|
||||
; If the person can't take a call at that time, don't do the call
|
||||
ld a, b
|
||||
ld [wCurrentCaller], a
|
||||
ld [wCurCaller], a
|
||||
ld hl, PhoneContacts
|
||||
ld bc, PHONE_TABLE_WIDTH
|
||||
call AddNTimes
|
||||
@ -389,7 +389,7 @@ LoadCallerScript:
|
||||
nop
|
||||
nop
|
||||
ld a, e
|
||||
ld [wCurrentCaller], a
|
||||
ld [wCurCaller], a
|
||||
and a
|
||||
jr nz, .actualcaller
|
||||
ld a, BANK(WrongNumber)
|
||||
@ -463,7 +463,7 @@ RingTwice_StartCall:
|
||||
ret
|
||||
|
||||
Phone_CallerTextboxWithName:
|
||||
ld a, [wCurrentCaller]
|
||||
ld a, [wCurCaller]
|
||||
ld b, a
|
||||
call Function90363
|
||||
ret
|
||||
@ -680,12 +680,12 @@ Phone_GetTrainerClassName:
|
||||
ret
|
||||
|
||||
GetCallerLocation:
|
||||
ld a, [wCurrentCaller]
|
||||
ld a, [wCurCaller]
|
||||
call GetCallerTrainerClass
|
||||
ld d, c
|
||||
ld e, b
|
||||
push de
|
||||
ld a, [wCurrentCaller]
|
||||
ld a, [wCurCaller]
|
||||
ld hl, PhoneContacts + PHONE_CONTACT_MAP_GROUP
|
||||
ld bc, PHONE_TABLE_WIDTH
|
||||
call AddNTimes
|
||||
|
@ -58,7 +58,7 @@ Pokedex:
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
call ClearSprites
|
||||
ld a, [wCurrentDexMode]
|
||||
ld a, [wCurDexMode]
|
||||
ld [wLastDexMode], a
|
||||
|
||||
pop af
|
||||
@ -96,7 +96,7 @@ InitPokedex:
|
||||
call Pokedex_CheckUnlockedUnownMode
|
||||
|
||||
ld a, [wLastDexMode]
|
||||
ld [wCurrentDexMode], a
|
||||
ld [wCurDexMode], a
|
||||
|
||||
call Pokedex_OrderMonsByMode
|
||||
call Pokedex_InitCursorPosition
|
||||
@ -178,7 +178,7 @@ Pokedex_GetLandmark:
|
||||
call GetWorldMapLocation
|
||||
|
||||
.load
|
||||
ld [wDexCurrentLocation], a
|
||||
ld [wDexCurLocation], a
|
||||
ret
|
||||
|
||||
Pokedex_RunJumptable:
|
||||
@ -235,7 +235,7 @@ Pokedex_InitMainScreen:
|
||||
ld a, POKEDEX_SCX
|
||||
ldh [hSCX], a
|
||||
|
||||
ld a, [wCurrentDexMode]
|
||||
ld a, [wCurDexMode]
|
||||
cp DEXMODE_OLD
|
||||
ld a, $4a
|
||||
jr z, .okay
|
||||
@ -442,7 +442,7 @@ DexEntryScreen_MenuActionJumptable:
|
||||
ld a, $90
|
||||
ldh [hWY], a
|
||||
call Pokedex_GetSelectedMon
|
||||
ld a, [wDexCurrentLocation]
|
||||
ld a, [wDexCurLocation]
|
||||
ld e, a
|
||||
predef Pokedex_GetArea
|
||||
call Pokedex_BlackOutBG
|
||||
@ -513,7 +513,7 @@ Pokedex_InitOptionScreen:
|
||||
call ClearSprites
|
||||
call Pokedex_DrawOptionScreenBG
|
||||
call Pokedex_InitArrowCursor
|
||||
ld a, [wCurrentDexMode] ; Index of the topmost visible item in a scrolling menu ???
|
||||
ld a, [wCurDexMode] ; Index of the topmost visible item in a scrolling menu ???
|
||||
ld [wDexArrowCursorPosIndex], a
|
||||
call Pokedex_DisplayModeDescription
|
||||
call WaitBGMap
|
||||
@ -585,12 +585,12 @@ Pokedex_UpdateOptionScreen:
|
||||
ld b, DEXMODE_ABC
|
||||
|
||||
.ChangeMode:
|
||||
ld a, [wCurrentDexMode]
|
||||
ld a, [wCurDexMode]
|
||||
cp b
|
||||
jr z, .skip_changing_mode ; Skip if new mode is same as current.
|
||||
|
||||
ld a, b
|
||||
ld [wCurrentDexMode], a
|
||||
ld [wCurDexMode], a
|
||||
call Pokedex_OrderMonsByMode
|
||||
call Pokedex_DisplayChangingModesMessage
|
||||
xor a
|
||||
@ -799,7 +799,7 @@ Pokedex_InitUnownMode:
|
||||
call Pokedex_LoadUnownFont
|
||||
call Pokedex_DrawUnownModeBG
|
||||
xor a
|
||||
ld [wDexCurrentUnownIndex], a
|
||||
ld [wDexCurUnownIndex], a
|
||||
call Pokedex_LoadUnownFrontpicTiles
|
||||
call Pokedex_UnownModePlaceCursor
|
||||
farcall PrintUnownWord
|
||||
@ -849,7 +849,7 @@ Pokedex_UnownModeHandleDPadInput:
|
||||
.right
|
||||
ld a, [wDexUnownCount]
|
||||
ld e, a
|
||||
ld hl, wDexCurrentUnownIndex
|
||||
ld hl, wDexCurUnownIndex
|
||||
ld a, [hl]
|
||||
inc a
|
||||
cp e
|
||||
@ -859,7 +859,7 @@ Pokedex_UnownModeHandleDPadInput:
|
||||
jr .update
|
||||
|
||||
.left
|
||||
ld hl, wDexCurrentUnownIndex
|
||||
ld hl, wDexCurUnownIndex
|
||||
ld a, [hl]
|
||||
and a
|
||||
ret z
|
||||
@ -886,7 +886,7 @@ Pokedex_UnownModeEraseCursor:
|
||||
jr Pokedex_UnownModeUpdateCursorGfx
|
||||
|
||||
Pokedex_UnownModePlaceCursor:
|
||||
ld a, [wDexCurrentUnownIndex]
|
||||
ld a, [wDexCurUnownIndex]
|
||||
ld c, $5a ; diamond cursor
|
||||
|
||||
Pokedex_UnownModeUpdateCursorGfx:
|
||||
@ -1460,7 +1460,7 @@ Pokedex_PrintListing:
|
||||
; Prints the list of Pokémon on the main Pokédex screen.
|
||||
|
||||
; This check is completely useless.
|
||||
ld a, [wCurrentDexMode]
|
||||
ld a, [wCurDexMode]
|
||||
cp DEXMODE_OLD
|
||||
jr z, .okay
|
||||
ld c, 11
|
||||
@ -1522,7 +1522,7 @@ Pokedex_PrintListing:
|
||||
ret
|
||||
|
||||
Pokedex_PrintNumberIfOldMode:
|
||||
ld a, [wCurrentDexMode]
|
||||
ld a, [wCurDexMode]
|
||||
cp DEXMODE_OLD
|
||||
jr z, .printnum
|
||||
ret
|
||||
@ -1613,7 +1613,7 @@ Pokedex_OrderMonsByMode:
|
||||
ld bc, wPokedexOrderEnd - wPokedexOrder
|
||||
xor a
|
||||
call ByteFill
|
||||
ld a, [wCurrentDexMode]
|
||||
ld a, [wCurDexMode]
|
||||
ld hl, .Jumptable
|
||||
call Pokedex_LoadPointer
|
||||
jp hl
|
||||
@ -1968,7 +1968,7 @@ Pokedex_DisplayTypeNotFoundMessage:
|
||||
next "was not found.@"
|
||||
|
||||
Pokedex_UpdateCursorOAM:
|
||||
ld a, [wCurrentDexMode]
|
||||
ld a, [wCurDexMode]
|
||||
cp DEXMODE_OLD
|
||||
jp z, Pokedex_PutOldModeCursorOAM
|
||||
call Pokedex_PutNewModeABCModeCursorOAM
|
||||
@ -2070,7 +2070,7 @@ Pokedex_PutNewModeABCModeCursorOAM:
|
||||
db -1
|
||||
|
||||
Pokedex_UpdateSearchResultsCursorOAM:
|
||||
ld a, [wCurrentDexMode]
|
||||
ld a, [wCurDexMode]
|
||||
cp DEXMODE_OLD
|
||||
jp z, Pokedex_PutOldModeCursorOAM
|
||||
ld hl, .CursorOAM
|
||||
@ -2498,7 +2498,7 @@ Pokedex_LoadUnownFont:
|
||||
Pokedex_LoadUnownFrontpicTiles:
|
||||
ld a, [wUnownLetter]
|
||||
push af
|
||||
ld a, [wDexCurrentUnownIndex]
|
||||
ld a, [wDexCurUnownIndex]
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, wUnownDex
|
||||
|
@ -43,7 +43,7 @@ DrawPokedexListWindow:
|
||||
ld [hl], $3f
|
||||
hlcoord 5, 16
|
||||
ld [hl], $40
|
||||
ld a, [wCurrentDexMode]
|
||||
ld a, [wCurDexMode]
|
||||
cp DEXMODE_OLD
|
||||
jr z, .OldMode
|
||||
; scroll bar
|
||||
|
@ -23,7 +23,7 @@ PrintUnownWord:
|
||||
ld bc, 12
|
||||
ld a, " "
|
||||
call ByteFill
|
||||
ld a, [wDexCurrentUnownIndex]
|
||||
ld a, [wDexCurUnownIndex]
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, wUnownDex
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user