main.asm is now under 30k lines

This commit is contained in:
PikalaxALT 2015-11-19 18:07:20 -05:00
parent 8a6a1a7d77
commit 93a129eb6d
26 changed files with 9947 additions and 9950 deletions

2531
engine/crystal_intro.asm Executable file

File diff suppressed because it is too large Load Diff

1517
engine/debug.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,90 @@
EngineFlagAction:: ; 80430
; Do action b on engine flag de
;
; b = 0: reset flag
; = 1: set flag
; > 1: check flag, result in c
;
; Setting/resetting does not return a result.
; 16-bit flag ids are considered invalid, but it's nice
; to know that the infrastructure is there.
ld a, d
cp 0
jr z, .ceiling
jr c, .read ; cp 0 can't set carry!
jr .invalid
; There are only $a2 engine flags, so
; anything beyond that is invalid too.
.ceiling
ld a, e
cp NUM_ENGINE_FLAGS
jr c, .read
; Invalid flags are treated as flag 00.
.invalid
xor a
ld e, a
ld d, a
; Get this flag's location.
.read
ld hl, EngineFlags
; location
rept 2
add hl, de
endr
; bit
add hl, de
; location
ld e, [hl]
inc hl
ld d, [hl]
inc hl
; bit
ld c, [hl]
; What are we doing with this flag?
ld a, b
cp 1
jr c, .reset ; b = 0
jr z, .set ; b = 1
; Return the given flag in c.
.check
ld a, [de]
and c
ld c, a
ret
; Set the given flag.
.set
ld a, [de]
or c
ld [de], a
ret
; Reset the given flag.
.reset
ld a, c
cpl ; AND all bits except the one in question
ld c, a
ld a, [de]
and c
ld [de], a
ret
; 80462
EngineFlags: ; 80462
; All locations are in WRAM bank 1.
engine_flag: MACRO
dwb \1, 1 << \2

620
engine/npctrade.asm Executable file
View File

@ -0,0 +1,620 @@
; Trade struct
TRADE_DIALOG EQU 0
TRADE_GIVEMON EQU 1
TRADE_GETMON EQU 2
TRADE_NICK EQU 3
TRADE_DVS EQU 14
TRADE_ITEM EQU 16
TRADE_OT_ID EQU 17
TRADE_OT_NAME EQU 19
TRADE_GENDER EQU 30
TRADE_PADDING EQU 31
; Trade dialogs
TRADE_INTRO EQU 0
TRADE_CANCEL EQU 1
TRADE_WRONG EQU 2
TRADE_COMPLETE EQU 3
TRADE_AFTER EQU 4
NPCTrade:: ; fcba8
ld a, e
ld [wJumptableIndex], a
call Functionfcc59
ld b, CHECK_FLAG
call TradeFlagAction
ld a, TRADE_AFTER
jr nz, .done
ld a, TRADE_INTRO
call PrintTradeText
call YesNoBox
ld a, TRADE_CANCEL
jr c, .done
; Select givemon from party
ld b, 6
callba Function5001d
ld a, TRADE_CANCEL
jr c, .done
ld e, TRADE_GIVEMON
call GetTradeAttribute
ld a, [CurPartySpecies]
cp [hl]
ld a, TRADE_WRONG
jr nz, .done
call CheckTradeGender
ld a, TRADE_WRONG
jr c, .done
ld b, SET_FLAG
call TradeFlagAction
ld hl, ConnectLinkCableText
call PrintText
call Functionfcc63
call Functionfcc07
call GetTradeMonNames
ld hl, TradedForText
call PrintText
call RestartMapMusic
ld a, TRADE_COMPLETE
.done
call PrintTradeText
ret
; fcc07
Functionfcc07: ; fcc07
call DisableSpriteUpdates
ld a, [wJumptableIndex]
push af
ld a, [wcf64]
push af
predef Function28f24
pop af
ld [wcf64], a
pop af
ld [wJumptableIndex], a
call Function2b74
ret
; fcc23
CheckTradeGender: ; fcc23
xor a
ld [MonType], a
ld e, TRADE_GENDER
call GetTradeAttribute
ld a, [hl]
and a
jr z, .asm_fcc46
cp 1
jr z, .asm_fcc3e
callba GetGender
jr nz, .asm_fcc48
jr .asm_fcc46
.asm_fcc3e
callba GetGender
jr z, .asm_fcc48
.asm_fcc46
and a
ret
.asm_fcc48
scf
ret
; fcc4a
TradeFlagAction: ; fcc4a
ld hl, wd960
ld a, [wJumptableIndex]
ld c, a
predef FlagPredef
ld a, c
and a
ret
; fcc59
Functionfcc59: ; fcc59
ld e, TRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
ld [wcf64], a
ret
; fcc63
Functionfcc63: ; fcc63
ld e, TRADE_GIVEMON
call GetTradeAttribute
ld a, [hl]
ld [wc6d0], a
ld e, TRADE_GETMON
call GetTradeAttribute
ld a, [hl]
ld [wc702], a
ld a, [wc6d0]
ld de, wc6d1
call Functionfcde8
call Functionfcdf4
ld a, [wc702]
ld de, wc703
call Functionfcde8
call Functionfcdf4
ld hl, PartyMonOT
ld bc, NAME_LENGTH
call Functionfcdd7
ld de, wc6f2
call Functionfcdf4
ld hl, PlayerName
ld de, wc6e7
call Functionfcdf4
ld hl, PartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdd7
ld de, wc6ff
call Functionfce0f
ld hl, PartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdd7
ld de, wc6fd
call Functionfce0f
ld hl, PartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdd7
ld b, h
ld c, l
callba GetCaughtGender
ld a, c
ld [wc701], a
ld e, TRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
cp TRADE_COMPLETE
ld a, 1
jr c, .asm_fcce6
ld a, 2
.asm_fcce6
ld [wEnemyCharging], a
ld hl, PartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdd7
ld a, [hl]
ld [CurPartyLevel], a
ld a, [wc702]
ld [CurPartySpecies], a
xor a
ld [MonType], a
ld [wPokemonWithdrawDepositParameter], a
callab Functione039
predef TryAddMonToParty
ld e, TRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
cp TRADE_COMPLETE
ld b, 0
jr c, .asm_fcd1c
ld b, 1
.asm_fcd1c
callba SetGiftPartyMonCaughtData
ld e, TRADE_NICK
call GetTradeAttribute
ld de, wc70e
call Functionfcdf4
ld hl, PartyMonNicknames
ld bc, PKMN_NAME_LENGTH
call Functionfcdde
ld hl, wc70e
call Functionfcdf4
ld e, TRADE_OT_NAME
call GetTradeAttribute
push hl
ld de, wc724
call Functionfcdf4
pop hl
ld de, wc719
call Functionfcdf4
ld hl, PartyMonOT
ld bc, NAME_LENGTH
call Functionfcdde
ld hl, wc724
call Functionfcdf4
ld e, TRADE_DVS
call GetTradeAttribute
ld de, wEnemyTrappingMove
call Functionfce0f
ld hl, PartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdde
ld hl, wEnemyTrappingMove
call Functionfce0f
ld e, TRADE_OT_ID
call GetTradeAttribute
ld de, wPlayerCharging
call Functionfce15
ld hl, PartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdde
ld hl, wEnemyWrapCount
call Functionfce0f
ld e, TRADE_ITEM
call GetTradeAttribute
push hl
ld hl, PartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdde
pop hl
ld a, [hl]
ld [de], a
push af
push bc
push de
push hl
ld a, [CurPartyMon]
push af
ld a, [PartyCount]
dec a
ld [CurPartyMon], a
callba Functione134
pop af
ld [CurPartyMon], a
pop hl
pop de
pop bc
pop af
ret
; fcdc2
GetTradeAttribute: ; 0xfcdc2
ld d, 0
push de
ld a, [wJumptableIndex]
and $f
swap a
ld e, a
ld d, 0
ld hl, NPCTrades
rept 2
add hl, de
endr
pop de
add hl, de
ret
; 0xfcdd7
Functionfcdd7: ; fcdd7
ld a, [CurPartyMon]
call AddNTimes
ret
; fcdde
Functionfcdde: ; fcdde
ld a, [PartyCount]
dec a
call AddNTimes
ld e, l
ld d, h
ret
; fcde8
Functionfcde8: ; fcde8
push de
ld [wd265], a
call GetBasePokemonName
ld hl, StringBuffer1
pop de
ret
; fcdf4
Functionfcdf4: ; fcdf4
ld bc, NAME_LENGTH
call CopyBytes
ret
; fcdfb
Functionfcdfb: ; fcdfb
ld bc, 4
call CopyBytes
ld a, $50
ld [de], a
ret
; fce05
Functionfce05: ; fce05
ld bc, 3
call CopyBytes
ld a, $50
ld [de], a
ret
; fce0f
Functionfce0f: ; fce0f
ld a, [hli]
ld [de], a
inc de
ld a, [hl]
ld [de], a
ret
; fce15
Functionfce15: ; fce15
ld a, [hli]
ld [de], a
dec de
ld a, [hl]
ld [de], a
ret
; fce1b
GetTradeMonNames: ; fce1b
ld e, TRADE_GETMON
call GetTradeAttribute
ld a, [hl]
call Functionfcde8
ld de, StringBuffer2
call Functionfcdf4
ld e, TRADE_GIVEMON
call GetTradeAttribute
ld a, [hl]
call Functionfcde8
ld de, wd050
call Functionfcdf4
ld hl, StringBuffer1
.loop
ld a, [hli]
cp "@"
jr nz, .loop
dec hl
push hl
ld e, TRADE_GENDER
call GetTradeAttribute
ld a, [hl]
pop hl
and a
ret z
cp 1
ld a, "♂"
jr z, .done
ld a, "♀"
.done
ld [hli], a
ld [hl], "@"
ret
; fce58
NPCTrades: ; fce58
db 0, ABRA, MACHOP, "MUSCLE@@@@@", $37, $66, GOLD_BERRY, $54, $92, "MIKE@@@@@@@", 0, 0
db 0, BELLSPROUT, ONIX, "ROCKY@@@@@@", $96, $66, BITTER_BERRY, $1e, $bf, "KYLE@@@@@@@", 0, 0
db 1, KRABBY, VOLTORB, "VOLTY@@@@@@", $98, $88, PRZCUREBERRY, $05, $72, "TIM@@@@@@@@", 0, 0
db 3, DRAGONAIR, DODRIO, "DORIS@@@@@@", $77, $66, SMOKE_BALL, $1b, $01, "EMY@@@@@@@@", 2, 0
db 2, HAUNTER, XATU, "PAUL@@@@@@@", $96, $86, MYSTERYBERRY, $00, $3d, "CHRIS@@@@@@", 0, 0
db 3, CHANSEY, AERODACTYL, "AEROY@@@@@@", $96, $66, GOLD_BERRY, $7b, $67, "KIM@@@@@@@@", 0, 0
db 0, DUGTRIO, MAGNETON, "MAGGIE@@@@@", $96, $66, METAL_COAT, $a2, $c3, "FOREST@@@@@", 0, 0
; fcf38
PrintTradeText: ; fcf38
push af
call GetTradeMonNames
pop af
ld bc, 2 * 4
ld hl, TradeTexts
call AddNTimes
ld a, [wcf64]
ld c, a
rept 2
add hl, bc
endr
ld a, [hli]
ld h, [hl]
ld l, a
call PrintText
ret
; fcf53
TradeTexts: ; fcf53
; intro
dw TradeIntroText1
dw TradeIntroText2
dw TradeIntroText3
dw TradeIntroText4
; cancel
dw TradeCancelText1
dw TradeCancelText2
dw TradeCancelText3
dw TradeCancelText4
; wrong mon
dw TradeWrongText1
dw TradeWrongText2
dw TradeWrongText3
dw TradeWrongText4
; completed
dw TradeCompleteText1
dw TradeCompleteText2
dw TradeCompleteText3
dw TradeCompleteText4
; after
dw TradeAfterText1
dw TradeAfterText2
dw TradeAfterText3
dw TradeAfterText4
; fcf7b
ConnectLinkCableText: ; 0xfcf7b
; OK, connect the Game Link Cable.
text_jump UnknownText_0x1bd407
db "@"
; 0xfcf80
TradedForText: ; 0xfcf80
; traded givemon for getmon
text_jump UnknownText_0x1bd429
start_asm
ld de, MUSIC_NONE
call PlayMusic
call DelayFrame
ld hl, .done
ret
.done
; sound0x0A
; interpret_data
text_jump UnknownText_0x1bd445
db "@"
; 0xfcf97
TradeIntroText1: ; 0xfcf97
; I collect #MON. Do you have @ ? Want to trade it for my @ ?
text_jump UnknownText_0x1bd449
db "@"
; 0xfcf9c
TradeCancelText1: ; 0xfcf9c
; You don't want to trade? Aww…
text_jump UnknownText_0x1bd48c
db "@"
; 0xfcfa1
TradeWrongText1: ; 0xfcfa1
; Huh? That's not @ . What a letdown…
text_jump UnknownText_0x1bd4aa
db "@"
; 0xfcfa6
TradeCompleteText1: ; 0xfcfa6
; Yay! I got myself @ ! Thanks!
text_jump UnknownText_0x1bd4d2
db "@"
; 0xfcfab
TradeAfterText1: ; 0xfcfab
; Hi, how's my old @ doing?
text_jump UnknownText_0x1bd4f4
db "@"
; 0xfcfb0
TradeIntroText2:
TradeIntroText3: ; 0xfcfb0
; Hi, I'm looking for this #MON. If you have @ , would you trade it for my @ ?
text_jump UnknownText_0x1bd512
db "@"
; 0xfcfb5
TradeCancelText2:
TradeCancelText3: ; 0xfcfb5
; You don't have one either? Gee, that's really disappointing…
text_jump UnknownText_0x1bd565
db "@"
; 0xfcfba
TradeWrongText2:
TradeWrongText3: ; 0xfcfba
; You don't have @ ? That's too bad, then.
text_jump UnknownText_0x1bd5a1
db "@"
; 0xfcfbf
TradeCompleteText2: ; 0xfcfbf
; Great! Thank you! I finally got @ .
text_jump UnknownText_0x1bd5cc
db "@"
; 0xfcfc4
TradeAfterText2: ; 0xfcfc4
; Hi! The @ you traded me is doing great!
text_jump UnknownText_0x1bd5f4
db "@"
; 0xfcfc9
TradeIntroText4: ; 0xfcfc9
; 's cute, but I don't have it. Do you have @ ? Want to trade it for my @ ?
text_jump UnknownText_0x1bd621
db "@"
; 0xfcfce
TradeCancelText4: ; 0xfcfce
; You don't want to trade? Oh, darn…
text_jump UnknownText_0x1bd673
db "@"
; 0xfcfd3
TradeWrongText4: ; 0xfcfd3
; That's not @ . Please trade with me if you get one.
text_jump UnknownText_0x1bd696
db "@"
; 0xfcfd8
TradeCompleteText4: ; 0xfcfd8
; Wow! Thank you! I always wanted @ !
text_jump UnknownText_0x1bd6cd
db "@"
; 0xfcfdd
TradeAfterText4: ; 0xfcfdd
; How is that @ I traded you doing? Your @ 's so cute!
text_jump UnknownText_0x1bd6f5
db "@"
; 0xfcfe2
TradeCompleteText3: ; 0xfcfe2
; Uh? What happened?
text_jump UnknownText_0x1bd731
db "@"
; 0xfcfe7
TradeAfterText3: ; 0xfcfe7
; Trading is so odd… I still have a lot to learn about it.
text_jump UnknownText_0x1bd745
db "@"
; 0xfcfec

