Merge branch 'scriptmacrorenaming' of github.com:pikalaxalt/pokecrystal

This commit is contained in:
PikalaxALT 2016-01-04 08:46:37 -05:00
commit 27be0bfe05
18 changed files with 172 additions and 154 deletions

View File

@ -9167,11 +9167,11 @@ GetRoamMonSpecies: ; 3fa31
Function3fa42: ; 3fa42 Function3fa42: ; 3fa42
ld hl, wd276 ld hl, OTPlayerID
ld de, StringBuffer1 ld de, StringBuffer1
ld bc, 2 ld bc, 2
call CopyBytes call CopyBytes
ld hl, wd26b ld hl, OTPlayerName
ld bc, 10 ld bc, 10
call CopyBytes call CopyBytes
ld hl, s1_b254 ld hl, s1_b254

View File

@ -109,7 +109,7 @@ Function8aa4: ; 8aa4
; 8ad1 ; 8ad1
Function8ad1: ; 8ad1 InitPartyMenuPalettes: ; 8ad1
ld hl, PalPacket_9c56 + 1 ld hl, PalPacket_9c56 + 1
call CopyFourPalettes call CopyFourPalettes
call InitPartyMenuOBPals call InitPartyMenuOBPals
@ -145,16 +145,17 @@ SGB_ApplyPartyMenuHPPals: ; 8ade SGB layout $fc
; 8b07 ; 8b07
Function8b07: ; 8b07 Function8b07: ; 8b07
; Unreferenced
call CheckCGB call CheckCGB
ret z ret z
ld hl, Palette8b2f ld hl, .BGPal
ld de, UnknBGPals ld de, UnknBGPals
ld bc, 1 palettes ld bc, 1 palettes
ld a, $5 ld a, $5
call FarCopyWRAM call FarCopyWRAM
ld hl, Palette8b37 ld hl, .OBPal
ld de, MartPointer ld de, UnknOBPals
ld bc, 1 palettes ld bc, 1 palettes
ld a, $5 ld a, $5
call FarCopyWRAM call FarCopyWRAM
@ -163,17 +164,14 @@ Function8b07: ; 8b07
ld a, $1 ld a, $1
ld [hCGBPalUpdate], a ld [hCGBPalUpdate], a
ret ret
; 8b2f
Palette8b2f: ; 8b2f .BGPal
RGB 31, 31, 31 RGB 31, 31, 31
RGB 18, 23, 31 RGB 18, 23, 31
RGB 15, 20, 31 RGB 15, 20, 31
RGB 00, 00, 00 RGB 00, 00, 00
; 8b37 .OBPal
Palette8b37: ; 8b37
RGB 31, 31, 31 RGB 31, 31, 31
RGB 31, 31, 12 RGB 31, 31, 12
RGB 08, 16, 28 RGB 08, 16, 28
@ -182,6 +180,7 @@ Palette8b37: ; 8b37
; 8b3f ; 8b3f
Function8b3f: ; 8b3f Function8b3f: ; 8b3f
; Unreferenced
call CheckCGB call CheckCGB
ret nz ret nz
ld a, [hSGB] ld a, [hSGB]
@ -193,14 +192,14 @@ Function8b3f: ; 8b3f
Function8b4d: ; 8b4d Function8b4d: ; 8b4d
call CheckCGB call CheckCGB
jr nz, .asm_8b5c jr nz, .cgb
ld a, [hSGB] ld a, [hSGB]
and a and a
ret z ret z
ld hl, PalPacket_9c26 ld hl, PalPacket_9c26
jp Function9809 jp Function9809
.asm_8b5c .cgb
ld de, UnknOBPals ld de, UnknOBPals
ld a, $3b ld a, $3b
call GetPredefPal call GetPredefPal
@ -209,14 +208,14 @@ Function8b4d: ; 8b4d
Function8b67: ; 8b67 Function8b67: ; 8b67
call CheckCGB call CheckCGB
jr nz, .asm_8b76 jr nz, .cgb
ld a, [hSGB] ld a, [hSGB]
and a and a
ret z ret z
ld hl, PalPacket_9c36 ld hl, PalPacket_9c36
jp Function9809 jp Function9809
.asm_8b76 .cgb
ld de, UnknOBPals ld de, UnknOBPals
ld a, $3c ld a, $3c
call GetPredefPal call GetPredefPal
@ -934,13 +933,13 @@ Function9809: ; 9809
push af push af
set 7, a set 7, a
ld [wcfbe], a ld [wcfbe], a
call Function981a call PushSGBPals
pop af pop af
ld [wcfbe], a ld [wcfbe], a
ret ret
; 981a ; 981a
Function981a: ; 981a PushSGBPals: ; 981a
ld a, [hl] ld a, [hl]
and $7 and $7
ret z ret z
@ -1004,7 +1003,7 @@ Function9853: ; 9853
call SGBDelayCycles call SGBDelayCycles
call Function993f call Function993f
ld hl, PalPacket_9d66 ld hl, PalPacket_9d66
call Function981a call PushSGBPals
.asm_988a .asm_988a
pop af pop af
@ -1020,50 +1019,49 @@ Function9890:: ; 9890
ld a, $1 ld a, $1
ld [rVBK], a ld [rVBK], a
ld hl, VTiles0 ld hl, VTiles0
ld bc, $2000 ld bc, $200 tiles
xor a xor a
call ByteFill call ByteFill
ld a, $0 ld a, $0
ld [rVBK], a ld [rVBK], a
ld a, $80 ld a, $80
ld [rBGPI], a ld [rBGPI], a
ld c, $20 ld c, 4 * 8
.asm_98ac .bgpals_loop
ld a, $ff ld a, $7fff % $100
ld [rBGPD], a ld [rBGPD], a
ld a, $7f ld a, $7fff / $100
ld [rBGPD], a ld [rBGPD], a
dec c dec c
jr nz, .asm_98ac jr nz, .bgpals_loop
ld a, $80 ld a, $80
ld [rOBPI], a ld [rOBPI], a
ld c, $20 ld c, 4 * 8
.asm_98bd .obpals_loop
ld a, $ff ld a, $7fff % $100
ld [rOBPD], a ld [rOBPD], a
ld a, $7f ld a, $7fff / $100
ld [rOBPD], a ld [rOBPD], a
dec c dec c
jr nz, .asm_98bd jr nz, .obpals_loop
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, $5
ld [rSVBK], a ld [rSVBK], a
ld hl, UnknBGPals ld hl, UnknBGPals
call Function98df call .LoadWhitePals
ld hl, BGPals ld hl, BGPals
call Function98df call .LoadWhitePals
pop af pop af
ld [rSVBK], a ld [rSVBK], a
ret ret
; 98df
Function98df: ; 98df .LoadWhitePals
ld c, $40 ld c, 4 * 16
.loop .loop
ld a, $ff ld a, $7fff % $100
ld [hli], a ld [hli], a
ld a, $7f ld a, $7fff / $100
ld [hli], a ld [hli], a
dec c dec c
jr nz, .loop jr nz, .loop
@ -1071,24 +1069,24 @@ Function98df: ; 98df
; 98eb ; 98eb
Function98eb: ; 98eb Function98eb: ; 98eb
ld hl, Unknown_98ff ld hl, .PalPacketPointerTable
ld c, $9 ld c, 9
.asm_98f0 .loop
push bc push bc
ld a, [hli] ld a, [hli]
push hl push hl
ld h, [hl] ld h, [hl]
ld l, a ld l, a
call Function981a call PushSGBPals
pop hl pop hl
inc hl inc hl
pop bc pop bc
dec c dec c
jr nz, .asm_98f0 jr nz, .loop
ret ret
; 98ff ; 98ff
Unknown_98ff: ; 98ff .PalPacketPointerTable: ; 98ff
dw PalPacket_9d56 dw PalPacket_9d56
dw PalPacket_9d76 dw PalPacket_9d76
dw PalPacket_9d86 dw PalPacket_9d86
@ -1105,18 +1103,18 @@ Function9911: ; 9911
xor a xor a
ld [rJOYP], a ld [rJOYP], a
ld hl, PalPacket_9d56 ld hl, PalPacket_9d56
call Function981a call PushSGBPals
call Function992c call Function992c
call SGBDelayCycles call SGBDelayCycles
call Function993f call Function993f
ld hl, PalPacket_9d66 ld hl, PalPacket_9d66
call Function981a call PushSGBPals
ei ei
ret ret
; 992c ; 992c
Function992c: ; 992c Function992c: ; 992c
call Function9938 call .LoadSGBBorderPointers
push de push de
call Function9a24 call Function9a24
pop hl pop hl
@ -1124,7 +1122,7 @@ Function992c: ; 992c
ret ret
; 9938 ; 9938
Function9938: ; 9938 .LoadSGBBorderPointers: ; 9938
ld hl, SGBBorder ld hl, SGBBorder
ld de, SGBBorderMap ld de, SGBBorderMap
ret ret
@ -1140,7 +1138,7 @@ Function993f: ; 993f
Function994a: ; 994a Function994a: ; 994a
ld hl, PalPacket_9d26 ld hl, PalPacket_9d26
call Function981a call PushSGBPals
call SGBDelayCycles call SGBDelayCycles
ld a, [rJOYP] ld a, [rJOYP]
and $3 and $3
@ -1186,7 +1184,7 @@ endr
Function99ab: ; 99ab Function99ab: ; 99ab
ld hl, PalPacket_9d16 ld hl, PalPacket_9d16
call Function981a call PushSGBPals
jp SGBDelayCycles jp SGBDelayCycles
; 99b4 ; 99b4
@ -1202,7 +1200,7 @@ Function99b4: ; 99b4
ld a, $e3 ld a, $e3
ld [rLCDC], a ld [rLCDC], a
ld hl, PalPacket_9d06 ld hl, PalPacket_9d06
call Function981a call PushSGBPals
xor a xor a
ld [rBGP], a ld [rBGP], a
ret ret
@ -1215,7 +1213,7 @@ Function99d8: ; 99d8
ld de, VTiles1 ld de, VTiles1
ld bc, 20 tiles ld bc, 20 tiles
call CopyData call CopyData
ld b, $12 ld b, 18
.asm_99ea .asm_99ea
push bc push bc
ld bc, $c ld bc, $c
@ -1237,7 +1235,7 @@ Function99d8: ; 99d8
ld a, $e3 ld a, $e3
ld [rLCDC], a ld [rLCDC], a
ld hl, PalPacket_9d46 ld hl, PalPacket_9d46
call Function981a call PushSGBPals
xor a xor a
ld [rBGP], a ld [rBGP], a
ret ret
@ -1245,15 +1243,15 @@ Function99d8: ; 99d8
Function9a24: ; 9a24 Function9a24: ; 9a24
call DisableLCD call DisableLCD
ld a, $e4 ld a, %11100100
ld [rBGP], a ld [rBGP], a
ld de, VTiles1 ld de, VTiles1
ld b, $80 ld b, $80
.asm_9a30 .asm_9a30
push bc push bc
ld bc, 2 palettes ld bc, 1 tiles
call CopyData call CopyData
ld bc, 2 palettes ld bc, 1 tiles
call ClearBytes call ClearBytes
pop bc pop bc
dec b dec b
@ -1262,7 +1260,7 @@ Function9a24: ; 9a24
ld a, $e3 ld a, $e3
ld [rLCDC], a ld [rLCDC], a
ld hl, PalPacket_9d36 ld hl, PalPacket_9d36
call Function981a call PushSGBPals
xor a xor a
ld [rBGP], a ld [rBGP], a
ret ret
@ -1295,7 +1293,7 @@ ClearBytes: ; 0x9a5b
DrawDefaultTiles: ; 0x9a64 DrawDefaultTiles: ; 0x9a64
; Draw 240 tiles (2/3 of the screen) from tiles in VRAM ; Draw 240 tiles (2/3 of the screen) from tiles in VRAM
hlbgcoord 0, 0 ; BG Map 0 hlbgcoord 0, 0 ; BG Map 0
ld de, 32 - 20 ld de, BG_MAP_WIDTH - SCREEN_WIDTH
ld a, $80 ; starting tile ld a, $80 ; starting tile
ld c, 12 + 1 ld c, 12 + 1
.line .line