View File

@ -41,7 +41,7 @@ Function5003f: ; 5003f
LoadPartyMenuGFX: ; 5004f
call LoadFontsBattleExtra
callab Function8ad1 ; engine/color.asm
callab InefficientlyClear121BytesAtwc300
callab ClearSpriteAnims
ret
; 5005f

1493
engine/printer.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@ -2985,8 +2985,8 @@ Script_reloadmappart:: ; 97ae3
xor a
ld [hBGMapMode], a
call OverworldTextModeSwitch
call Function2914
callba Function104061
call GetMovementPermissions
callba ReloadMapPart
call UpdateSprites
ret
; 97af6

View File

@ -174,7 +174,7 @@ endr
; Look up the third field from the table in the wc300 array (10x2).
; Take the value and load it in
ld a, [de]
call LookUpInwDict_c300
call LookUpInwSpriteAnimDict
ld [hli], a
pop de
; Set hl to field 4. Kinda pointless, because we're presumably already here.
@ -374,11 +374,11 @@ Function8d0ec: ; 8d0ec
ret
; 8d109
LookUpInwDict_c300: ; 8d109
; a = wDict_c300[a] if a in wDict_c300 else 0
LookUpInwSpriteAnimDict: ; 8d109
; a = wSpriteAnimDict[a] if a in wSpriteAnimDict else 0
push hl
push bc
ld hl, wDict_c300
ld hl, wSpriteAnimDict
ld b, a
ld c, 10
.loop
@ -2885,3 +2885,540 @@ endr
Unknown_8e75d: ; 8e75d
sine_wave $100
Function8e79d: ; 8e79d
ld a, [hSGB]
ld de, GFX_8e7f4
and a
jr z, .asm_8e7a8
ld de, GFX_8e804
.asm_8e7a8
ld hl, VTiles0
lb bc, BANK(GFX_8e7f4), 1
call Request2bpp
ld c, $8
ld d, $0
.asm_8e7b5
push bc
call Function8e7c6
call DelayFrame
pop bc
rept 2
inc d
endr
dec c
jr nz, .asm_8e7b5
call ClearSprites
ret
; 8e7c6
Function8e7c6: ; 8e7c6
ld hl, Sprites
ld c, $8
.asm_8e7cb
ld a, c
and a
ret z
dec c
ld a, c
sla a
sla a
sla a
push af
push de
push hl
call Function8e72c
pop hl
pop de
add $68
ld [hli], a
pop af
push de
push hl
call Function8e72a
pop hl
pop de
add $54
ld [hli], a
ld a, $0
ld [hli], a
ld a, $6
ld [hli], a
jr .asm_8e7cb
; 8e7f4
GFX_8e7f4: ; 8e7f4
INCBIN "gfx/unknown/08e7f4.2bpp"
GFX_8e804: ; 8e804
INCBIN "gfx/unknown/08e804.2bpp"
ClearSpriteAnims: ; 8e814
push hl
push de
push bc
push af
ld hl, wSpriteAnimDict
ld bc, wSpriteAnimsEnd - wSpriteAnimDict
.loop
ld [hl], $0
inc hl
dec bc
ld a, c
or b
jr nz, .loop
pop af
pop bc
pop de
pop hl
ret
; 8e82b
Function8e82b: ; 8e82b
ld a, e
call ReadMonMenuIcon
ld l, a
ld h, 0
add hl, hl
ld de, IconPointers
add hl, de
ld a, [hli]
ld e, a
ld d, [hl]
ld b, BANK(Icons)
ld c, 8
ret
; 8e83f
Function8e83f: ; 8e83f
push hl
push de
push bc
call Function8e849
pop bc
pop de
pop hl
ret
; 8e849
Function8e849: ; 8e849
ld d, 0
ld hl, Jumptable_8e854
rept 2
add hl, de
endr
ld a, [hli]
ld h, [hl]
ld l, a
jp [hl]
; 8e854
Jumptable_8e854: ; 8e854 (23:6854)
dw Function8e8d5
dw Function8e961
dw Function8e97d
dw Function8e99a
dw Function8e898
dw Function8e8b1
dw Function8e862
Function8e862: ; 8e862 (23:6862)
call Function8e908
call Function8e86c
call Function8e936
ret
Function8e86c: ; 8e86c (23:686c)
push bc
ld a, [hObjectStructIndexBuffer]
ld hl, PartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop bc
ld a, [hl]
and a
jr z, .asm_8e890
push hl
push bc
ld d, a
callab ItemIsMail
pop bc
pop hl
jr c, .asm_8e88e
ld a, $6
jr .asm_8e892
.asm_8e88e
ld a, $5
.asm_8e890
ld a, $4
.asm_8e892
ld hl, $1
add hl, bc
ld [hl], a
ret
Function8e898: ; 8e898 (23:6898)
call Function8e8d5
ld hl, $2
add hl, bc
ld a, $0
ld [hl], a
ld hl, $4
add hl, bc
ld a, $48
ld [hl], a
ld hl, $5
add hl, bc
ld a, $48
ld [hl], a
ret
Function8e8b1: ; 8e8b1 (23:68b1)
call Function8e908
call Function8e936
ld hl, $2
add hl, bc
ld a, $0
ld [hl], a
ld hl, $4
add hl, bc
ld a, $18
ld [hl], a
ld hl, $5
add hl, bc
ld a, $60
ld [hl], a
ld a, c
ld [wc608], a
ld a, b
ld [wc608 + 1], a
ret
Function8e8d5: ; 8e8d5 (23:68d5)
call Function8e908
call Function8e8df
call Function8e936
ret
Function8e8df: ; 8e8df (23:68df)
push bc
ld a, [hObjectStructIndexBuffer]
ld hl, PartyMon1Item
ld bc, $30
call AddNTimes
pop bc
ld a, [hl]
and a
ret z
push hl
push bc
ld d, a
callab ItemIsMail
pop bc
pop hl
jr c, .asm_8e900
ld a, $3
jr .asm_8e902
.asm_8e900
ld a, $2
.asm_8e902
ld hl, $1
add hl, bc
ld [hl], a
ret
Function8e908: ; 8e908 (23:6908)
ld a, [wc3b7]
push af
ld a, [hObjectStructIndexBuffer]
ld hl, PartySpecies
ld e, a
ld d, $0
add hl, de
ld a, [hl]
call ReadMonMenuIcon
ld [CurIcon], a
call Function8e9db
ld a, [hObjectStructIndexBuffer]
; y coord
rept 4
add a
endr
add $1c
ld d, a
; x coord
ld e, $10
; type is partymon icon
ld a, SPRITE_ANIM_INDEX_00
call InitSpriteAnimStruct
pop af
ld hl, $3
add hl, bc
ld [hl], a
ret
Function8e936: ; 8e936 (23:6936)
push bc
ld a, [hObjectStructIndexBuffer]
ld b, a
call Function8e94c
ld a, b
pop bc
ld hl, $9
add hl, bc
ld [hl], a
rlca
rlca
ld hl, $d
add hl, bc
ld [hl], a
ret
Function8e94c: ; 8e94c (23:694c)
callba PlacePartymonHPBar
call GetHPPal
ld e, d
ld d, 0
ld hl, Unknown_8e95e
add hl, de
ld b, [hl]
ret
; 8e95e (23:695e)
Unknown_8e95e: ; 8e95e
db $00, $40, $80
; 8e961
Function8e961: ; 8e961 (23:6961)
ld a, [wd265]
call ReadMonMenuIcon
ld [CurIcon], a
xor a
call GetIconGFX
lb de, $24, $20
ld a, SPRITE_ANIM_INDEX_00
call InitSpriteAnimStruct
ld hl, $2
add hl, bc
ld [hl], $0
ret
Function8e97d: ; 8e97d (23:697d)
ld a, [wd265]
call ReadMonMenuIcon
ld [CurIcon], a
xor a
call GetIconGFX
ld d, $1a
ld e, $24
ld a, SPRITE_ANIM_INDEX_00
call InitSpriteAnimStruct
ld hl, $2
add hl, bc
ld [hl], $0
ret
Function8e99a: ; 8e99a (23:699a)
ld a, [wd265]
call ReadMonMenuIcon
ld [CurIcon], a
ld a, $62
ld [wc3b7], a
call Function8e9db
ret
GetSpeciesIcon: ; 8e9ac
; Load species icon into VRAM at tile a
push de
ld a, [wd265]
call ReadMonMenuIcon
ld [CurIcon], a
pop de
ld a, e
call GetIconGFX
ret
; 8e9bc
Function8e9bc: ; 8e9bc (23:69bc)
push de
ld a, [wd265]
call ReadMonMenuIcon
ld [CurIcon], a
pop de
ld a, e
call GetIcon_a
ret
; 8e9cc (23:69cc)
Function8e9cc: ; 8e9cc
push de
ld a, [wd265]
call ReadMonMenuIcon
ld [CurIcon], a
pop de
call GetIcon_de
ret
; 8e9db
Function8e9db: ; 8e9db (23:69db)
ld a, [wc3b7]
GetIconGFX: ; 8e9de
call GetIcon_a
ld de, $80 ; 8 tiles
add hl, de
ld de, HeldItemIcons
lb bc, BANK(HeldItemIcons), 2
call GetGFXUnlessMobile
ld a, [wc3b7]
add 10
ld [wc3b7], a
ret
HeldItemIcons:
INCBIN "gfx/icon/mail.2bpp"
INCBIN "gfx/icon/item.2bpp"
; 8ea17
GetIcon_de: ; 8ea17
; Load icon graphics into VRAM starting from tile de.
ld l, e
ld h, d
jr GetIcon
GetIcon_a: ; 8ea1b
; Load icon graphics into VRAM starting from tile a.
ld l, a
ld h, 0
GetIcon: ; 8ea1e
; Load icon graphics into VRAM starting from tile hl.
; One tile is 16 bytes long.
rept 4
add hl, hl
endr
ld de, VTiles0
add hl, de
push hl
; The icons are contiguous, in order and of the same
; size, so the pointer table is somewhat redundant.
ld a, [CurIcon]
push hl
ld l, a
ld h, 0
add hl, hl
ld de, IconPointers
add hl, de
ld a, [hli]
ld e, a
ld d, [hl]
pop hl
lb bc, BANK(Icons), 8
call GetGFXUnlessMobile
pop hl
ret
; 8ea3f
GetGFXUnlessMobile: ; 8ea3f
ld a, [wLinkMode]
cp LINK_MOBILE
jp nz, Request2bpp
jp Get2bpp_2
; 8ea4a
Function8ea4a: ; 8ea4a
ld hl, wSpriteAnimationStructs
ld e, $6
ld a, [MenuSelection2]
ld d, a
.loop
ld a, [hl]
and a
jr z, .next
cp d
jr z, .loadwithtwo
ld a, $0
jr .ok
.loadwithtwo
ld a, $2
.ok
push hl
ld c, l
ld b, h
ld hl, $2
add hl, bc
ld [hl], a
pop hl
.next
ld bc, $10
add hl, bc
dec e
jr nz, .loop
ret
; 8ea71
Function8ea71: ; 8ea71
ld hl, wSpriteAnimationStructs
ld e, $6
.loop
ld a, [hl]
and a
jr z, .zero
push hl
ld c, l
ld b, h
ld hl, $2
add hl, bc
ld [hl], $1
pop hl
.zero
ld bc, $10
add hl, bc
dec e
jr nz, .loop
ret
; 8ea8c (23:6a8c)
Function8ea8c: ; 8ea8c
ld hl, wSpriteAnimationStructs
ld e, $6
ld a, [wd0e3]
ld d, a
.asm_8ea95
ld a, [hl]
and a
jr z, .asm_8eaab
cp d
jr z, .asm_8eaa0
ld a, $3
jr .asm_8eaa2
.asm_8eaa0
ld a, $2
.asm_8eaa2
push hl
ld c, l
ld b, h
ld hl, $2
add hl, bc
ld [hl], a
pop hl
.asm_8eaab
ld bc, $10
add hl, bc
dec e
jr nz, .asm_8ea95
ret
INCLUDE "menu/mon_icons.asm"