View File

@ -227,7 +227,7 @@ HandleMapTimeAndJoypad: ; 967c1
; 967d1 ; 967d1
Function967d1: ; 967d1 Function967d1: ; 967d1
callba Function576a ; engine/map_objects.asm callba HandleNPCStep ; engine/map_objects.asm
callba _HandlePlayerStep callba _HandlePlayerStep
call _CheckObjectEnteringVisibleRange call _CheckObjectEnteringVisibleRange
ret ret

View File

@ -184,7 +184,7 @@ Gen2ToGen2LinkComms: ; 28177
call Function29dba call Function29dba
ld a, [ScriptVar] ld a, [ScriptVar]
and a and a
jp z, Function283b2 jp z, LinkTimeout
ld a, [hLinkPlayerNumber] ld a, [hLinkPlayerNumber]
cp $2 cp $2
jr nz, .Player1 jr nz, .Player1
@ -397,11 +397,11 @@ Gen2ToGen2LinkComms: ; 28177
ld de, OTPartyCount ld de, OTPartyCount
ld bc, 8 ld bc, 8
call CopyBytes call CopyBytes
ld de, wd276 ld de, OTPlayerID
ld bc, 2 ld bc, 2
call CopyBytes call CopyBytes
ld de, OTPartyMon1Species ld de, OTPartyMons
ld bc, $1a4 ld bc, OTPartyDataEnd - OTPartyMons
call CopyBytes call CopyBytes
ld a, OTPartyMonOT % $100 ld a, OTPartyMonOT % $100
ld [wd102], a ld [wd102], a
@ -419,7 +419,7 @@ Gen2ToGen2LinkComms: ; 28177
ld a, CAL ld a, CAL
ld [OtherTrainerClass], a ld [OtherTrainerClass], a
call ClearScreen call ClearScreen
callba Function4d354 callba Link_WaitBGMap
ld hl, Options ld hl, Options
ld a, [hl] ld a, [hl]
push af push af
@ -468,9 +468,9 @@ Gen2ToGen2LinkComms: ; 28177
jp InitTradeMenuDisplay jp InitTradeMenuDisplay
; 283b2 ; 283b2
Function283b2: ; 283b2 LinkTimeout: ; 283b2
ld de, .TooMuchTimeHasElapsed ld de, .TooMuchTimeHasElapsed
ld b, $a ld b, 10
.loop .loop
call DelayFrame call DelayFrame
call LinkDataReceived call LinkDataReceived
@ -1379,7 +1379,7 @@ Function28926: ; 28926
hlcoord 2, 16 hlcoord 2, 16
ld de, .String_Stats_Trade ld de, .String_Stats_Trade
call PlaceString call PlaceString
callba Function4d354 callba Link_WaitBGMap
.joy_loop .joy_loop
ld a, " " ld a, " "
@ -1485,7 +1485,7 @@ Function28926: ; 28926
ld b, 4 ld b, 4
ld c, 18 ld c, 18
call Predef_LinkTextbox call Predef_LinkTextbox
callba Function4d354 callba Link_WaitBGMap
ld hl, .Text_CantTradeLastMon ld hl, .Text_CantTradeLastMon
bccoord 1, 14 bccoord 1, 14
call PlaceWholeStringInBoxAtOnce call PlaceWholeStringInBoxAtOnce
@ -1507,7 +1507,7 @@ Function28926: ; 28926
ld b, 4 ld b, 4
ld c, 18 ld c, 18
call Predef_LinkTextbox call Predef_LinkTextbox
callba Function4d354 callba Link_WaitBGMap
ld hl, .Text_Abnormal ld hl, .Text_Abnormal
bccoord 1, 14 bccoord 1, 14
call PlaceWholeStringInBoxAtOnce call PlaceWholeStringInBoxAtOnce
@ -1663,7 +1663,7 @@ LinkTrade: ; 28b87
ld b, $4 ld b, $4
ld c, $12 ld c, $12
call Predef_LinkTextbox call Predef_LinkTextbox
callba Function4d354 callba Link_WaitBGMap
ld a, [wd002] ld a, [wd002]
ld hl, PartySpecies ld hl, PartySpecies
ld c, a ld c, a
@ -1713,7 +1713,7 @@ LinkTrade: ; 28b87
ld a, 1 ld a, 1
ld [wMenuCursorY], a ld [wMenuCursorY], a
ld [wMenuCursorX], a ld [wMenuCursorX], a
callba Function4d354 callba Link_WaitBGMap
call ScrollingMenuJoypad call ScrollingMenuJoypad
push af push af
call Call_ExitMenu call Call_ExitMenu
@ -1935,7 +1935,7 @@ LinkTrade: ; 28b87
call ClearScreen call ClearScreen
call LoadTradeScreenBorder call LoadTradeScreenBorder
call Function28eff call Function28eff
callba Function4d354 callba Link_WaitBGMap
ld b, $1 ld b, $1
pop af pop af
ld c, a ld c, a
@ -1982,7 +1982,7 @@ LinkTrade: ; 28b87
hlcoord 1, 14 hlcoord 1, 14
ld de, String28ebd ld de, String28ebd
call PlaceString call PlaceString
callba Function4d354 callba Link_WaitBGMap
ld c, 50 ld c, 50
call DelayFrames call DelayFrames
ld a, [wLinkMode] ld a, [wLinkMode]