View File

@ -1761,7 +1761,7 @@ SetUpMoveScreenBG: ; 13172
xor a
ld [hBGMapMode], a
callba Functionfb571
callba InefficientlyClear121BytesAtwc300
callba ClearSpriteAnims
ld a, [CurPartyMon]
ld e, a
ld d, $0

View File

@ -0,0 +1,684 @@
; These functions seem to be related to backwards compatibility
Functionfb57e: ; fb57e
ld a, [wd003]
ld hl, OTPartyMon1Species
call GetPartyLocation
push hl
ld a, [wd003]
inc a
ld c, a
ld b, 0
ld hl, OTPartyCount
add hl, bc
ld a, [hl]
pop hl
cp EGG
jr z, .asm_fb59c
cp [hl]
jr nz, .asm_fb5db
.asm_fb59c
ld b, h
ld c, l
ld hl, MON_LEVEL
add hl, bc
ld a, [hl]
cp 101
jr nc, .asm_fb5db
ld a, [wLinkMode]
cp LINK_TIMECAPSULE
jr nz, .asm_fb5d9
ld hl, OTPartySpecies
ld a, [wd003]
ld c, a
ld b, 0
add hl, bc
ld a, [hl]
; Magnemite and Magneton's types changed
; from Electric to Electric/Steel.
cp MAGNEMITE
jr z, .asm_fb5d9
cp MAGNETON
jr z, .asm_fb5d9
ld [CurSpecies], a
call GetBaseData
ld hl, wcbea
rept 2
add hl, bc
endr
ld a, [BaseType1]
cp [hl]
jr nz, .asm_fb5db
inc hl
ld a, [BaseType2]
cp [hl]
jr nz, .asm_fb5db
.asm_fb5d9
and a
ret
.asm_fb5db
scf
ret
; fb5dd
Functionfb5dd: ; fb5dd
ld a, [wd002]
ld d, a
ld a, [PartyCount]
ld b, a
ld c, $0
.asm_fb5e7
ld a, c
cp d
jr z, .asm_fb5f8
push bc
ld a, c
ld hl, PartyMon1HP
call GetPartyLocation
pop bc
ld a, [hli]
or [hl]
jr nz, .asm_fb60b
.asm_fb5f8
inc c
dec b
jr nz, .asm_fb5e7
ld a, [wd003]
ld hl, OTPartyMon1HP
call GetPartyLocation
ld a, [hli]
or [hl]
jr nz, .asm_fb60b
scf
ret
.asm_fb60b
and a
ret
; fb60d
Functionfb60d: ; fb60d
hlcoord 4, 0
ld de, PlayerName
call PlaceString
ld a, $14
ld [bc], a
hlcoord 4, 8
ld de, wd26b
call PlaceString
ld a, $14
ld [bc], a
hlcoord 7, 1
ld de, PartySpecies
call Functionfb634
hlcoord 7, 9
ld de, OTPartySpecies
Functionfb634: ; fb634
ld c, $0
.asm_fb636
ld a, [de]
cp $ff
ret z
ld [wd265], a
push bc
push hl
push de
push hl
ld a, c
ld [hProduct], a
call GetPokemonName
pop hl
call PlaceString
pop de
inc de
pop hl
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
inc c
jr .asm_fb636
; fb656
KantoMonSpecials: ; fb656
; The original special base stat for
; each Kanto monster from Red/Blue.
db 65 ; BULBASAUR
db 80 ; IVYSAUR
db 100 ; VENUSAUR
db 50 ; CHARMANDER
db 65 ; CHARMELEON
db 85 ; CHARIZARD
db 50 ; SQUIRTLE
db 65 ; WARTORTLE
db 85 ; BLASTOISE
db 20 ; CATERPIE
db 25 ; METAPOD
db 80 ; BUTTERFREE
db 20 ; WEEDLE
db 25 ; KAKUNA
db 45 ; BEEDRILL
db 35 ; PIDGEY
db 50 ; PIDGEOTTO
db 70 ; PIDGEOT
db 25 ; RATTATA
db 50 ; RATICATE
db 31 ; SPEAROW
db 61 ; FEAROW
db 40 ; EKANS
db 65 ; ARBOK
db 50 ; PIKACHU
db 90 ; RAICHU
db 30 ; SANDSHREW
db 55 ; SANDSLASH
db 40 ; NIDORAN_F
db 55 ; NIDORINA
db 75 ; NIDOQUEEN
db 40 ; NIDORAN_M
db 55 ; NIDORINO
db 75 ; NIDOKING
db 60 ; CLEFAIRY
db 85 ; CLEFABLE
db 65 ; VULPIX
db 100 ; NINETALES
db 25 ; JIGGLYPUFF
db 50 ; WIGGLYTUFF
db 40 ; ZUBAT
db 75 ; GOLBAT
db 75 ; ODDISH
db 85 ; GLOOM
db 100 ; VILEPLUME
db 55 ; PARAS
db 80 ; PARASECT
db 40 ; VENONAT
db 90 ; VENOMOTH
db 45 ; DIGLETT
db 70 ; DUGTRIO
db 40 ; MEOWTH
db 65 ; PERSIAN
db 50 ; PSYDUCK
db 80 ; GOLDUCK
db 35 ; MANKEY
db 60 ; PRIMEAPE
db 50 ; GROWLITHE
db 80 ; ARCANINE
db 40 ; POLIWAG
db 50 ; POLIWHIRL
db 70 ; POLIWRATH
db 105 ; ABRA
db 120 ; KADABRA
db 135 ; ALAKAZAM
db 35 ; MACHOP
db 50 ; MACHOKE
db 65 ; MACHAMP
db 70 ; BELLSPROUT
db 85 ; WEEPINBELL
db 100 ; VICTREEBEL
db 100 ; TENTACOOL
db 120 ; TENTACRUEL
db 30 ; GEODUDE
db 45 ; GRAVELER
db 55 ; GOLEM
db 65 ; PONYTA
db 80 ; RAPIDASH
db 40 ; SLOWPOKE
db 80 ; SLOWBRO
db 95 ; MAGNEMITE
db 120 ; MAGNETON
db 58 ; FARFETCH_D
db 35 ; DODUO
db 60 ; DODRIO
db 70 ; SEEL
db 95 ; DEWGONG
db 40 ; GRIMER
db 65 ; MUK
db 45 ; SHELLDER
db 85 ; CLOYSTER
db 100 ; GASTLY
db 115 ; HAUNTER
db 130 ; GENGAR
db 30 ; ONIX
db 90 ; DROWZEE
db 115 ; HYPNO
db 25 ; KRABBY
db 50 ; KINGLER
db 55 ; VOLTORB
db 80 ; ELECTRODE
db 60 ; EXEGGCUTE
db 125 ; EXEGGUTOR
db 40 ; CUBONE
db 50 ; MAROWAK
db 35 ; HITMONLEE
db 35 ; HITMONCHAN
db 60 ; LICKITUNG
db 60 ; KOFFING
db 85 ; WEEZING
db 30 ; RHYHORN
db 45 ; RHYDON
db 105 ; CHANSEY
db 100 ; TANGELA
db 40 ; KANGASKHAN
db 70 ; HORSEA
db 95 ; SEADRA
db 50 ; GOLDEEN
db 80 ; SEAKING
db 70 ; STARYU
db 100 ; STARMIE
db 100 ; MR__MIME
db 55 ; SCYTHER
db 95 ; JYNX
db 85 ; ELECTABUZZ
db 85 ; MAGMAR
db 55 ; PINSIR
db 70 ; TAUROS
db 20 ; MAGIKARP
db 100 ; GYARADOS
db 95 ; LAPRAS
db 48 ; DITTO
db 65 ; EEVEE
db 110 ; VAPOREON
db 110 ; JOLTEON
db 110 ; FLAREON
db 75 ; PORYGON
db 90 ; OMANYTE
db 115 ; OMASTAR
db 45 ; KABUTO
db 70 ; KABUTOPS
db 60 ; AERODACTYL
db 65 ; SNORLAX
db 125 ; ARTICUNO
db 125 ; ZAPDOS
db 125 ; MOLTRES
db 50 ; DRATINI
db 70 ; DRAGONAIR
db 100 ; DRAGONITE
db 154 ; MEWTWO
db 100 ; MEW
; fb6ed
INCLUDE "event/name_rater.asm"
PlaySlowCry: ; fb841
ld a, [ScriptVar]
call LoadCryHeader
jr c, .done
ld hl, CryPitch
ld a, [hli]
ld h, [hl]
ld l, a
ld bc, -$140
add hl, bc
ld a, l
ld [CryPitch], a
ld a, h
ld [CryPitch + 1], a
ld hl, CryLength
ld a, [hli]
ld h, [hl]
ld l, a
ld bc, $60
add hl, bc
ld a, l
ld [CryLength], a
ld a, h
ld [CryLength + 1], a
callba _PlayCryHeader
call WaitSFX
.done
ret
; fb877
NewPokedexEntry: ; fb877
ld a, [hMapAnims]
push af
xor a
ld [hMapAnims], a
call LowVolume
call ClearBGPalettes
call ClearTileMap
call UpdateSprites
call ClearSprites
ld a, [wPokedexStatus]
push af
ld a, [hSCX]
add $5
ld [hSCX], a
xor a
ld [wPokedexStatus], a
callba Function41a7f
call WaitPressAorB_BlinkCursor
ld a, $1
ld [wPokedexStatus], a
callba Function4424d
call WaitPressAorB_BlinkCursor
pop af
ld [wPokedexStatus], a
call MaxVolume
call FadeToWhite
ld a, [hSCX]
add $fb
ld [hSCX], a
call Functionfb8c8
pop af
ld [hMapAnims], a
ret
; fb8c8
Functionfb8c8: ; fb8c8
call ClearTileMap
call LoadFontsExtra
call LoadStandardFont
callba Function40ab2
call Function3200
callba GetEnemyMonDVs
ld a, [hli]
ld [TempMonDVs], a
ld a, [hl]
ld [TempMonDVs + 1], a
ld b, SCGB_1C
call GetSGBLayout
call SetPalettes
ret
; fb8f1
ConvertMon_2to1: ; fb8f1
; Takes the Gen-2 Pokemon number stored in wd265, finds it in the Pokered_MonIndices table, and returns its index in wd265.
push bc
push hl
ld a, [wd265]
ld b, a
ld c, 0
ld hl, Pokered_MonIndices
.loop
inc c
ld a, [hli]
cp b
jr nz, .loop
ld a, c
ld [wd265], a
pop hl
pop bc
ret
; fb908
ConvertMon_1to2: ; fb908
; Takes the Gen-1 Pokemon number stored in wd265 and returns the corresponding value from Pokered_MonIndices in wd265.
push bc
push hl
ld a, [wd265]
dec a
ld hl, Pokered_MonIndices
ld b, 0
ld c, a
add hl, bc
ld a, [hl]
ld [wd265], a
pop hl
pop bc
ret
; fb91c
Pokered_MonIndices: ; fb91c
db RHYDON
db KANGASKHAN
db NIDORAN_M
db CLEFAIRY
db SPEAROW
db VOLTORB
db NIDOKING
db SLOWBRO
db IVYSAUR
db EXEGGUTOR
db LICKITUNG
db EXEGGCUTE
db GRIMER
db GENGAR
db NIDORAN_F
db NIDOQUEEN
db CUBONE
db RHYHORN
db LAPRAS
db ARCANINE
db MEW
db GYARADOS
db SHELLDER
db TENTACOOL
db GASTLY
db SCYTHER
db STARYU
db BLASTOISE
db PINSIR
db TANGELA
db SCIZOR
db SHUCKLE
db GROWLITHE
db ONIX
db FEAROW
db PIDGEY
db SLOWPOKE
db KADABRA
db GRAVELER
db CHANSEY
db MACHOKE
db MR__MIME
db HITMONLEE
db HITMONCHAN
db ARBOK
db PARASECT
db PSYDUCK
db DROWZEE
db GOLEM
db HERACROSS
db MAGMAR
db HO_OH
db ELECTABUZZ
db MAGNETON
db KOFFING
db SNEASEL
db MANKEY
db SEEL
db DIGLETT
db TAUROS
db TEDDIURSA
db URSARING
db SLUGMA
db FARFETCH_D
db VENONAT
db DRAGONITE
db MAGCARGO
db SWINUB
db PILOSWINE
db DODUO
db POLIWAG
db JYNX
db MOLTRES
db ARTICUNO
db ZAPDOS
db DITTO
db MEOWTH
db KRABBY
db CORSOLA
db REMORAID
db OCTILLERY
db VULPIX
db NINETALES
db PIKACHU
db RAICHU
db DELIBIRD
db MANTINE
db DRATINI
db DRAGONAIR
db KABUTO
db KABUTOPS
db HORSEA
db SEADRA
db SKARMORY
db HOUNDOUR
db SANDSHREW
db SANDSLASH
db OMANYTE
db OMASTAR
db JIGGLYPUFF
db WIGGLYTUFF
db EEVEE
db FLAREON
db JOLTEON
db VAPOREON
db MACHOP
db ZUBAT
db EKANS
db PARAS
db POLIWHIRL
db POLIWRATH
db WEEDLE
db KAKUNA
db BEEDRILL
db HOUNDOOM
db DODRIO
db PRIMEAPE
db DUGTRIO
db VENOMOTH
db DEWGONG
db KINGDRA
db PHANPY
db CATERPIE
db METAPOD
db BUTTERFREE
db MACHAMP
db DONPHAN
db GOLDUCK
db HYPNO
db GOLBAT
db MEWTWO
db SNORLAX
db MAGIKARP
db PORYGON2
db STANTLER
db MUK
db SMEARGLE
db KINGLER
db CLOYSTER
db TYROGUE
db ELECTRODE
db CLEFABLE
db WEEZING
db PERSIAN
db MAROWAK
db HITMONTOP
db HAUNTER
db ABRA
db ALAKAZAM
db PIDGEOTTO
db PIDGEOT
db STARMIE
db BULBASAUR
db VENUSAUR
db TENTACRUEL
db SMOOCHUM
db GOLDEEN
db SEAKING
db ELEKID
db MAGBY
db MILTANK
db BLISSEY
db PONYTA
db RAPIDASH
db RATTATA
db RATICATE
db NIDORINO
db NIDORINA
db GEODUDE
db PORYGON
db AERODACTYL
db RAIKOU
db MAGNEMITE
db ENTEI
db SUICUNE
db CHARMANDER
db SQUIRTLE
db CHARMELEON
db WARTORTLE
db CHARIZARD
db LARVITAR
db PUPITAR
db TYRANITAR
db LUGIA
db ODDISH
db GLOOM
db VILEPLUME
db BELLSPROUT
db WEEPINBELL
db VICTREEBEL
db CHIKORITA
db BAYLEEF
db MEGANIUM
db CYNDAQUIL
db QUILAVA
db TYPHLOSION
db TOTODILE
db CROCONAW
db FERALIGATR
db SENTRET
db FURRET
db HOOTHOOT
db NOCTOWL
db LEDYBA
db LEDIAN
db SPINARAK
db ARIADOS
db CROBAT
db CHINCHOU
db LANTURN
db PICHU
db CLEFFA
db IGGLYBUFF
db TOGEPI
db TOGETIC
db NATU
db XATU
db MAREEP
db FLAAFFY
db AMPHAROS
db BELLOSSOM
db MARILL
db AZUMARILL
db SUDOWOODO
db POLITOED
db HOPPIP
db SKIPLOOM
db JUMPLUFF
db AIPOM
db SUNKERN
db SUNFLORA
db YANMA
db WOOPER
db QUAGSIRE
db ESPEON
db UMBREON
db MURKROW
db SLOWKING
db MISDREAVUS
db UNOWN
db WOBBUFFET
db GIRAFARIG
db PINECO
db FORRETRESS
db DUNSPARCE
db GLIGAR
db STEELIX
db SNUBBULL
db GRANBULL
db QWILFISH
db WOBBUFFET
db WOBBUFFET
; fba18