View File

@ -2470,9 +2470,9 @@ Function56cd: ; 56cd
ret ret
; 576a ; 576a
Function576a:: ; 576a HandleNPCStep:: ; 576a
call .ResetStepVector call .ResetStepVector
call Function5781 call .DoStepsForAllObjects
ret ret
.ResetStepVector .ResetStepVector
@ -2483,9 +2483,8 @@ Function576a:: ; 576a
ld a, -1 ld a, -1
ld [wPlayerStepDirection], a ld [wPlayerStepDirection], a
ret ret
; 5781
Function5781: ; 5781 .DoStepsForAllObjects
ld bc, ObjectStructs ld bc, ObjectStructs
xor a xor a
.loop .loop
@ -2505,21 +2504,21 @@ Function5781: ; 5781
ret ret
; 579d ; 579d
Function579d: ; 579d RefreshPlayerSprite: ; 579d
ld a, $3e ld a, movement_step_sleep_1
ld [wPlayerNextMovement], a ld [wPlayerNextMovement], a
ld [wPlayerMovement], a ld [wPlayerMovement], a
xor a xor a
ld [wd04e], a ld [wd04e], a
ld [PlayerObjectStepFrame], a ld [PlayerObjectStepFrame], a
call Function57bc call .TryResetPlayerAction
callba CheckWarpFacingDown callba CheckWarpFacingDown
call c, SpawnInFacingDown call c, SpawnInFacingDown
call SpawnInCustomFacing call .SpawnInCustomFacing
ret ret
; 57bc ; 57bc
Function57bc: ; 57bc .TryResetPlayerAction: ; 57bc
ld hl, wPlayerSpriteSetupFlags ld hl, wPlayerSpriteSetupFlags
bit 7, [hl] bit 7, [hl]
jr nz, .ok jr nz, .ok
@ -2531,7 +2530,7 @@ Function57bc: ; 57bc
ret ret
; 57ca ; 57ca
SpawnInCustomFacing: ; 57ca .SpawnInCustomFacing: ; 57ca
ld hl, wPlayerSpriteSetupFlags ld hl, wPlayerSpriteSetupFlags
bit 5, [hl] bit 5, [hl]
ret z ret z

View File

@ -1,11 +1,11 @@
GiveMoney:: ; 15fd7 GiveMoney:: ; 15fd7
ld a, $3 ld a, 3
call AddMoney call AddMoney
ld bc, MaxMoney ld bc, MaxMoney
ld a, $3 ld a, 3
call CompareMoney call CompareMoney
jr z, .asm_15ff5 jr z, .not_maxed_out
jr c, .asm_15ff5 jr c, .not_maxed_out
ld hl, MaxMoney ld hl, MaxMoney
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
@ -18,7 +18,7 @@ GiveMoney:: ; 15fd7
scf scf
ret ret
.asm_15ff5 .not_maxed_out
and a and a
ret ret
; 15ff7 ; 15ff7
@ -31,7 +31,8 @@ MaxMoney: ; 15ff7
TakeMoney:: ; 15ffa TakeMoney:: ; 15ffa
ld a, 3 ld a, 3
call SubtractMoney call SubtractMoney
jr nc, .asm_16009 jr nc, .okay
; leave with 0 money
xor a xor a
ld [de], a ld [de], a
inc de inc de
@ -41,20 +42,23 @@ TakeMoney:: ; 15ffa
scf scf
ret ret
.asm_16009 .okay
and a and a
ret ret
; 1600b ; 1600b
CompareMoney:: ; 1600b CompareMoney:: ; 1600b
ld a, $3 ld a, 3
CompareFunds: ; 1600d CompareFunds: ; 1600d
; a: number of bytes
; bc: start addr of amount (big-endian)
; de: start addr of account (big-endian)
push hl push hl
push de push de
push bc push bc
ld h, b ld h, b
ld l, c ld l, c
ld c, $0 ld c, 0
ld b, a ld b, a
.loop1 .loop1
dec a dec a
@ -82,10 +86,9 @@ CompareFunds: ; 1600d
jr .skip_carry jr .skip_carry
.set_carry .set_carry
ld a, $1 ld a, TRUE
and a and a
scf scf
.skip_carry .skip_carry
pop bc pop bc
pop de pop de
@ -96,6 +99,9 @@ CompareFunds: ; 1600d
SubtractMoney: ; 16035 SubtractMoney: ; 16035
ld a, 3 ld a, 3
SubtractFunds: ; 16037 SubtractFunds: ; 16037
; a: number of bytes
; bc: start addr of amount (big-endian)
; de: start addr of account (big-endian)
push hl push hl
push de push de
push bc push bc
@ -127,11 +133,15 @@ SubtractFunds: ; 16037
; 16053 ; 16053
AddMoney: ; 16053 AddMoney: ; 16053
ld a, $3 ld a, 3
AddFunds: ; 16055 AddFunds: ; 16055
; a: number of bytes
; bc: start addr of amount (big-endian)
; de: start addr of account (big-endian)
push hl push hl
push de push de
push bc push bc
ld h, b ld h, b
ld l, c ld l, c
ld b, a ld b, a
@ -152,6 +162,7 @@ AddFunds: ; 16055
dec hl dec hl
dec b dec b
jr nz, .loop2 jr nz, .loop2
pop bc pop bc
pop de pop de
pop hl pop hl
@ -189,7 +200,8 @@ TakeCoins:: ; 1608f
ld a, 2 ld a, 2
ld de, Coins ld de, Coins
call SubtractFunds call SubtractFunds
jr nc, .asm_1609f jr nc, .okay
; leave with 0 coins
xor a xor a
ld [de], a ld [de], a
inc de inc de
@ -197,13 +209,13 @@ TakeCoins:: ; 1608f
scf scf
ret ret
.asm_1609f .okay
and a and a
ret ret
; 160a1 ; 160a1
CheckCoins:: ; 160a1 CheckCoins:: ; 160a1
ld a, $2 ld a, 2
ld de, Coins ld de, Coins
jp CompareFunds jp CompareFunds
; 160a9 ; 160a9