150
engine/variables.asm Executable file
View File

@ -0,0 +1,150 @@
_GetVarAction:: ; 80648 (20:4648)
ld a, c
cp NUM_VARS
jr c, .valid
xor a
.valid
ld c, a
ld b, 0
ld hl, .VarActionTable
rept 3
add hl, bc
endr
ld e, [hl]
inc hl
ld d, [hl]
inc hl
ld b, [hl]
ld a, b
and RETVAR_EXECUTE
jr nz, .call
ld a, b
and RETVAR_ADDR_DE
ret nz
ld a, [de]
jr .loadstringbuffer2
.call
call _de_
ret
.loadstringbuffer2: ; 8066c (20:466c)
ld de, StringBuffer2
ld [de], a
ret
; 80671 (20:4671)
.VarActionTable: ; 80671
; $00: copy [de] to StringBuffer2
; $40: return address in de
; $80: call function
dwb StringBuffer2, RETVAR_STRBUF2
dwb PartyCount, RETVAR_STRBUF2
dwb .BattleResult, RETVAR_EXECUTE
dwb BattleType, RETVAR_ADDR_DE
dwb TimeOfDay, RETVAR_STRBUF2
dwb .CountCaughtMons, RETVAR_EXECUTE
dwb .CountSeenMons, RETVAR_EXECUTE
dwb .CountBadges, RETVAR_EXECUTE
dwb PlayerState, RETVAR_ADDR_DE
dwb .PlayerFacing, RETVAR_EXECUTE
dwb hHours, RETVAR_STRBUF2
dwb .DayOfWeek, RETVAR_EXECUTE
dwb MapGroup, RETVAR_STRBUF2
dwb MapNumber, RETVAR_STRBUF2
dwb .UnownCaught, RETVAR_EXECUTE
dwb wPermission, RETVAR_STRBUF2
dwb .BoxFreeSpace, RETVAR_EXECUTE
dwb wBugContestMinsRemaining, RETVAR_STRBUF2
dwb XCoord, RETVAR_STRBUF2
dwb YCoord, RETVAR_STRBUF2
dwb wSpecialPhoneCallID, RETVAR_STRBUF2
dwb wcf64, RETVAR_STRBUF2
dwb wKurtApricornQuantity, RETVAR_STRBUF2
dwb wCurrentCaller, RETVAR_ADDR_DE
dwb wBlueCardBalance, RETVAR_ADDR_DE
dwb wBuenasPassword, RETVAR_ADDR_DE
dwb wdc58, RETVAR_STRBUF2
dwb NULL, RETVAR_STRBUF2
; 806c5
.CountCaughtMons: ; 806c5
; Caught mons.
ld hl, PokedexCaught
ld b, EndPokedexCaught - PokedexCaught
call CountSetBits
ld a, [wd265]
jp .loadstringbuffer2
; 806d3
.CountSeenMons: ; 806d3
; Seen mons.
ld hl, PokedexSeen
ld b, EndPokedexSeen - PokedexSeen
call CountSetBits
ld a, [wd265]
jp .loadstringbuffer2
; 806e1
.CountBadges: ; 806e1
; Number of owned badges.
ld hl, Badges
ld b, 2
call CountSetBits
ld a, [wd265]
jp .loadstringbuffer2
; 806ef
.PlayerFacing: ; 806ef
; The direction the player is facing.
ld a, [PlayerDirection]
and $c
rrca
rrca
jp .loadstringbuffer2
; 806f9
.DayOfWeek: ; 806f9
; The day of the week.
call GetWeekday
jp .loadstringbuffer2
; 806ff
.UnownCaught: ; 806ff
; Number of unique Unown caught.
call .count
ld a, b
jp .loadstringbuffer2
.count
ld hl, UnownDex
ld b, 0
.loop
ld a, [hli]
and a
ret z
inc b
ld a, b
cp 26
jr c, .loop
ret
; 80715
.BoxFreeSpace: ; 80715
; Remaining slots in the current box.
ld a, BANK(sBoxCount)
call GetSRAMBank
ld hl, sBoxCount
ld a, MONS_PER_BOX
sub [hl]
ld b, a
call CloseSRAM
ld a, b
jp .loadstringbuffer2
; 80728
.BattleResult: ; 80728
ld a, [wBattleResult]
and $3f
jp .loadstringbuffer2
; 80730