View File

@ -1428,7 +1428,7 @@ CalcPkmnStatC: ; e17b
sla c sla c
ld a, d ld a, d
and a and a
jr z, .SkipSqrt jr z, .no_stat_exp
add hl, bc add hl, bc
push de push de
ld a, [hld] ld a, [hld]
@ -1437,7 +1437,7 @@ CalcPkmnStatC: ; e17b
callba GetSquareRoot callba GetSquareRoot
pop de pop de
.SkipSqrt .no_stat_exp
srl c srl c
pop hl pop hl
push bc push bc

View File

@ -3,7 +3,7 @@ SelectMonFromParty: ; 50000
xor a xor a
ld [PartyMenuActionText], a ld [PartyMenuActionText], a
call ClearBGPalettes call ClearBGPalettes
call Function5003f call InitPartyMenuLayout
call WaitBGMap call WaitBGMap
call SetPalettes call SetPalettes
call DelayFrame call DelayFrame
@ -18,7 +18,7 @@ SelectTradeOrDaycareMon: ; 5001d
ld [PartyMenuActionText], a ld [PartyMenuActionText], a
call DisableSpriteUpdates call DisableSpriteUpdates
call ClearBGPalettes call ClearBGPalettes
call Function5003f call InitPartyMenuLayout
call WaitBGMap call WaitBGMap
ld b, SCGB_0A ld b, SCGB_0A
call GetSGBLayout call GetSGBLayout
@ -29,7 +29,7 @@ SelectTradeOrDaycareMon: ; 5001d
ret ret
; 5003f ; 5003f
Function5003f: ; 5003f InitPartyMenuLayout: ; 5003f
call LoadPartyMenuGFX call LoadPartyMenuGFX
call InitPartyMenuWithCancel call InitPartyMenuWithCancel
call InitPartyMenuGFX call InitPartyMenuGFX
@ -40,7 +40,7 @@ Function5003f: ; 5003f
LoadPartyMenuGFX: ; 5004f LoadPartyMenuGFX: ; 5004f
call LoadFontsBattleExtra call LoadFontsBattleExtra
callab Function8ad1 ; engine/color.asm callab InitPartyMenuPalettes ; engine/color.asm
callab ClearSpriteAnims2 callab ClearSpriteAnims2
ret ret
; 5005f ; 5005f

View File

@ -3049,10 +3049,7 @@ Script_loadbytec2cf: ; 97b27
ret ret
; 97b2e ; 97b2e
ld c, c ; XXX
CloseTextScript: ; 97b2e
closetext
; 97b2f
Script_closetext: ; 97b2f Script_closetext: ; 97b2f
; script command 0x49 ; script command 0x49