628
event/halloffame.asm Executable file
View File

@ -0,0 +1,628 @@
HallOfFame:: ; 0x8640e
call Function8648e
ld a, [StatusFlags]
push af
ld a, 1
ld [wc2cd], a
call DisableSpriteUpdates
ld a, SPAWN_LANCE
ld [wSpawnAfterChampion], a
; Enable the Pokégear map to cycle through all of Kanto
ld hl, StatusFlags
set 6, [hl] ; hall of fame
callba Function14da0
ld hl, wHallOfFameCount
ld a, [hl]
cp 200
jr nc, .ok
inc [hl]
.ok
callba SaveGameData
call GetHallOfFameParty
callba AddHallOfFameEntry
xor a
ld [wc2cd], a
call Function864c3
pop af
ld b, a
callba Function109847
ret
; 0x86455
RedCredits:: ; 86455
ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a
ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a
ld a, $a
ld [MusicFade], a
callba FadeOutPalettes
xor a
ld [VramState], a
ld [hMapAnims], a
callba Function4e8c2
ld c, 8
call DelayFrames
call DisableSpriteUpdates
ld a, SPAWN_RED
ld [wSpawnAfterChampion], a
ld a, [StatusFlags]
ld b, a
callba Function109847
ret
; 8648e
Function8648e: ; 8648e
ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a
ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a
ld a, 10
ld [MusicFade], a
callba FadeOutPalettes
xor a
ld [VramState], a
ld [hMapAnims], a
callba Function4e881
ld c, 100
jp DelayFrames
; 864b4
Function864b4: ; 864b4
push de
ld de, MUSIC_NONE
call PlayMusic
call DelayFrame
pop de
call PlayMusic
ret
; 864c3
Function864c3: ; 864c3
xor a
ld [wJumptableIndex], a
call Function8671c
jr c, .done
ld de, SCREEN_WIDTH
call Function864b4
xor a
ld [wcf64], a
.loop
ld a, [wcf64]
cp 6
jr nc, .done
ld hl, wc608 + 1
ld bc, $10
call AddNTimes
ld a, [hl]
cp -1
jr z, .done
push hl
call Function865b5
pop hl
call Function8650c
jr c, .done
ld hl, wcf64
inc [hl]
jr .loop
.done
call Function86810
ld a, $4
ld [MusicFade], a
call FadeToWhite
ld c, 8
call DelayFrames
ret
; 8650c
Function8650c: ; 8650c
call Function86748
ld de, String_8652c
hlcoord 1, 2
call PlaceString
call WaitBGMap
decoord 6, 5
ld c, $6
predef Functiond066e
ld c, 60
call DelayFrames
and a
ret
; 8652c
String_8652c:
db "New Hall of Famer!@"
; 8653f
GetHallOfFameParty: ; 8653f
ld hl, OverworldMap
ld bc, HOF_LENGTH
xor a
call ByteFill
ld a, [wHallOfFameCount]
ld de, OverworldMap
ld [de], a
inc de
ld hl, PartySpecies
ld c, 0
.next
ld a, [hli]
cp -1
jr z, .done
cp EGG
jr nz, .mon
inc c
jr .next
.mon
push hl
push de
push bc
ld a, c
ld hl, PartyMons
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld c, l
ld b, h
ld hl, MON_SPECIES
add hl, bc
ld a, [hl]
ld [de], a
inc de
ld hl, MON_ID
add hl, bc
ld a, [hli]
ld [de], a
inc de
ld a, [hl]
ld [de], a
inc de
ld hl, MON_DVS
add hl, bc
ld a, [hli]
ld [de], a
inc de
ld a, [hl]
ld [de], a
inc de
ld hl, MON_LEVEL
add hl, bc
ld a, [hl]
ld [de], a
inc de
pop bc
push bc
ld a, c
ld hl, PartyMonNicknames
ld bc, PKMN_NAME_LENGTH
call AddNTimes
ld bc, PKMN_NAME_LENGTH - 1
call CopyBytes
pop bc
inc c
pop de
ld hl, HOF_MON_LENGTH
add hl, de
ld e, l
ld d, h
pop hl
jr .next
.done
ld a, $ff
ld [de], a
ret
; 865b5
Function865b5: ; 865b5
push hl
call ClearBGPalettes
callba Function4e906
pop hl
ld a, [hli]
ld [TempMonSpecies], a
ld [CurPartySpecies], a
rept 2
inc hl
endr
ld a, [hli]
ld [TempMonDVs], a
ld a, [hli]
ld [TempMonDVs + 1], a
ld hl, TempMonDVs
predef GetUnownLetter
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
ld de, VTiles2 tile $31
predef GetBackpic
ld a, $31
ld [hFillBox], a
hlcoord 6, 6
lb bc, 6, 6
predef FillBox
ld a, $d0
ld [hSCY], a
ld a, $90
ld [hSCX], a
call WaitBGMap
xor a
ld [hBGMapMode], a
ld b, SCGB_1A
call GetSGBLayout
call SetPalettes
call Function86635
xor a
ld [wc2c6], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
hlcoord 6, 5
call _PrepMonFrontpic
call WaitBGMap
xor a
ld [hBGMapMode], a
ld [hSCY], a
call Function86643
ret
; 86635
Function86635: ; 86635
.loop
ld a, [hSCX]
cp $70
ret z
add $4
ld [hSCX], a
call DelayFrame
jr .loop
; 86643
Function86643: ; 86643
.loop
ld a, [hSCX]
and a
ret z
rept 2
dec a
endr
ld [hSCX], a
call DelayFrame
jr .loop
; 86650
_HallOfFamePC: ; 86650
call LoadFontsBattleExtra
xor a
ld [wJumptableIndex], a
.loop
call Function8671c
ret c
call Function86665
ret c
ld hl, wJumptableIndex
inc [hl]
jr .loop
; 86665
Function86665: ; 86665
xor a
ld [wcf64], a
.next
call Function86692
jr c, .start_button
.loop
call JoyTextDelay
ld hl, hJoyLast
ld a, [hl]
and B_BUTTON
jr nz, .b_button
ld a, [hl]
and A_BUTTON
jr nz, .a_button
ld a, [hl]
and START
jr nz, .start_button
call DelayFrame
jr .loop
.a_button
ld hl, wcf64
inc [hl]
jr .next
.b_button
scf
ret
.start_button
and a
ret
; 86692
Function86692: ; 86692
; Print the number of times the player has entered the Hall of Fame.
; If that number is above 200, print "HOF Master!" instead.
ld a, [wcf64]
cp $6
jr nc, .fail
ld hl, wc608 + 1
ld bc, $10
call AddNTimes
ld a, [hl]
cp $ff
jr nz, .okay
.fail
scf
ret
.okay
push hl
call ClearBGPalettes
pop hl
call Function86748
ld a, [wc608]
cp 200 + 1
jr c, .print_num_hof
ld de, String_866fc
hlcoord 1, 2
call PlaceString
hlcoord 13, 2
jr .finish
.print_num_hof
ld de, String_8670c
hlcoord 1, 2
call PlaceString
hlcoord 2, 2
ld de, wc608
lb bc, 1, 3
call PrintNum
hlcoord 11, 2
.finish
ld de, String_866fb
call PlaceString
call WaitBGMap
ld b, SCGB_1A
call GetSGBLayout
call SetPalettes
decoord 6, 5
ld c, $6
predef Functiond066e
and a
ret
; 866fb
String_866fb:
db "@"
; 866fc
String_866fc:
db " HOF Master!@"
; 8670c
String_8670c:
db " -Time Famer@"
; 8671c
Function8671c: ; 8671c
ld a, [wJumptableIndex]
cp NUM_HOF_TEAMS
jr nc, .full
ld hl, sHallOfFame
ld bc, HOF_LENGTH
call AddNTimes
ld a, BANK(sHallOfFame)
call GetSRAMBank
ld a, [hl]
and a
jr z, .fail
ld de, wc608
ld bc, HOF_LENGTH
call CopyBytes
call CloseSRAM
and a
ret
.fail
call CloseSRAM
.full
scf
ret
; 86748
Function86748: ; 86748
xor a
ld [hBGMapMode], a
ld a, [hli]
ld [TempMonSpecies], a
ld a, [hli]
ld [TempMonID], a
ld a, [hli]
ld [TempMonID + 1], a
ld a, [hli]
ld [TempMonDVs], a
ld a, [hli]
ld [TempMonDVs + 1], a
ld a, [hli]
ld [TempMonLevel], a
ld de, StringBuffer2
ld bc, 10
call CopyBytes
ld a, "@"
ld [StringBuffer2 + 10], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
hlcoord 0, 0
lb bc, 3, SCREEN_WIDTH - 2
call TextBox
hlcoord 0, 12
lb bc, 4, SCREEN_WIDTH - 2
call TextBox
ld a, [TempMonSpecies]
ld [CurPartySpecies], a
ld [wd265], a
ld hl, TempMonDVs
predef GetUnownLetter
xor a
ld [wc2c6], a
hlcoord 6, 5
call _PrepMonFrontpic
ld a, [CurPartySpecies]
cp EGG
jr z, .print_id_no
hlcoord 1, 13
ld a, "№"
ld [hli], a
ld [hl], "·"
hlcoord 3, 13
ld de, wd265
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
call PrintNum
call GetBasePokemonName
hlcoord 7, 13
call PlaceString
ld a, BREEDMON
ld [MonType], a
callba GetGender
ld a, " "
jr c, .got_gender
ld a, "♂"
jr nz, .got_gender
ld a, "♀"
.got_gender
hlcoord 18, 13
ld [hli], a
hlcoord 8, 14
ld a, "/"
ld [hli], a
ld de, StringBuffer2
call PlaceString
hlcoord 1, 16
call PrintLevel
.print_id_no
hlcoord 7, 16
ld a, "<ID>"
ld [hli], a
ld a, "№"
ld [hli], a
ld [hl], "/"
hlcoord 10, 16
ld de, TempMonID
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ret
; 86810
Function86810: ; 86810
call ClearBGPalettes
ld hl, VTiles2 tile $63
ld de, FontExtra + $d0
lb bc, BANK(FontExtra), 1
call Request2bpp
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
callba GetPlayerBackpic
ld a, $31
ld [hFillBox], a
hlcoord 6, 6
lb bc, 6, 6
predef FillBox
ld a, $d0
ld [hSCY], a
ld a, $90
ld [hSCX], a
call WaitBGMap
xor a
ld [hBGMapMode], a
ld [CurPartySpecies], a
ld b, SCGB_1A
call GetSGBLayout
call SetPalettes
call Function86635
xor a
ld [wc2c6], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
callba Function88840
xor a
ld [hFillBox], a
hlcoord 12, 5
lb bc, 7, 7
predef FillBox
ld a, $c0
ld [hSCX], a
call WaitBGMap
xor a
ld [hBGMapMode], a
ld [hSCY], a
call Function86643
xor a
ld [hBGMapMode], a
hlcoord 0, 2
lb bc, 8, 9
call TextBox
hlcoord 0, 12
lb bc, 4, 18
call TextBox
hlcoord 2, 4
ld de, PlayerName
call PlaceString
hlcoord 1, 6
ld a, "<ID>"
ld [hli], a
ld a, "№"
ld [hli], a
ld [hl], "/"
hlcoord 4, 6
ld de, PlayerID
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
hlcoord 1, 8
ld de, .PlayTime
call PlaceString
hlcoord 3, 9
ld de, GameTimeHours
lb bc, 2, 3
call PrintNum
ld [hl], 99
inc hl
ld de, GameTimeMinutes
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
call WaitBGMap
callba Function26601
ret
; 868ed
.PlayTime
db "PLAY TIME@"
; 868f7