View File

@ -9,7 +9,7 @@ REEL_SIZE EQU 15
_SlotMachine: _SlotMachine:
ld hl, Options ld hl, Options
set 4, [hl] set NO_TEXT_SCROLL, [hl]
call .InitGFX call .InitGFX
call DelayFrame call DelayFrame
.loop .loop
@ -22,7 +22,7 @@ _SlotMachine:
call ClearBGPalettes call ClearBGPalettes
callba MobileFn_105fd0 callba MobileFn_105fd0
ld hl, Options ld hl, Options
res 4, [hl] res NO_TEXT_SCROLL, [hl]
ld hl, rLCDC ; $ff40 ld hl, rLCDC ; $ff40
res 2, [hl] res 2, [hl]
ret ret

View File

@ -1,8 +1,6 @@
SpawnPoints: ; 0x152ab SpawnPoints: ; 0x152ab
const_def
spawn: MACRO spawn: MACRO
; map, y, x ; map, y, x
map \1 map \1

View File

@ -319,7 +319,7 @@ RefreshMapSprites: ; 1047f0
call ClearSprites call ClearSprites
callba ReturnFromMapSetupScript callba ReturnFromMapSetupScript
call GetMovementPermissions call GetMovementPermissions
callba Function579d callba RefreshPlayerSprite
callba CheckReplaceKrisSprite callba CheckReplaceKrisSprite
ld hl, wPlayerSpriteSetupFlags ld hl, wPlayerSpriteSetupFlags
bit 6, [hl] bit 6, [hl]

View File

@ -494,6 +494,7 @@ CopyCurrMapDE: ; 2a27f
; 2a288 ; 2a288
LookUpWildmonsForMapDE: ; 2a288 LookUpWildmonsForMapDE: ; 2a288
.loop
push hl push hl
ld a, [hl] ld a, [hl]
inc a inc a
@ -509,7 +510,7 @@ LookUpWildmonsForMapDE: ; 2a288
.next .next
pop hl pop hl
add hl, bc add hl, bc
jr LookUpWildmonsForMapDE jr .loop
.nope .nope
pop hl pop hl
@ -896,7 +897,7 @@ endr
ld a, c ld a, c
ld [wNamedObjectIndexBuffer], a ld [wNamedObjectIndexBuffer], a
call GetPokemonName call GetPokemonName
ld hl, UnknownText_0x2a51a ld hl, .SawRareMonText
call PrintText call PrintText
xor a xor a
ld [ScriptVar], a ld [ScriptVar], a
@ -906,9 +907,8 @@ endr
ld a, $1 ld a, $1
ld [ScriptVar], a ld [ScriptVar], a
ret ret
; 2a51a
UnknownText_0x2a51a: ; 0x2a51a .SawRareMonText
; I just saw some rare @ in @ . I'll call you if I see another rare #MON, OK? ; I just saw some rare @ in @ . I'll call you if I see another rare #MON, OK?
text_jump UnknownText_0x1bd34b text_jump UnknownText_0x1bd34b
db "@" db "@"

View File

@ -94,7 +94,6 @@ callasm: macro
dba \1 dba \1
endm endm
enum special_command enum special_command
special: macro special: macro
db special_command db special_command
@ -106,7 +105,6 @@ add_special: MACRO
dba \1 dba \1
ENDM ENDM
enum ptcallasm_command enum ptcallasm_command
ptcallasm: macro ptcallasm: macro
db ptcallasm_command db ptcallasm_command

View File

@ -6749,13 +6749,20 @@ GivePokerusAndConvertBerries: ; 2ed44
ld a, [PartyCount] ld a, [PartyCount]
ld b, a ld b, a
ld de, PARTYMON_STRUCT_LENGTH ld de, PARTYMON_STRUCT_LENGTH
; Check to see if any of your Pokemon already has Pokerus.
; If so, sample its spread through your party.
; This means that you cannot get Pokerus de novo while
; a party member has an active infection.
.loopMons .loopMons
ld a, [hl] ld a, [hl]
and $f and $f
jr nz, .monHasActivePokerus jr nz, .TrySpreadPokerus
add hl, de add hl, de
dec b dec b
jr nz, .loopMons jr nz, .loopMons
; If we haven't been to Goldenrod City at least once,
; prevent the contraction of Pokerus.
ld hl, StatusFlags2 ld hl, StatusFlags2
bit 6, [hl] bit 6, [hl]
ret z ret z
@ -6778,7 +6785,7 @@ GivePokerusAndConvertBerries: ; 2ed44
ld a, [hl] ld a, [hl]
and $f0 and $f0
ret nz ; if it already has pokerus, do nothing ret nz ; if it already has pokerus, do nothing
.randomPokerusLoop .randomPokerusLoop ; Simultaneously sample the strain and duration
call Random call Random
and a and a
jr z, .randomPokerusLoop jr z, .randomPokerusLoop
@ -6789,7 +6796,7 @@ GivePokerusAndConvertBerries: ; 2ed44
and $7 and $7
inc a inc a
.load_pkrs .load_pkrs
ld b, a ld b, a ; this should come before the label
swap b swap b
and $3 and $3
inc a inc a
@ -6797,19 +6804,22 @@ GivePokerusAndConvertBerries: ; 2ed44
ld [hl], a ld [hl], a
ret ret
.monHasActivePokerus .TrySpreadPokerus
call Random call Random
cp 1 + 33 percent cp 1 + 33 percent
ret nc ; 1/3 chance ret nc ; 1/3 chance
ld a, [PartyCount] ld a, [PartyCount]
cp 1 cp 1
ret z ; only one mon, nothing to do ret z ; only one mon, nothing to do
ld c, [hl] ld c, [hl]
ld a, b ld a, b
cp $2 cp 2
jr c, .checkPreviousMonsLoop ; no more mons after this one, go backwards jr c, .checkPreviousMonsLoop ; no more mons after this one, go backwards
call Random call Random
cp $80 cp 1 + 50 percent
jr c, .checkPreviousMonsLoop ; 1/2 chance, go backwards jr c, .checkPreviousMonsLoop ; 1/2 chance, go backwards
.checkFollowingMonsLoop .checkFollowingMonsLoop
add hl, de add hl, de
@ -6821,7 +6831,7 @@ GivePokerusAndConvertBerries: ; 2ed44
ret z ; if mon has cured pokerus, stop searching ret z ; if mon has cured pokerus, stop searching
dec b ; go on to next mon dec b ; go on to next mon
ld a, b ld a, b
cp $1 cp 1
jr nz, .checkFollowingMonsLoop ; no more mons left jr nz, .checkFollowingMonsLoop ; no more mons left
ret ret
@ -8188,14 +8198,14 @@ LinkMonStatsScreen: ; 4d319
call ClearBGPalettes call ClearBGPalettes
call MaxVolume call MaxVolume
callba LoadTradeScreenBorder callba LoadTradeScreenBorder
callba Function4d354 callba Link_WaitBGMap
callba InitTradeSpeciesList callba InitTradeSpeciesList
callba Function28eff callba Function28eff
call WaitBGMap2 call WaitBGMap2
ret ret
; 4d354 ; 4d354
Function4d354: ; 4d354 Link_WaitBGMap: ; 4d354
call WaitBGMap call WaitBGMap
call WaitBGMap2 call WaitBGMap2
ret ret

View File

@ -1570,7 +1570,7 @@ Function1009ae: ; 1009ae
inc de inc de
dec c dec c
jr nz, .loop_col jr nz, .loop_col
ld bc, 12 ld bc, BG_MAP_WIDTH - SCREEN_WIDTH
add hl, bc add hl, bc
pop bc pop bc
dec b dec b
@ -1609,7 +1609,7 @@ Function1009f3: ; 1009f3
ld a, [hJoyDown] ld a, [hJoyDown]
and SELECT + A_BUTTON and SELECT + A_BUTTON
cp SELECT + A_BUTTON cp SELECT + A_BUTTON
jr nz, .asm_100a07 jr nz, .select_a
ld hl, wcd2a ld hl, wcd2a
set 4, [hl] set 4, [hl]
ld a, $f8 ld a, $f8
@ -1617,7 +1617,7 @@ Function1009f3: ; 1009f3
scf scf
ret ret
.asm_100a07 .select_a
xor a xor a
ret ret
; 100a09 ; 100a09
@ -1630,13 +1630,13 @@ _LinkBattleSendReceiveAction: ; 100a09
cp LINK_MOBILE cp LINK_MOBILE
jr nz, .not_mobile jr nz, .not_mobile
call Function100a87 call .MobileBattle_SendReceiveAction
call Function100da5 call Function100da5
callba FinishBattleAnim callba FinishBattleAnim
jr .done jr .done
.not_mobile .not_mobile
call Function100a53 call .LinkBattle_SendReceiveAction
.done .done
ret ret
@ -1669,7 +1669,7 @@ _LinkBattleSendReceiveAction: ; 100a09
ret ret
; 100a53 ; 100a53
Function100a53: ; 100a53 .LinkBattle_SendReceiveAction: ; 100a53
ld a, [wd431] ld a, [wd431]
ld [wPlayerLinkAction], a ld [wPlayerLinkAction], a
ld a, $ff ld a, $ff
@ -1700,7 +1700,7 @@ Function100a53: ; 100a53
ret ret
; 100a87 ; 100a87
Function100a87: ; 100a87 .MobileBattle_SendReceiveAction: ; 100a87
call Function100acf call Function100acf
call Function100641 call Function100641
ld a, 0 ld a, 0
@ -2100,7 +2100,7 @@ MobileBattleMonMenu: ; 100d22
; 100d67 ; 100d67
Function100d67: ; 100d67 Function100d67: ; 100d67
ld hl, MenuDataHeader_100d88 ld hl, .MenuDataHeader
call CopyMenuDataHeader call CopyMenuDataHeader
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
@ -2115,19 +2115,19 @@ Function100d67: ; 100d67
ret ret
; 100d88 ; 100d88
MenuDataHeader_100d88: ; 100d88 .MenuDataHeader: ; 100d88
db 0 ; flags db 0 ; flags
db 11, 11 ; start coords db 11, 11 ; start coords
db 17, 19 ; end coords db 17, 19 ; end coords
dw MenuData2_100d90 dw .MenuData2
db 1 ; default option db 1 ; default option
MenuData2_100d90: ; 100d90 .MenuData2: ; 100d90
db $c0 ; flags db $c0 ; flags
db 3 db 3
db "いれかえる@" db "いれかえる@" ; TRADE
db "つよさをみる@" db "つよさをみる@" ; STATS
db "キャンセル@" db "キャンセル@" ; CANCEL
; 100da5 ; 100da5
Function100da5: ; 100da5 Function100da5: ; 100da5