285
event/mom_phone.asm Executable file
View File

@ -0,0 +1,285 @@
MomTriesToBuySomething:: ; fcfec
ld a, [wMapReentryScriptQueueFlag]
and a
ret nz
call GetMapHeaderPhoneServiceNybble
and a
ret nz
xor a
ld [wdc18], a
call CheckBalance_MomItem2
ret nc
call Functionfd0c3
ret nc
ld b, BANK(UnknownScript_0xfd00f)
ld de, UnknownScript_0xfd00f
callba LoadScriptBDE
scf
ret
; fd00f
UnknownScript_0xfd00f: ; 0xfd00f
callasm Functionfd017
farjump Script_ReceivePhoneCall
; 0xfd017
Functionfd017: ; fd017
call MomBuysItem_DeductFunds
call Functionfd0eb
ld a, [wdc18]
and a
jr nz, .ok
ld hl, wdc17
inc [hl]
.ok
ld a, 1
ld [wCurrentCaller], a
ld bc, wd03f
ld hl, 0
add hl, bc
ld [hl], 0
inc hl
ld [hl], 1
ld hl, 9
add hl, bc
ld a, $3f
ld [hli], a
ld a, e
ld [hli], a
ld a, d
ld [hl], a
ret
; fd044
CheckBalance_MomItem2: ; fd044
ld a, [wdc17]
cp 10
jr nc, .nope
call GetItemFromMom
ld a, [hli]
ld [hMoneyTemp], a
ld a, [hli]
ld [hMoneyTemp + 1], a
ld a, [hli]
ld [hMoneyTemp + 2], a
ld de, wMomsMoney
ld bc, hMoneyTemp
callba CompareMoney
jr nc, .have_enough_money
.nope
jr .check_have_2300
.have_enough_money
scf
ret
.check_have_2300
ld hl, hMoneyTemp
ld [hl], (2300 / $10000) ; $00
inc hl
ld [hl], ((2300 % $10000) / $100) ; $08
inc hl
ld [hl], (2300 % $100) ; $fc
.loop
ld de, wdc19
ld bc, wMomsMoney
callba CompareMoney
jr z, .exact
jr nc, .less_than
call Functionfd099
jr .loop
.less_than
xor a
ret
.exact
call Functionfd099
ld a, 5
call RandomRange
inc a
ld [wdc18], a
scf
ret
; fd099
Functionfd099: ; fd099
ld de, wdc19
ld bc, hMoneyTemp
callba AddMoney
ret
; fd0a6
MomBuysItem_DeductFunds: ; fd0a6 (3f:50a6)
call GetItemFromMom
ld de, 3
add hl, de
ld a, [hli]
ld [hMoneyTemp], a
ld a, [hli]
ld [hMoneyTemp + 1], a
ld a, [hli]
ld [hMoneyTemp + 2], a
ld de, wMomsMoney
ld bc, hMoneyTemp
callba TakeMoney
ret
Functionfd0c3: ; fd0c3
call GetItemFromMom
ld de, 6
add hl, de
ld a, [hli]
cp 1
jr z, .not_doll
ld a, [hl]
ld c, a
ld b, 1
callba DecorationFlagAction_c
scf
ret
.not_doll
ld a, [hl]
ld [CurItem], a
ld a, $1
ld [wItemQuantityChangeBuffer], a
ld hl, PCItems
call ReceiveItem
ret
; fd0eb
Functionfd0eb: ; fd0eb (3f:50eb)
call GetItemFromMom
ld de, 6 ; field
add hl, de
ld a, [hli]
ld de, Script_MomBoughtItem
cp 1
ret z
ld de, Script_MomBoughtDoll
ret
; fd0fd (3f:50fd)
Script_MomBoughtItem: ; 0xfd0fd
writetext _MomText_HiHowAreYou
writetext _MomText_FoundAnItem
writetext _MomText_BoughtWithYourMoney
writetext _MomText_ItsInPC
end
; 0xfd10a
Script_MomBoughtDoll: ; 0xfd10a
writetext _MomText_HiHowAreYou
writetext _MomText_FoundADoll
writetext _MomText_BoughtWithYourMoney
writetext _MomText_ItsInRoom
end
; 0xfd117
GetItemFromMom: ; fd117
ld a, [wdc18]
and a
jr z, .zero
dec a
ld de, MomItems_1
jr .incave
.zero
ld a, [wdc17]
cp 10 ; length of MomItems_2
jr c, .ok
xor a
.ok
ld de, MomItems_2
.incave
ld l, a
ld h, 0
rept 3 ; multiply hl by 8
add hl, hl
endr
add hl, de
ret
; fd136
momitem: macro
; money to trigger, cost, kind, item
dt \1
dt \2
db \3, \4
ENDM
MomItems_1: ; fd136
momitem 0, 600, MOM_ITEM, SUPER_POTION
momitem 0, 90, MOM_ITEM, ANTIDOTE
momitem 0, 180, MOM_ITEM, POKE_BALL
momitem 0, 450, MOM_ITEM, ESCAPE_ROPE
momitem 0, 500, MOM_ITEM, GREAT_BALL
; fd15e
MomItems_2: ; fd15e
momitem 900, 600, MOM_ITEM, SUPER_POTION
momitem 4000, 270, MOM_ITEM, REPEL
momitem 7000, 600, MOM_ITEM, SUPER_POTION
momitem 10000, 1800, MOM_DOLL, DECO_CHARMANDER_DOLL
momitem 15000, 3000, MOM_ITEM, MOON_STONE
momitem 19000, 600, MOM_ITEM, SUPER_POTION
momitem 30000, 4800, MOM_DOLL, DECO_CLEFAIRY_DOLL
momitem 40000, 900, MOM_ITEM, HYPER_POTION
momitem 50000, 8000, MOM_DOLL, DECO_PIKACHU_DOLL
momitem 100000, 22800, MOM_DOLL, DECO_BIG_SNORLAX_DOLL
; fd1ae
db 0, 0, 0 ; XXX
_MomText_HiHowAreYou: ; 0xfd1b1
; Hi, ! How are you?
text_jump UnknownText_0x1bc615
db "@"
; 0xfd1b6
_MomText_FoundAnItem: ; 0xfd1b6
; I found a useful item shopping, so
text_jump UnknownText_0x1bc62a
db "@"
; 0xfd1bb
_MomText_BoughtWithYourMoney: ; 0xfd1bb
; I bought it with your money. Sorry!
text_jump UnknownText_0x1bc64e
db "@"
; 0xfd1c0
_MomText_ItsInPC: ; 0xfd1c0
; It's in your PC. You'll like it!
text_jump UnknownText_0x1bc673
db "@"
; 0xfd1c5
_MomText_FoundADoll: ; 0xfd1c5
; While shopping today, I saw this adorable doll, so
text_jump UnknownText_0x1bc693
db "@"
; 0xfd1ca
_MomText_ItsInRoom: ; 0xfd1ca
; It's in your room. You'll love it!
text_jump UnknownText_0x1bc6c7
db "@"
; 0xfd1cf
db 0 ; XXX
Functionfd1d0: ; fd1d0
ret
; fd1d1
ret ; XXX

236
gfx/font.asm Executable file
View File

@ -0,0 +1,236 @@
FontExtra:
INCBIN "gfx/misc/font_extra.2bpp"
Font:
INCBIN "gfx/misc/font.1bpp"
FontBattleExtra:
INCBIN "gfx/misc/font_battle_extra.2bpp"
Frames: ; f8800
INCBIN "gfx/frames/1.1bpp"
INCBIN "gfx/frames/2.1bpp"
INCBIN "gfx/frames/3.1bpp"
INCBIN "gfx/frames/4.1bpp"
INCBIN "gfx/frames/5.1bpp"
INCBIN "gfx/frames/6.1bpp"
INCBIN "gfx/frames/7.1bpp"
INCBIN "gfx/frames/8.1bpp"
INCBIN "gfx/frames/9.1bpp"
; f89b0
; TODO: Various misc graphics here.
GFX_f89b0: ; f89b0
INCBIN "gfx/unknown/0f89b0.2bpp"
; f8a90
ShinyIcon: ; f8a90
INCBIN "gfx/stats/shiny.2bpp"
GFX_f8aa0: ; f8aa0
INCBIN "gfx/unknown/0f8aa0.2bpp"
; f8ac0
EnemyHPBarBorderGFX: ; f8ac0
INCBIN "gfx/battle/enemy_hp_bar_border.1bpp"
; f8ae0
HPExpBarBorderGFX: ; f8ae0
INCBIN "gfx/battle/hp_exp_bar_border.1bpp"
; f8b10
ExpBarGFX: ; f8b10
INCBIN "gfx/battle/expbar.2bpp"
; f8ba0
TownMapGFX: ; f8ba0
INCBIN "gfx/misc/town_map.2bpp.lz"
; f8ea4
GFX_f8ea4: ; unused
INCBIN "gfx/unknown/0f8ea4.2bpp"
; f8f24
OverworldPhoneIconGFX: ; f8f24
INCBIN "gfx/mobile/overworld_phone_icon.2bpp"
; f8f34
GFX_f8f34: ; unused
INCBIN "gfx/unknown/0f8f34.2bpp"
; f9204
TextBoxSpaceGFX: ; f9204
INCBIN "gfx/frames/space.2bpp"
; f9214
MobilePhoneTilesGFX: ; f9214
INCBIN "gfx/mobile/phone_tiles.2bpp"
; f9344
MapEntryFrameGFX: ; f9344
INCBIN "gfx/frames/map_entry_sign.2bpp"
; f9424
GFX_f9424: ; f9424
INCBIN "gfx/unknown/0f9424.2bpp"
; f9434
Footprints: ; f9434
INCBIN "gfx/misc/footprints.1bpp"
; fb434
; This and the following two functions are unreferenced.
Unknown_fb434:
db 0
Functionfb435: ; 4b435
ld a, [Unknown_fb434]
and a
jp nz, Get1bpp_2
jp Get1bpp
; fb43f
Functionfb43f: ; fb43f
ld a, [Unknown_fb434]
and a
jp nz, Get2bpp_2
jp Get2bpp
; End unreferenced block
; fb449
_LoadStandardFont:: ; fb449
ld de, Font
ld hl, VTiles1
lb bc, BANK(Font), $80
ld a, [rLCDC]
bit 7, a
jp z, Copy1bpp
ld de, Font
ld hl, VTiles1
lb bc, BANK(Font), $20
call Get1bpp_2
ld de, Font + $20 * LEN_1BPP_TILE
ld hl, VTiles1 tile $20
lb bc, BANK(Font), $20
call Get1bpp_2
ld de, Font + $40 * LEN_1BPP_TILE
ld hl, VTiles1 tile $40
lb bc, BANK(Font), $20
call Get1bpp_2
ld de, Font + $60 * LEN_1BPP_TILE
ld hl, VTiles1 tile $60
lb bc, BANK(Font), $20
call Get1bpp_2
ret
; fb48a
_LoadFontsExtra1:: ; fb48a
ld de, MobilePhoneTilesGFX
ld hl, VTiles2 tile $60
lb bc, BANK(MobilePhoneTilesGFX), 1
call Get1bpp_2
ld de, OverworldPhoneIconGFX
ld hl, VTiles2 tile $62
lb bc, BANK(OverworldPhoneIconGFX), 1
call Get2bpp_2
ld de, FontExtra + 3 * LEN_2BPP_TILE
ld hl, VTiles2 tile $63
lb bc, BANK(FontExtra), $16
call Get2bpp_2
jr LoadFrame
; fb4b0
_LoadFontsExtra2:: ; fb4b0
ld de, GFX_f9424
ld hl, VTiles2 tile $61
ld b, BANK(GFX_f9424)
ld c, 1
call Get2bpp_2
ret
; fb4be
_LoadFontsBattleExtra:: ; fb4be
ld de, FontBattleExtra
ld hl, VTiles2 tile $60
lb bc, BANK(FontBattleExtra), $19
call Get2bpp_2
jr LoadFrame
; fb4cc
LoadFrame: ; fb4cc
ld a, [TextBoxFrame]
and 7
ld bc, TILES_PER_FRAME * LEN_1BPP_TILE
ld hl, Frames
call AddNTimes
ld d, h
ld e, l
ld hl, VTiles2 tile $79
lb bc, BANK(Frames), TILES_PER_FRAME
call Get1bpp_2
ld hl, VTiles2 tile $7f
ld de, TextBoxSpaceGFX
lb bc, BANK(TextBoxSpaceGFX), 1
call Get1bpp_2
ret
; fb4f2
LoadBattleFontsHPBar: ; fb4f2
ld de, FontBattleExtra
ld hl, VTiles2 tile $60
lb bc, BANK(FontBattleExtra), $c
call Get2bpp_2
ld hl, VTiles2 tile $70
ld de, FontBattleExtra + $10 * LEN_2BPP_TILE
lb bc, BANK(FontBattleExtra), 3
call Get2bpp_2
call LoadFrame
LoadHPBar: ; fb50d
ld de, EnemyHPBarBorderGFX
ld hl, VTiles2 tile $6c
lb bc, BANK(EnemyHPBarBorderGFX), 4
call Get1bpp_2
ld de, HPExpBarBorderGFX
ld hl, VTiles2 tile $73
lb bc, BANK(HPExpBarBorderGFX), 6
call Get1bpp_2
ld de, ExpBarGFX
ld hl, VTiles2 tile $55
lb bc, BANK(ExpBarGFX), 9
call Get2bpp_2
ld de, MobilePhoneTilesGFX + 9 * LEN_2BPP_TILE
ld hl, VTiles2 tile $5e
lb bc, BANK(MobilePhoneTilesGFX), 2
call Get2bpp_2
ret
; fb53e
Functionfb53e: ; fb53e
call _LoadFontsBattleExtra
ld de, EnemyHPBarBorderGFX
ld hl, VTiles2 tile $6c
lb bc, BANK(EnemyHPBarBorderGFX), 4
call Get1bpp_2
ld de, HPExpBarBorderGFX
ld hl, VTiles2 tile $78
lb bc, BANK(HPExpBarBorderGFX), 1
call Get1bpp_2
ld de, HPExpBarBorderGFX + 3 * LEN_1BPP_TILE
ld hl, VTiles2 tile $76
lb bc, BANK(HPExpBarBorderGFX), 2
call Get1bpp_2
ld de, ExpBarGFX
ld hl, VTiles2 tile $55
lb bc, BANK(ExpBarGFX), 8
call Get2bpp_2
Functionfb571: ; fb571
ld de, GFX_f89b0
ld hl, VTiles2 tile $31
lb bc, BANK(GFX_f89b0), $11
call Get2bpp_2
ret
; fb57e

1088
gfx/mail.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1588,7 +1588,7 @@ Function28f7:: ; 28f7
ret
; 2914
Function2914:: ; 2914
GetMovementPermissions:: ; 2914
xor a
ld [TilePermissions], a
call GetLeftRightCollision

9893
main.asm

File diff suppressed because it is too large Load Diff

View File

@ -385,7 +385,7 @@ Function11c1ca: ; 11c1ca
ld de, VTiles0
call Decompress
call EnableLCD
callba Function104061
callba ReloadMapPart
callba Function8cf53
callba LoadPokemonData
callba Function40c30
@ -443,7 +443,7 @@ Function11c283: ; 11c283
jr nz, .asm_11c2a2
call Function11c2ac
callba Function8cf69
callba Function104061
callba ReloadMapPart
jr .asm_11c283
.asm_11c2a2
@ -782,7 +782,7 @@ Function11c4be: ; 11c4be (47:44be)
hlcoord 0, 14, AttrMap
ld bc, $28
call ByteFill
callba Function104061
callba ReloadMapPart
ret
; 11c4db (47:44db)
@ -978,7 +978,7 @@ Function11c618: ; 11c618 (47:4618)
hlcoord 0, 6, AttrMap
ld bc, $c8
call ByteFill
callba Function104061
callba ReloadMapPart
ret
; 11c62a (47:462a)
@ -1585,7 +1585,7 @@ Function11c9ab: ; 11c9ab (47:49ab)
hlcoord 0, 6, AttrMap
ld bc, $c8
call ByteFill
callba Function104061
callba ReloadMapPart
ret
Function11c9bd: ; 11c9bd (47:49bd)
@ -1672,7 +1672,7 @@ Function11ca19: ; 11ca19 (47:4a19)
add hl, de
dec c
jr nz, .asm_11ca22
callba Function104061
callba ReloadMapPart
ret
; 11ca38 (47:4a38)
@ -2089,7 +2089,7 @@ Function11cdaa: ; 11cdaa (47:4daa)
hlcoord 0, 12, AttrMap
ld bc, $50
call ByteFill
callba Function104061
callba ReloadMapPart
ret
; 11cdc7 (47:4dc7)

View File

@ -173,7 +173,7 @@ Function17a78f: ; 17a78f (5e:678f)
ret
.asm_17a79f
callba Function104061
callba ReloadMapPart
ret
; 17a7a6 (5e:67a6)

View File

@ -93,7 +93,7 @@ Function8919e: ; 8919e (22:519e)
Function891ab: ; 891ab
call Function89240
callba Function104061
callba ReloadMapPart
call Function8923c
ret
; 891b8

View File

@ -1495,7 +1495,7 @@ Function100902: ; 100902
call PrintNum
ld de, SFX_TWO_PC_BEEPS
call PlaySFX
callba Function104061
callba ReloadMapPart
ld c, $3c
call DelayFrames
ret
@ -1506,7 +1506,7 @@ Function100902: ; 100902
call PlaceString
ld de, SFX_4_NOTE_DITTY
call PlaySFX
callba Function104061
callba ReloadMapPart
ld c, 120
call DelayFrames
ret
@ -1536,7 +1536,7 @@ Function100989: ; 100989
decoord 0, 0
call Function1009a5
call Function1009ae
callba Function104061
callba ReloadMapPart
ld hl, w3_dd68
decoord 0, 0, AttrMap
call Function1009a5

View File