View File

@ -333,7 +333,7 @@ endr
Battle_GetTrainerName:: ; 39939 Battle_GetTrainerName:: ; 39939
ld a, [InBattleTowerBattle] ld a, [InBattleTowerBattle]
bit 0, a bit 0, a
ld hl, wd26b ld hl, OTPlayerName
jp nz, CopyTrainerName jp nz, CopyTrainerName
ld a, [OtherTrainerID] ld a, [OtherTrainerID]

View File

@ -2072,7 +2072,7 @@ wd10b:: ds 1
wItemQuantityChangeBuffer:: ds 1 wItemQuantityChangeBuffer:: ds 1
wItemQuantityBuffer:: ds 1 wItemQuantityBuffer:: ds 1
TempMon:: TempMon:: ; d10e
party_struct TempMon party_struct TempMon
wSpriteFlags:: ds 1 wSpriteFlags:: ds 1
@ -2398,11 +2398,11 @@ CurDamage:: ; d256
ds 2 ds 2
ds 2 ds 2
wMornEncounterRate:: ds 1 wMornEncounterRate:: ds 1 ; d25a
wDayEncounterRate:: ds 1 wDayEncounterRate:: ds 1 ; d25b
wNiteEncounterRate:: ds 1 wNiteEncounterRate:: ds 1 ; d25c
wWaterEncounterRate:: ds 1 wWaterEncounterRate:: ds 1 ; d25d
wListMoves_MoveIndicesBuffer:: ds 4 wListMoves_MoveIndicesBuffer:: ds NUM_MOVES
wPutativeTMHMMove:: ds 1 wPutativeTMHMMove:: ds 1
wd263:: ds 1 wd263:: ds 1
wd264:: ds 1 wd264:: ds 1
@ -2428,7 +2428,6 @@ wPokedexShowPointerBank::
wd26d:: ds 1 wd26d:: ds 1
ds 3 ds 3
wd271:: ds 5 wd271:: ds 5
wd276:: ds 10
ds wd26b - @ ds wd26b - @
@ -2466,7 +2465,7 @@ OTPartyMonsEnd::
OTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8 OTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8
OTPartyMonNicknames:: ds PKMN_NAME_LENGTH * PARTY_LENGTH ; d3ea OTPartyMonNicknames:: ds PKMN_NAME_LENGTH * PARTY_LENGTH ; d3ea
OTPartyDataEnd::
ds 4 ds 4
wd430:: wd430::
@ -2523,6 +2522,9 @@ wd454:: ds 1
wBattleScriptFlags:: ds 2 wBattleScriptFlags:: ds 2
wPlayerSpriteSetupFlags:: ds 1 wPlayerSpriteSetupFlags:: ds 1
; bit 7: if set, cancel PlayerAction
; bit 5: if set, set facing according to bits 0-1
; bits 0-1: direction facing
wMapReentryScriptQueueFlag:: ds 1 ; MemScriptFlag wMapReentryScriptQueueFlag:: ds 1 ; MemScriptFlag
wMapReentryScriptBank:: ds 1 ; MemScriptBank wMapReentryScriptBank:: ds 1 ; MemScriptBank
wMapReentryScriptAddress:: ds 2 ; MemScriptAddr wMapReentryScriptAddress:: ds 2 ; MemScriptAddr
@ -2946,6 +2948,7 @@ wCelebiEvent:: ds 1
ds 1 ds 1
BikeFlags:: ; dbf5 BikeFlags:: ; dbf5
; bit 0: using strength
; bit 1: always on bike ; bit 1: always on bike
; bit 2: downhill ; bit 2: downhill
ds 1 ds 1
@ -3287,7 +3290,8 @@ w3_d742:: battle_tower_struct w3_d742
ds -$22 ds -$22
wBTChoiceOfLvlGroup:: wBTChoiceOfLvlGroup::
w3_d800:: ds $69 w3_d800:: ; ds BG_MAP_WIDTH * SCREEN_HEIGHT ($240)
ds $69
w3_d869:: ds $17 w3_d869:: ds $17
w3_d880:: ds 1 w3_d880:: ds 1
w3_d881:: ds 1 w3_d881:: ds 1
@ -3300,10 +3304,12 @@ w3_d895:: ds 11
w3_d8a0:: ds 1 w3_d8a0:: ds 1
w3_d8a1:: ds 1 w3_d8a1:: ds 1
w3_d8a2:: ds 1 w3_d8a2:: ds 1
w3_d8a3:: ds 1 w3_d8a3:: ds $19d
ds $35c w3_da40:: ds $1c0
w3_dc00:: ds $168
w3_dd68:: ds $284 w3_dc00:: ds SCREEN_WIDTH * SCREEN_HEIGHT
w3_dd68:: ds SCREEN_WIDTH * SCREEN_HEIGHT
ds $11c
w3_dfec:: ds $10 w3_dfec:: ds $10
w3_dffc:: ds 4 w3_dffc:: ds 4