@ -5750,7 +5750,7 @@ Function1161d5: ; 1161d5
pop af
ld [rSVBK], a
callba Function104061
callba ReloadMapPart
ld a, $8
ld [MusicFade], a
ld de, MUSIC_MOBILE_ADAPTER
@ -5931,7 +5931,7 @@ Function11636e: ; 11636e
call UpdateSprites
pop af
ld [rSVBK], a
callba Function104061
callba ReloadMapPart
ld a, $8
ld [MusicFade], a
ld a, [wc2c0]
@ -5975,7 +5975,7 @@ Function1163c0: ; 1163c0
callba Function14157
pop af
ld [rSVBK], a
callba Function104061
callba ReloadMapPart
ld a, [wLinkMode]
cp $4
jr z, .asm_11642a
@ -6006,7 +6006,7 @@ Function116441: ; 116441
callba Function17d405
ld a, $90
ld [hWY], a
callba Function104061
callba ReloadMapPart
ld a, $8
ld [MusicFade], a
ld a, [wc2c0]
@ -7711,7 +7711,7 @@ Function117699: ; 117699 (45:7699)
call ClearBGPalettes
call ClearSprites
callba Function171c87
callba Function104061
callba ReloadMapPart
callba Function8cf53
ret
@ -7722,7 +7722,7 @@ Function1176ee: ; 1176ee (45:76ee)
jr nz, .asm_117709
call Function117719
callba Function8cf69
callba Function104061
callba ReloadMapPart
jr Function1176ee
.asm_117709
callba Function8cf53
@ -7978,7 +7978,7 @@ Function1178aa: ; 1178aa (45:78aa)
call LoadMenuDataHeader
call MenuBox
call MenuBoxCoord2Tile
callba Function104061
callba ReloadMapPart
hlcoord 16, 8
ld de, String_1179c5
call PlaceString
@ -8077,7 +8077,7 @@ Function117984: ; 117984 (45:7984)
call LoadMenuDataHeader
call MenuBox
call MenuBoxCoord2Tile
callba Function104061
callba ReloadMapPart
hlcoord 1, 14
ld de, String_1179e1
call PlaceString
@ -8184,7 +8184,7 @@ Function117ab4: ; 0x117ab4
call ClearSprites
callba Function172e78
callba Function172eb9
callba Function104061
callba ReloadMapPart
ret
; 0x117acd
@ -8299,12 +8299,12 @@ Function117b4f:
jr nz, .asm_117ba4 ; 0x117b93 $f
call ExitMenu
call ExitMenu
callba Function104061
callba ReloadMapPart
jp Function117cdd
.asm_117ba4
call ExitMenu
call ExitMenu
callba Function104061
callba ReloadMapPart
ld a, $80
ld [wJumptableIndex], a
ret
@ -8387,7 +8387,7 @@ Function117c4a:
call LoadMenuDataHeader
call MenuBox
call MenuBoxCoord2Tile
callba Function104061
callba ReloadMapPart
ld hl, MobileStadiumSuccessText
call PrintText
ld a, [rSVBK]

View File

@ -4463,7 +4463,7 @@ Function119f98: ; 119f98
and a
jr z, .asm_119fd4
call ExitMenu
callba Function104061
callba ReloadMapPart
callba Function115dc3
ld a, [wcd33]
ld [wcf66], a
@ -4480,14 +4480,14 @@ Function119f98: ; 119f98
ld [wc30d], a
ld a, $1
ld [wc314], a
callba Function104061
callba ReloadMapPart
and a
ret
.asm_119fef
call ExitMenu
call ExitMenu
callba Function104061
callba ReloadMapPart
ld a, [wcd45]
ld [wcf66], a
callba Function115dc3
@ -4562,7 +4562,7 @@ Function11a00e: ; 11a00e
callba Function106462
callba Function106464
call ExitMenu
callba Function104061
callba ReloadMapPart
callba Function115d99
ld c, $0
callba Function115e18
@ -4585,7 +4585,7 @@ Function11a0ca: ; 11a0ca
callba Function106462
callba Function106464
call ExitMenu
callba Function104061
callba ReloadMapPart
callba Function115d99
ld c, $0
callba Function115e18
@ -4677,7 +4677,7 @@ Function11a192: ; 11a192
and a
jr nz, .asm_11a1b6
call ExitMenu
callba Function104061
callba ReloadMapPart
call Function11a63c
hlcoord 4, 2
ld de, String_11a6d2
@ -4687,7 +4687,7 @@ Function11a192: ; 11a192
.asm_11a1b6
call ExitMenu
callba Function104061
callba ReloadMapPart
ld a, [wcd45]
ld [wcf66], a
ld [wcd80], a
@ -4818,7 +4818,7 @@ Function11a235: ; 11a235
and a
jr nz, .asm_11a2c4
call ExitMenu
callba Function104061
callba ReloadMapPart
ld a, [wcd46]
cp $0
jr z, .asm_11a2b4
@ -4840,7 +4840,7 @@ Function11a235: ; 11a235
.asm_11a2c4
call ExitMenu
callba Function104061
callba ReloadMapPart
and a
ret
; 11a2cf
@ -4919,7 +4919,7 @@ Function11a33a: ; 11a33a
.asm_11a346
call ExitMenu
callba Function104061
callba ReloadMapPart
callba Function115dc3
and a
ret
@ -4963,7 +4963,7 @@ Function11a38d: ; 11a38d
and a
jr nz, .asm_11a3b1
call ExitMenu
callba Function104061
callba ReloadMapPart
call Function11a63c
hlcoord 4, 2
ld de, String_11a6d2
@ -4973,7 +4973,7 @@ Function11a38d: ; 11a38d
.asm_11a3b1
call ExitMenu
callba Function104061
callba ReloadMapPart
ld a, [wcd45]
ld [wcf66], a
ld [wcd80], a
@ -5038,7 +5038,7 @@ Function11a41b: ; 11a41b
and a
jr nz, .asm_11a43f
call ExitMenu
callba Function104061
callba ReloadMapPart
call Function11a63c
hlcoord 4, 2
ld de, String_11a6d2
@ -5048,7 +5048,7 @@ Function11a41b: ; 11a41b
.asm_11a43f
call ExitMenu
callba Function104061
callba ReloadMapPart
ld a, $1c
ld [wcf66], a
ld [wcd80], a
@ -5109,7 +5109,7 @@ Function11a49e: ; 11a49e
and a
jr nz, .asm_11a4c7
call ExitMenu
callba Function104061
callba ReloadMapPart
call Function11a63c
hlcoord 4, 2
ld de, String_11a6d2
@ -5121,7 +5121,7 @@ Function11a49e: ; 11a49e
.asm_11a4c7
call ExitMenu
callba Function104061
callba ReloadMapPart
ld a, [wcd46]
ld [wcf66], a
ld [wcd80], a
@ -5156,7 +5156,7 @@ Function11a4fe: ; 11a4fe
and a
jr nz, .asm_11a522
call ExitMenu
callba Function104061
callba ReloadMapPart
call Function11a63c
hlcoord 4, 2
ld de, String_11a6d2
@ -5166,7 +5166,7 @@ Function11a4fe: ; 11a4fe
.asm_11a522
call ExitMenu
callba Function104061
callba ReloadMapPart
ld a, [wcd45]
ld [wcf66], a
ld [wcd80], a
@ -5195,7 +5195,7 @@ Function11a536: ; 11a536
call Function11a9f0
jr nz, .asm_11a562
call ExitMenu
callba Function104061
callba ReloadMapPart
.asm_11a562
scf
@ -5271,7 +5271,7 @@ Function11a5b9: ; 11a5b9
ld b, $4
ld c, $12
call Function3eea
callba Function104061
callba ReloadMapPart
call UpdateSprites
ld c, $0
callba Function115e18
@ -5306,7 +5306,7 @@ Function11a5f5: ; 11a5f5
hlcoord 15, 7
ld a, $ed
ld [hl], a
callba Function104061
callba ReloadMapPart
ret
; 11a63c
@ -5840,7 +5840,7 @@ UnknownText_0x11ac1f: ; 0x11ac1f
Function11ac3e: ; 11ac3e
call SpeechTextBox
call FadeToMenu
callab InefficientlyClear121BytesAtwc300
callab ClearSpriteAnims
call Function11ac51
call ReturnToCallingMenu
ret
@ -5881,7 +5881,7 @@ Function11ac51: ; 11ac51
ld a, $78
ld [wc3b5], a
callba Function8cf7a
callba Function104061
callba ReloadMapPart
jr .asm_11ac82
.asm_11aca8
@ -6025,7 +6025,7 @@ Function11ad95: ; 11ad95
hlcoord 10, 10, AttrMap
ld bc, $0808
call Function11afd6
callba Function104061
callba ReloadMapPart
call Function11ad8a
ld a, $1
ld [MenuSelection2], a
@ -6104,7 +6104,7 @@ Function11adc4:
.asm_11ae2e
call ExitMenu
callba Function104061
callba ReloadMapPart
ret
; 11ae38
@ -6142,7 +6142,7 @@ Function11ae4e: ; 11ae4e
hlcoord 9, 12, AttrMap
lb bc, 6, 11
call Function11afd6
callba Function104061
callba ReloadMapPart
call Function11ad8a
ld a, $1
ld [MenuSelection2], a
@ -6210,7 +6210,7 @@ Function11ae98:
.asm_11aef7
call ExitMenu
call ExitMenu
callba Function104061
callba ReloadMapPart
ret
; 11af04
@ -6233,7 +6233,7 @@ Function11af04: ; 11af04
hlcoord 9, 12, AttrMap
lb bc, 6, 11
call Function11afd6
callba Function104061
callba ReloadMapPart
call Function11ad8a
ld a, $2
ld [MenuSelection2], a
@ -6301,7 +6301,7 @@ Function11af4e:
.asm_11afaa
call ExitMenu
call ExitMenu
callba Function104061
callba ReloadMapPart
ret
; 11afb7

View File

@ -391,7 +391,7 @@ Function1704f1: ; 1704f1
bit 7, a
jr nz, .asm_17050f
call Function170510
callba Function104061
callba ReloadMapPart
jr .asm_1704fa
.asm_17050f
@ -1692,7 +1692,7 @@ Function1719ed: ; 1719ed (5c:59ed)
call ClearBGPalettes
call ClearSprites
callba Function171d2b
callba Function104061
callba ReloadMapPart
callba Function8cf53
ret
@ -1703,7 +1703,7 @@ Function171a11: ; 171a11 (5c:5a11)
jr nz, .asm_171a2c
call Function171a36
callba Function8cf69
callba Function104061
callba ReloadMapPart
jr Function171a11
.asm_171a2c
callba Function8cf53
@ -1960,7 +1960,7 @@ Function171beb: ; 171beb (5c:5beb)
call LoadMenuDataHeader
call MenuBox
call MenuBoxCoord2Tile
callba Function104061
callba ReloadMapPart
hlcoord 1, 14
ld de, String_171c73
call PlaceString

View File

@ -81,7 +81,7 @@ Function17c000: ; 17c000
ld [rVBK], a
call EnableLCD
callba Function104061
callba ReloadMapPart
ret
; 17c083
@ -629,7 +629,7 @@ Function17d370: ; 17d370
call ClearBGPalettes
call ClearSprites
call ClearScreen
callba Function104061
callba ReloadMapPart
call DisableLCD
ld hl, VTiles1 tile $6e
ld de, $c608
@ -675,7 +675,7 @@ Function17d3f6: ; 17d3f6
call ClearBGPalettes
call ClearSprites
call ClearScreen
callba Function104061
callba ReloadMapPart
Function17d405:
call DisableLCD
@ -721,7 +721,7 @@ Function17d45a: ; 17d45a
bit 7, a
jr nz, .asm_17d46f
call Function17d474
callba Function104061
callba ReloadMapPart
jr .asm_17d45a
.asm_17d46f
@ -935,7 +935,7 @@ endr
call Function17e451
call Function17e55b
call Function17e5af
callba Function104061
callba ReloadMapPart
jp Function17e438
; 17d5be

View File

@ -372,8 +372,8 @@ TilePermissions:: ; c2fe
SECTION "c300", WRAM0 [$c300]
; wc300 - wc313 is a 10x2 dictionary.
wDict_c300:: ds 10 * 2
ds wDict_c300 - @
wSpriteAnimDict:: ds 10 * 2
ds wSpriteAnimDict - @
wc300:: ds 1
wc301:: ds 1
wc302:: ds 1
@ -456,7 +456,7 @@ wc3bd:: ds 1
wc3be:: ds 1
wc3bf:: ds 1
wc3c0:: ds 1
; wc300_data_end
wSpriteAnimsEnd::
wc3c1:: ds 11
wc3cc:: ds 1