pokecrystal-board/main.asm

2244 lines
35 KiB
NASM

INCLUDE "includes.asm"
SECTION "bank1", ROMX
PlaceWaitingText:: ; 4000
hlcoord 3, 10
ld b, 1
ld c, 11
ld a, [wBattleMode]
and a
jr z, .notinbattle
call TextBox
jr .proceed
.notinbattle
predef Predef_LinkTextbox
.proceed
hlcoord 4, 11
ld de, .Waiting
call PlaceString
ld c, 50
jp DelayFrames
.Waiting: ; 4025
db "Waiting...!@"
LoadPushOAM:: ; 4031
ld c, hPushOAM - $ff00
ld b, PushOAMEnd - PushOAM
ld hl, PushOAM
.loop
ld a, [hli]
ld [$ff00+c], a
inc c
dec b
jr nz, .loop
ret
PushOAM: ; 403f
ld a, Sprites / $100
ld [rDMA], a
ld a, (SpritesEnd - Sprites) / 4 ; 40
.loop
dec a
jr nz, .loop
ret
PushOAMEnd
INCLUDE "engine/map_objects.asm"
INCLUDE "engine/intro_menu.asm"
INCLUDE "engine/init_map.asm"
INCLUDE "engine/learn.asm"
INCLUDE "engine/check_nick_errors.asm"
INCLUDE "engine/math.asm"
INCLUDE "data/items/item_attributes.asm"
INCLUDE "engine/npc_movement.asm"
INCLUDE "event/happiness_egg.asm"
INCLUDE "event/special.asm"
SECTION "bank2", ROMX
INCLUDE "engine/player_object.asm"
INCLUDE "engine/sine.asm"
INCLUDE "engine/predef.asm"
INCLUDE "engine/color.asm"
SECTION "bank3", ROMX
INCLUDE "engine/check_time.asm"
INCLUDE "engine/specials.asm"
INCLUDE "engine/printnum.asm"
INCLUDE "engine/health.asm"
INCLUDE "event/overworld.asm"
INCLUDE "engine/items.asm"
INCLUDE "engine/player_step.asm"
INCLUDE "engine/anim_hp_bar.asm"
INCLUDE "engine/move_mon.asm"
INCLUDE "engine/billspctop.asm"
GetBreedMon1LevelGrowth: ; e698
ld hl, wBreedMon1Stats
ld de, TempMon
ld bc, BOXMON_STRUCT_LENGTH
call CopyBytes
callab CalcLevel
ld a, [wBreedMon1Level]
ld b, a
ld a, d
ld e, a
sub b
ld d, a
ret
GetBreedMon2LevelGrowth: ; e6b3
ld hl, wBreedMon2Stats
ld de, TempMon
ld bc, BOXMON_STRUCT_LENGTH
call CopyBytes
callab CalcLevel
ld a, [wBreedMon2Level]
ld b, a
ld a, d
ld e, a
sub b
ld d, a
ret
BugContest_SetCaughtContestMon: ; e6ce
ld a, [wContestMon]
and a
jr z, .firstcatch
ld [wd265], a
callba DisplayAlreadyCaughtText
callba DisplayCaughtContestMonStats
lb bc, 14, 7
call PlaceYesNoBox
ret c
.firstcatch
call .generatestats
ld a, [TempEnemyMonSpecies]
ld [wd265], a
call GetPokemonName
ld hl, .caughttext
call PrintText
ret
.generatestats ; e6fd
ld a, [TempEnemyMonSpecies]
ld [CurSpecies], a
ld [CurPartySpecies], a
call GetBaseData
xor a
ld bc, PARTYMON_STRUCT_LENGTH
ld hl, wContestMon
call ByteFill
xor a
ld [MonType], a
ld hl, wContestMon
jp GeneratePartyMonStats
.caughttext ; 0xe71d
; Caught @ !
text_jump UnknownText_0x1c10c0
db "@"
INCLUDE "engine/item_effects.asm"
KnowsMove: ; f9ea
ld a, MON_MOVES
call GetPartyParamLocation
ld a, [wPutativeTMHMMove]
ld b, a
ld c, NUM_MOVES
.loop
ld a, [hli]
cp b
jr z, .knows_move
dec c
jr nz, .loop
and a
ret
.knows_move
ld hl, .Text_knows
call PrintText
scf
ret
.Text_knows: ; 0xfa06
; knows @ .
text_jump UnknownText_0x1c5ea8
db "@"
SECTION "bank4", ROMX
INCLUDE "engine/pack.asm"
INCLUDE "engine/time.asm"
INCLUDE "engine/tmhm.asm"
INCLUDE "engine/namingscreen.asm"
Script_AbortBugContest: ; 0x122c1
checkflag ENGINE_BUG_CONTEST_TIMER
iffalse .finish
setflag ENGINE_DAILY_BUG_CONTEST
special ContestReturnMons
.finish
end
INCLUDE "event/itemball.asm"
INCLUDE "engine/healmachineanim.asm"
INCLUDE "event/whiteout.asm"
INCLUDE "event/forced_movement.asm"
INCLUDE "event/itemfinder.asm"
INCLUDE "engine/startmenu.asm"
INCLUDE "engine/selectmenu.asm"
INCLUDE "event/elevator.asm"
INCLUDE "event/bug_contest.asm"
INCLUDE "event/hidden_items.asm"
INCLUDE "engine/collision_stdscripts.asm"
INCLUDE "event/bug_contest_judging.asm"
INCLUDE "engine/pokerus_tick.asm"
INCLUDE "event/bug_contest_2.asm"
INCLUDE "engine/unused_correct_party.asm"
INCLUDE "engine/square_root.asm"
SECTION "bank5", ROMX
INCLUDE "engine/rtc.asm"
INCLUDE "engine/overworld.asm"
INCLUDE "engine/tile_events.asm"
INCLUDE "engine/save.asm"
INCLUDE "engine/spawn_points.asm"
INCLUDE "engine/map_setup.asm"
INCLUDE "engine/pokecenter_pc.asm"
INCLUDE "engine/mart.asm"
INCLUDE "engine/money.asm"
INCLUDE "data/items/marts.asm"
INCLUDE "event/mom.asm"
INCLUDE "event/daycare.asm"
INCLUDE "event/photo.asm"
INCLUDE "engine/breeding.asm"
INCLUDE "tilesets/data.asm"
SECTION "Clock Reset", ROMX
INCLUDE "engine/clock_reset.asm"
SECTION "bank9", ROMX
StringBufferPointers:: ; 24000
dw StringBuffer3
dw StringBuffer4
dw StringBuffer5
dw StringBuffer2
dw StringBuffer1
dw EnemyMonNick
dw BattleMonNick
INCLUDE "engine/menu.asm"
UpdateItemDescription: ; 0x244c3
ld a, [MenuSelection]
ld [CurSpecies], a
hlcoord 0, 12
ld b, 4
ld c, SCREEN_WIDTH - 2
call TextBox
ld a, [MenuSelection]
cp -1
ret z
decoord 1, 14
callba PrintItemDescription
ret
INCLUDE "engine/pokepic.asm"
INCLUDE "engine/map_objects_2.asm"
INCLUDE "engine/scrolling_menu.asm"
INCLUDE "engine/switch_items.asm"
INCLUDE "engine/menu_2.asm"
INCLUDE "engine/mon_menu.asm"
INCLUDE "battle/menu.asm"
INCLUDE "engine/buy_sell_toss.asm"
INCLUDE "engine/trainer_card.asm"
INCLUDE "engine/prof_oaks_pc.asm"
INCLUDE "engine/decorations.asm"
PadCoords_de: ; 27092
ld a, d
add 4
ld d, a
ld a, e
add 4
ld e, a
call GetBlockLocation
ret
LevelUpHappinessMod: ; 2709e
ld a, [CurPartyMon]
ld hl, PartyMon1CaughtLocation
call GetPartyLocation
ld a, [hl]
and $7f
ld d, a
ld a, [MapGroup]
ld b, a
ld a, [MapNumber]
ld c, a
call GetWorldMapLocation
cp d
ld c, HAPPINESS_GAINLEVEL
jr nz, .ok
ld c, HAPPINESS_GAINLEVELATHOME
.ok
callab ChangeHappiness
ret
INCLUDE "data/trainers/trainer_dvs.asm"
_ReturnToBattle_UseBall: ; 2715c
call ClearBGPalettes
call ClearTileMap
ld a, [BattleType]
cp BATTLETYPE_TUTORIAL
jr z, .gettutorialbackpic
callba GetMonBackpic
jr .continue
.gettutorialbackpic
callba GetTrainerBackpic
.continue
callba GetMonFrontpic
callba _LoadBattleFontsHPBar
call GetMemSGBLayout
call CloseWindow
call LoadStandardMenuDataHeader
call WaitBGMap
jp SetPalettes
INCLUDE "engine/consume_held_item.asm"
INCLUDE "battle/moves/move_effects_pointers.asm"
INCLUDE "battle/moves/move_effects.asm"
Kurt_SelectQuantity_InterpretJoypad: ; 27a28
call BuySellToss_InterpretJoypad
ld b, a
ret
SECTION "bankA", ROMX
INCLUDE "engine/link.asm"
Function29fe4: ; unreferenced
ld a, $0
call GetSRAMBank
ld d, $0
ld b, CHECK_FLAG
predef FlagPredef
call CloseSRAM
ld a, c
and a
ret
INCLUDE "engine/wildmons.asm"
INCLUDE "battle/link_result.asm"
ChrisBackpic: ; 2ba1a
INCBIN "gfx/player/chris_back.2bpp.lz"
DudeBackpic: ; 2bbaa
INCBIN "gfx/battle/dude.2bpp.lz"
SECTION "bankB", ROMX
INCLUDE "battle/trainer_huds.asm"
INCLUDE "data/trainers/trainer_class_names.asm"
INCLUDE "battle/ai/redundant.asm"
INCLUDE "event/move_deleter.asm"
INCLUDE "engine/mysterygift2.asm"
INCLUDE "engine/tmhm2.asm"
INCLUDE "battle/moves/move_descriptions.asm"
INCLUDE "engine/pokerus.asm"
INCLUDE "engine/start_battle.asm"
PlaceGraphic: ; 2ef6e
; Fill wBoxAlignment-aligned box width b height c
; with iterating tile starting from hGraphicStartTile at hl.
; Predef $13
ld de, SCREEN_WIDTH
ld a, [wBoxAlignment]
and a
jr nz, .right
ld a, [hGraphicStartTile]
.x1
push bc
push hl
.y1
ld [hl], a
add hl, de
inc a
dec c
jr nz, .y1
pop hl
inc hl
pop bc
dec b
jr nz, .x1
ret
.right
; Right-aligned.
push bc
ld b, 0
dec c
add hl, bc
pop bc
ld a, [hGraphicStartTile]
.x2
push bc
push hl
.y2
ld [hl], a
add hl, de
inc a
dec c
jr nz, .y2
pop hl
dec hl
pop bc
dec b
jr nz, .x2
ret
SECTION "Effect Commands", ROMX
INCLUDE "battle/effect_commands.asm"
SECTION "Enemy Trainers", ROMX
INCLUDE "battle/ai/items.asm"
INCLUDE "battle/ai/scoring.asm"
INCLUDE "engine/read_trainer_attributes.asm"
INCLUDE "data/trainers/trainer_attributes.asm"
INCLUDE "engine/read_trainer_party.asm"
INCLUDE "data/trainers/party_pointers.asm"
INCLUDE "data/trainers/parties.asm"
SECTION "Battle Core", ROMX
INCLUDE "battle/core.asm"
INCLUDE "battle/effect_command_pointers.asm"
SECTION "bank10", ROMX
INCLUDE "engine/pokedex.asm"
INCLUDE "battle/moves/moves.asm"
INCLUDE "engine/evolve.asm"
SECTION "bank11", ROMX
INCLUDE "engine/fruit_trees.asm"
INCLUDE "battle/ai/move.asm"
INCLUDE "engine/pokedex_2.asm"
INCLUDE "data/pokemon/dex_entry_pointers.asm"
INCLUDE "engine/mail.asm"
SECTION "Crystal Unique", ROMX
INCLUDE "engine/init_gender.asm"
DrawKrisPackGFX: ; 48e81
ld hl, PackFGFXPointers
add hl, de
add hl, de
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, VTiles2 tile $50
lb bc, BANK(PackFGFX), 15
call Request2bpp
ret
PackFGFXPointers: ; 48e93
dw PackFGFX + (15 tiles) * 1
dw PackFGFX + (15 tiles) * 3
dw PackFGFX + (15 tiles) * 0
dw PackFGFX + (15 tiles) * 2
PackFGFX: ; 48e9b
INCBIN "gfx/pack/pack_f.2bpp"
INCLUDE "event/move_tutor.asm"
INCLUDE "engine/crystal_colors.asm"
INCLUDE "event/celebi.asm"
INCLUDE "engine/main_menu.asm"
INCLUDE "mobile/mobile_menu.asm"
INCLUDE "engine/search.asm"
; mobile battle selection
INCLUDE "mobile/mobile_12_2.asm"
AskRememberPassword: ; 4ae12
call .DoMenu
ld a, $0
jr c, .okay
ld a, $1
.okay
ld [ScriptVar], a
ret
.DoMenu: ; 4ae1f
lb bc, 14, 7
push bc
ld hl, YesNoMenuDataHeader
call CopyMenuDataHeader
pop bc
ld a, b
ld [wMenuBorderLeftCoord], a
add $5
ld [wMenuBorderRightCoord], a
ld a, c
ld [wMenuBorderTopCoord], a
add $4
ld [wMenuBorderBottomCoord], a
call PushWindow
call VerticalMenu
push af
ld c, 15
call DelayFrames
call Buena_ExitMenu
pop af
jr c, .refused
ld a, [wMenuCursorY]
cp $2
jr z, .refused
and a
ret
.refused
ld a, $2
ld [wMenuCursorY], a
scf
ret
Buena_ExitMenu: ; 4ae5e
ld a, [hOAMUpdate]
push af
call ExitMenu
call UpdateSprites
xor a
ld [hOAMUpdate], a
call DelayFrame
ld a, $1
ld [hOAMUpdate], a
call ApplyTilemap
pop af
ld [hOAMUpdate], a
ret
SECTION "bank13", ROMX
INCLUDE "engine/map_palettes.asm"
INCLUDE "tilesets/palette_maps.asm"
Unknown_4ce05: ; unreferenced
rept 26
db $06
endr
; 0x4ce1f
INCLUDE "data/collision_permissions.asm"
EmptyAllSRAMBanks: ; 4cf1f
ld a, $0
call .EmptyBank
ld a, $1
call .EmptyBank
ld a, $2
call .EmptyBank
ld a, $3
call .EmptyBank
ret
.EmptyBank: ; 4cf34
call GetSRAMBank
ld hl, SRAM_Begin
ld bc, SRAM_End - SRAM_Begin
xor a
call ByteFill
call CloseSRAM
ret
SaveMenu_LoadEDTile: ; 4cf45 (13:4f45)
ld a, [hCGB]
and a
jp z, WaitBGMap
; The following is a modified version of LoadEDTile.
ld a, [hBGMapMode]
push af
xor a
ld [hBGMapMode], a
ld a, [hMapAnims]
push af
xor a
ld [hMapAnims], a
.WaitLY:
ld a, [rLY]
cp $60
jr c, .WaitLY
di
ld a, 1 ; BANK(VBGMap2)
ld [rVBK], a
hlcoord 0, 0, AttrMap
call .LoadEDTile
ld a, 0 ; BANK(VBGMap0)
ld [rVBK], a
hlcoord 0, 0
call .LoadEDTile
.WaitLY2:
ld a, [rLY]
cp $60
jr c, .WaitLY2
ei
pop af
ld [hMapAnims], a
pop af
ld [hBGMapMode], a
ret
.LoadEDTile: ; 4cf80 (13:4f80)
ld [hSPBuffer], sp ; $ffd9
ld sp, hl
ld a, [hBGMapAddress + 1]
ld h, a
ld l, 0
ld a, SCREEN_HEIGHT
ld [hTilesPerCycle], a
ld b, 1 << 1
ld c, rSTAT % $100
.loop
rept SCREEN_WIDTH / 2
pop de
.loop\@
ld a, [$ff00+c]
and b
jr nz, .loop\@
ld [hl], e
inc l
ld [hl], d
inc l
endr
ld de, $20 - SCREEN_WIDTH
add hl, de
ld a, [hTilesPerCycle]
dec a
ld [hTilesPerCycle], a
jr nz, .loop
ld a, [hSPBuffer]
ld l, a
ld a, [hSPBuffer + 1]
ld h, a
ld sp, hl
ret
CheckSave:: ; 4cffe
ld a, BANK(s1_a008)
call GetSRAMBank
ld a, [s1_a008]
ld b, a
ld a, [s1_ad0f]
ld c, a
call CloseSRAM
ld a, b
cp 99
jr nz, .ok
ld a, c
cp " "
jr nz, .ok
ld c, $1
ret
.ok
ld c, $0
ret
INCLUDE "data/maps/map_triggers.asm"
_LoadMapPart:: ; 4d15b
ld hl, wMisc
ld a, [wMetatileStandingY]
and a
jr z, .top_row
ld bc, WMISC_WIDTH * 2
add hl, bc
.top_row
ld a, [wMetatileStandingX]
and a
jr z, .left_column
inc hl
inc hl
.left_column
decoord 0, 0
ld b, SCREEN_HEIGHT
.loop
ld c, SCREEN_WIDTH
.loop2
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .loop2
ld a, l
add 4
ld l, a
jr nc, .carry
inc h
.carry
dec b
jr nz, .loop
ret
PhoneRing_LoadEDTile: ; 4d188
ld a, [hCGB]
and a
jp z, WaitBGMap
ld a, [wSpriteUpdatesEnabled]
cp $0
jp z, WaitBGMap
; What follows is a modified version of LoadEDTile.
ld a, [hBGMapMode]
push af
xor a
ld [hBGMapMode], a
ld a, [hMapAnims]
push af
xor a
ld [hMapAnims], a
.wait
ld a, [rLY]
cp $8f
jr c, .wait
di
ld a, 1 ; BANK(VBGMap2)
ld [rVBK], a
hlcoord 0, 0, AttrMap
call .LoadEDTile
ld a, 0 ; BANK(VBGMap0)
ld [rVBK], a
hlcoord 0, 0
call .LoadEDTile
.wait2
ld a, [rLY]
cp $8f
jr c, .wait2
ei
pop af
ld [hMapAnims], a
pop af
ld [hBGMapMode], a
ret
.LoadEDTile: ; 4d1cb
ld [hSPBuffer], sp
ld sp, hl
ld a, [hBGMapAddress + 1]
ld h, a
ld l, 0
ld a, SCREEN_HEIGHT
ld [hTilesPerCycle], a
ld b, 1 << 1 ; not in v/hblank
ld c, rSTAT % $100
.loop
rept SCREEN_WIDTH / 2
pop de
.loop\@
ld a, [$ff00+c]
and b
jr nz, .loop\@
ld [hl], e
inc l
ld [hl], d
inc l
endr
ld de, $20 - SCREEN_WIDTH
add hl, de
ld a, [hTilesPerCycle]
dec a
ld [hTilesPerCycle], a
jr nz, .loop
ld a, [hSPBuffer]
ld l, a
ld a, [hSPBuffer + 1]
ld h, a
ld sp, hl
ret
Shrink1Pic: ; 4d249
INCBIN "gfx/shrink/shrink1.2bpp.lz"
Shrink2Pic: ; 4d2d9
INCBIN "gfx/shrink/shrink2.2bpp.lz"
LinkMonStatsScreen: ; 4d319
ld a, [wMenuCursorY]
dec a
ld [CurPartyMon], a
call LowVolume
predef StatsScreenInit
ld a, [CurPartyMon]
inc a
ld [wMenuCursorY], a
call ClearScreen
call ClearBGPalettes
call MaxVolume
callba LoadTradeScreenBorder
callba Link_WaitBGMap
callba InitTradeSpeciesList
callba SetTradeRoomBGPals
call WaitBGMap2
ret
Link_WaitBGMap: ; 4d354
call WaitBGMap
call WaitBGMap2
ret
LinkTextbox2: ; 4d35b
ld h, d
ld l, e
push bc
push hl
call .PlaceBorder
pop hl
pop bc
ld de, AttrMap - TileMap
add hl, de
inc b
inc b
inc c
inc c
ld a, $7
.row
push bc
push hl
.col
ld [hli], a
dec c
jr nz, .col
pop hl
ld de, SCREEN_WIDTH
add hl, de
pop bc
dec b
jr nz, .row
ret
.PlaceBorder: ; 4d37e
push hl
ld a, $76
ld [hli], a
inc a
call .PlaceRow
inc a
ld [hl], a
pop hl
ld de, SCREEN_WIDTH
add hl, de
.loop
push hl
ld a, "┌"
ld [hli], a
ld a, " "
call .PlaceRow
ld [hl], "─"
pop hl
ld de, SCREEN_WIDTH
add hl, de
dec b
jr nz, .loop
ld a, "┐"
ld [hli], a
ld a, "│"
call .PlaceRow
ld [hl], "└"
ret
.PlaceRow: ; 4d3ab
ld d, c
.row_loop
ld [hli], a
dec d
jr nz, .row_loop
ret
INCLUDE "engine/delete_save_change_clock.asm"
INCLUDE "tilesets/tileset_headers.asm"
FlagPredef: ; 4d7c1
; Perform action b on flag c in flag array hl.
; If checking a flag, check flag array d:hl unless d is 0.
; For longer flag arrays, see FlagAction.
push hl
push bc
; Divide by 8 to get the byte we want.
push bc
srl c
srl c
srl c
ld b, 0
add hl, bc
pop bc
; Which bit we want from the byte
ld a, c
and 7
ld c, a
; Shift left until we can mask the bit
ld a, 1
jr z, .shifted
.shift
add a
dec c
jr nz, .shift
.shifted
ld c, a
; What are we doing to this flag?
dec b
jr z, .set ; 1
dec b
jr z, .check ; 2
.reset
ld a, c
cpl
and [hl]
ld [hl], a
jr .done
.set
ld a, [hl]
or c
ld [hl], a
jr .done
.check
ld a, d
cp 0
jr nz, .farcheck
ld a, [hl]
and c
jr .done
.farcheck
call GetFarByte
and c
.done
pop bc
pop hl
ld c, a
ret
GetTrademonFrontpic: ; 4d7fd
ld a, [wOTTrademonSpecies]
ld hl, wOTTrademonDVs
ld de, VTiles2
push de
push af
predef GetUnownLetter
pop af
ld [CurPartySpecies], a
ld [CurSpecies], a
call GetBaseData
pop de
predef FrontpicPredef
ret
AnimateTrademonFrontpic: ; 4d81e
ld a, [wOTTrademonSpecies]
call IsAPokemon
ret c
callba ShowOTTrademonStats
ld a, [wOTTrademonSpecies]
ld [CurPartySpecies], a
ld a, [wOTTrademonDVs]
ld [TempMonDVs], a
ld a, [wOTTrademonDVs + 1]
ld [TempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
callba TradeAnim_ShowGetmonFrontpic
ld a, [wOTTrademonSpecies]
ld [CurPartySpecies], a
hlcoord 7, 2
ld d, $0
ld e, ANIM_MON_TRADE
predef AnimateFrontpic
ret
CheckPokerus: ; 4d860
; Return carry if a monster in your party has Pokerus
; Get number of monsters to iterate over
ld a, [PartyCount]
and a
jr z, .NoPokerus
ld b, a
; Check each monster in the party for Pokerus
ld hl, PartyMon1PokerusStatus
ld de, PARTYMON_STRUCT_LENGTH
.Check:
ld a, [hl]
and $0f ; only the bottom nybble is used
jr nz, .HasPokerus
; Next PartyMon
add hl, de
dec b
jr nz, .Check
.NoPokerus:
and a
ret
.HasPokerus:
scf
ret
INCLUDE "event/lucky_number.asm"
INCLUDE "engine/caught_data.asm"
INCLUDE "engine/search2.asm"
INCLUDE "engine/stats_screen.asm"
INCLUDE "event/catch_tutorial.asm"
INCLUDE "engine/evolution_animation.asm"
InitDisplayForHallOfFame: ; 4e881
call ClearBGPalettes
call ClearTileMap
call ClearSprites
call DisableLCD
call LoadStandardFont
call LoadFontsBattleExtra
hlbgcoord 0, 0
ld bc, VBGMap1 - VBGMap0
ld a, " "
call ByteFill
hlcoord 0, 0, AttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
xor a
ld [hSCY], a
ld [hSCX], a
call EnableLCD
ld hl, .SavingRecordDontTurnOff
call PrintText
call WaitBGMap2
call SetPalettes
ret
.SavingRecordDontTurnOff: ; 0x4e8bd
; SAVING RECORD… DON'T TURN OFF!
text_jump UnknownText_0x1bd39e
db "@"
InitDisplayForRedCredits: ; 4e8c2
call ClearBGPalettes
call ClearTileMap
call ClearSprites
call DisableLCD
call LoadStandardFont
call LoadFontsBattleExtra
hlbgcoord 0, 0
ld bc, VBGMap1 - VBGMap0
ld a, " "
call ByteFill
hlcoord 0, 0, AttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
ld hl, UnknBGPals
ld c, 4 tiles
.load_white_palettes
ld a, (palred 31 + palgreen 31 + palblue 31) % $100
ld [hli], a
ld a, (palred 31 + palgreen 31 + palblue 31) / $100
ld [hli], a
dec c
jr nz, .load_white_palettes
xor a
ld [hSCY], a
ld [hSCX], a
call EnableLCD
call WaitBGMap2
call SetPalettes
ret
ResetDisplayBetweenHallOfFameMons: ; 4e906
ld a, [rSVBK]
push af
ld a, $6
ld [rSVBK], a
ld hl, wDecompressScratch
ld bc, wScratchAttrMap - wDecompressScratch
ld a, " "
call ByteFill
hlbgcoord 0, 0
ld de, wDecompressScratch
ld b, 0
ld c, 4 tiles
call Request2bpp
pop af
ld [rSVBK], a
ret
GetMobileOTTrainerClass: ; mobile function
ld h, b
ld l, c
call .GetMobileOTTrainerClass
ld c, a
ret
.GetMobileOTTrainerClass: ; 4e930
ld a, [hli]
xor [hl]
ld c, a
jr z, .skip_male_trainers
srl c
srl c
.male_trainer_loop
srl c
ld a, c
cp MaleTrainersEnd - MaleTrainers - 1
jr nc, .male_trainer_loop
inc c
.skip_male_trainers
ld a, [de]
cp $1
ld hl, MaleTrainers
jr nz, .finished
ld hl, FemaleTrainers
ld a, c
and a
jr z, .finished
.female_trainer_loop
srl c
ld a, c
cp FemaleTrainersEnd - FemaleTrainers - 1
jr nc, .female_trainer_loop
inc c
.finished
ld b, $0
add hl, bc
ld a, [hl]
ret
INCLUDE "data/trainers/gendered_trainers.asm"
INCLUDE "battle/sliding_intro.asm"
Mobile_PrintOpponentBattleMessage: ; 4ea0a
ld a, c
push af
call SpeechTextBox
call MobileTextBorder
pop af
dec a
ld bc, $c
ld hl, w5_MobileOpponentBattleMessages
call AddNTimes
ld de, wMobileOpponentBattleMessage
ld bc, $c
ld a, $5 ; BANK(w5_MobileOpponentBattleMessages)
call FarCopyWRAM
ld a, [rSVBK]
push af
ld a, $1
ld [rSVBK], a
ld bc, wMobileOpponentBattleMessage
decoord 1, 14
callba PrintEZChatBattleMessage
pop af
ld [rSVBK], a
ld c, 180
call DelayFrames
ret
CheckBattleScene: ; 4ea44
; Return carry if battle scene is turned off.
ld a, 0
ld hl, wLinkMode
call GetFarWRAMByte
cp LINK_MOBILE
jr z, .mobile
ld a, [Options]
bit BATTLE_SCENE, a
jr nz, .off
and a
ret
.mobile
ld a, [wcd2f]
and a
jr nz, .from_wram
ld a, $4
call GetSRAMBank
ld a, [$a60c]
ld c, a
call CloseSRAM
ld a, c
bit 0, c
jr z, .off
and a
ret
.from_wram
ld a, $5
ld hl, w5_dc00
call GetFarWRAMByte
bit 0, a
jr z, .off
and a
ret
.off
scf
ret
INCLUDE "engine/gbc_only.asm"
INCLUDE "event/poke_seer.asm"
SECTION "bank14", ROMX
INCLUDE "engine/party_menu.asm"
INCLUDE "event/poisonstep.asm"
INCLUDE "event/sweet_scent.asm"
INCLUDE "event/squirtbottle.asm"
INCLUDE "event/card_key.asm"
INCLUDE "event/basement_key.asm"
INCLUDE "event/sacred_ash.asm"
CopyPkmnToTempMon: ; 5084a
; gets the BaseData of a Pkmn
; and copys the PkmnStructure to TempMon
ld a, [CurPartyMon]
ld e, a
call GetPkmnSpecies
ld a, [CurPartySpecies]
ld [CurSpecies], a
call GetBaseData
ld a, [MonType]
ld hl, PartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
and a
jr z, .copywholestruct
ld hl, OTPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
cp OTPARTYMON
jr z, .copywholestruct
ld bc, BOXMON_STRUCT_LENGTH
callab CopyBoxmonToTempMon
jr .done
.copywholestruct
ld a, [CurPartyMon]
call AddNTimes
ld de, TempMon
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
.done
ret
CalcwBufferMonStats: ; 5088b
ld bc, wBufferMon
jr _TempMonStatsCalculation
CalcTempmonStats: ; 50890
ld bc, TempMon
_TempMonStatsCalculation: ; 50893
ld hl, MON_LEVEL
add hl, bc
ld a, [hl]
ld [CurPartyLevel], a
ld hl, MON_MAXHP
add hl, bc
ld d, h
ld e, l
ld hl, MON_STAT_EXP - 1
add hl, bc
push bc
ld b, $1
predef CalcPkmnStats
pop bc
ld hl, MON_HP
add hl, bc
ld d, h
ld e, l
ld a, [CurPartySpecies]
cp EGG
jr nz, .not_egg
xor a
ld [de], a
inc de
ld [de], a
jr .zero_status
.not_egg
push bc
ld hl, MON_MAXHP
add hl, bc
ld bc, 2
call CopyBytes
pop bc
.zero_status
ld hl, MON_STATUS
add hl, bc
xor a
ld [hli], a
ld [hl], a
ret
GetPkmnSpecies: ; 508d5
; [MonType] has the type of the Pkmn
; e = Nr. of Pkmn (i.e. [CurPartyMon])
ld a, [MonType]
and a ; PARTYMON
jr z, .partymon
cp OTPARTYMON
jr z, .otpartymon
cp BOXMON
jr z, .boxmon
cp TEMPMON
jr z, .breedmon
; WILDMON
.partymon
ld hl, PartySpecies
jr .done
.otpartymon
ld hl, OTPartySpecies
jr .done
.boxmon
ld a, BANK(sBoxSpecies)
call GetSRAMBank
ld hl, sBoxSpecies
call .done
call CloseSRAM
ret
.breedmon
ld a, [wBreedMon1Species]
jr .done2
.done
ld d, 0
add hl, de
ld a, [hl]
.done2
ld [CurPartySpecies], a
ret
INCLUDE "text/types.asm"
INCLUDE "text/unused_gen_1_trainers.asm"
INCLUDE "engine/mon_stats.asm"
InitList: ; 50db9
ld a, [wInitListType]
cp INIT_ENEMYOT_LIST
jr nz, .check_party_ot_name
ld hl, OTPartyCount
ld de, OTPartyMonOT
ld a, ENEMY_OT_NAME
jr .done
.check_party_ot_name
cp INIT_PLAYEROT_LIST
jr nz, .check_mon_name
ld hl, PartyCount
ld de, PartyMonOT
ld a, PARTY_OT_NAME
jr .done
.check_mon_name
cp INIT_MON_LIST
jr nz, .check_item_name
ld hl, CurMart
ld de, PokemonNames
ld a, PKMN_NAME
jr .done
.check_item_name
cp INIT_BAG_ITEM_LIST
jr nz, .check_ob_item_name
ld hl, NumItems
ld de, ItemNames
ld a, ITEM_NAME
jr .done
.check_ob_item_name
ld hl, CurMart
ld de, ItemNames
ld a, ITEM_NAME
.done
ld [wNamedObjectTypeBuffer], a ; d265
ld a, l
ld [wListPointer], a
ld a, h
ld [wListPointer + 1], a
ld a, e
ld [wUnusedD102], a
ld a, d
ld [wUnusedD102 + 1], a
ld bc, ItemAttributes ; ParseEnemyAction, HandleMapTimeAndJoypad, Music_LakeOfRage_Ch3, String_11a7c1 $67c1
ld a, c
ld [wItemAttributesPtr], a
ld a, b
ld [wItemAttributesPtr + 1], a
ret
INCLUDE "engine/experience.asm"
_SwitchPartyMons:
ld a, [wd0e3]
dec a
ld [Buffer3], a
ld b, a
ld a, [wMenuCursorY]
dec a
ld [Buffer2], a
cp b
jr z, .skip
call .SwapMonAndMail
ld a, [Buffer3]
call .ClearSprite
ld a, [Buffer2]
call .ClearSprite
.skip
ret
.ClearSprite: ; 50f34 (14:4f34)
push af
hlcoord 0, 1
ld bc, 2 * SCREEN_WIDTH
call AddNTimes
ld bc, 2 * SCREEN_WIDTH
ld a, " "
call ByteFill
pop af
ld hl, Sprites
ld bc, $10
call AddNTimes
ld de, $4
ld c, $4
.gfx_loop
ld [hl], $a0
add hl, de
dec c
jr nz, .gfx_loop
ld de, SFX_SWITCH_POKEMON
call WaitPlaySFX
ret
.SwapMonAndMail: ; 50f62 (14:4f62)
push hl
push de
push bc
ld bc, PartySpecies
ld a, [Buffer2]
ld l, a
ld h, $0
add hl, bc
ld d, h
ld e, l
ld a, [Buffer3]
ld l, a
ld h, $0
add hl, bc
ld a, [hl]
push af
ld a, [de]
ld [hl], a
pop af
ld [de], a
ld a, [Buffer2]
ld hl, PartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
push hl
ld de, wd002
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
ld a, [Buffer3]
ld hl, PartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop de
push hl
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
pop de
ld hl, wd002
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
ld a, [Buffer2]
ld hl, PartyMonOT
call SkipNames
push hl
call .CopyNameTowd002
ld a, [Buffer3]
ld hl, PartyMonOT
call SkipNames
pop de
push hl
call .CopyName
pop de
ld hl, wd002
call .CopyName
ld hl, PartyMonNicknames
ld a, [Buffer2]
call SkipNames
push hl
call .CopyNameTowd002
ld hl, PartyMonNicknames
ld a, [Buffer3]
call SkipNames
pop de
push hl
call .CopyName
pop de
ld hl, wd002
call .CopyName
ld hl, sPartyMail
ld a, [Buffer2]
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
push hl
ld de, wd002
ld bc, MAIL_STRUCT_LENGTH
ld a, BANK(sPartyMail)
call GetSRAMBank
call CopyBytes
ld hl, sPartyMail
ld a, [Buffer3]
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
pop de
push hl
ld bc, MAIL_STRUCT_LENGTH
call CopyBytes
pop de
ld hl, wd002
ld bc, MAIL_STRUCT_LENGTH
call CopyBytes
call CloseSRAM
pop bc
pop de
pop hl
ret
.CopyNameTowd002: ; 51036 (14:5036)
ld de, wd002
.CopyName: ; 51039 (14:5039)
ld bc, NAME_LENGTH
call CopyBytes
ret
INCLUDE "gfx/load_pics.asm"
INCLUDE "engine/move_mon_wo_mail.asm"
INCLUDE "data/pokemon/base_stats.asm"
INCLUDE "data/pokemon/pokemon_names.asm"
Unknown_53d84: ; unreferenced
db $1a, $15
db $33, $16
db $4b, $17
db $62, $18
db $79, $19
db $90, $1a
db $a8, $1b
db $c4, $1c
db $e0, $1d
db $f6, $1e
db $ff, $1f
db $ff, $20
UnknownEggPic:: ; 53d9c
; Another egg pic. This is shifted up a few pixels.
INCBIN "gfx/unknown/unknown_egg.2bpp.lz"
SECTION "Crystal Phone Text", ROMX
INCLUDE "text/phone/extra.asm"
SECTION "bank20", ROMX
INCLUDE "engine/player_movement.asm"
INCLUDE "engine/engine_flags.asm"
INCLUDE "engine/variables.asm"
INCLUDE "text/battle.asm"
INCLUDE "engine/debug.asm"
SECTION "bank21", ROMX
INCLUDE "engine/printer.asm"
INCLUDE "battle/anim_gfx.asm"
INCLUDE "event/halloffame.asm"
SECTION "bank22", ROMX
INCLUDE "event/kurt.asm"
INCLUDE "engine/player_gfx.asm"
INCLUDE "mobile/mobile_22.asm"
INCLUDE "event/unown.asm"
INCLUDE "event/buena.asm"
INCLUDE "event/dratini.asm"
INCLUDE "event/battle_tower.asm"
INCLUDE "mobile/mobile_22_2.asm"
SECTION "bank23", ROMX
INCLUDE "engine/timeofdaypals.asm"
INCLUDE "engine/battle_transition.asm"
INCLUDE "event/field_moves.asm"
INCLUDE "event/magnet_train.asm"
BattleStart_LoadEDTile: ; 8cf4f
call CGBOnly_LoadEDTile
ret
INCLUDE "engine/sprites.asm"
INCLUDE "engine/mon_icons.asm"
SECTION "bank24", ROMX
INCLUDE "engine/phone.asm"
INCLUDE "engine/timeset.asm"
INCLUDE "engine/pokegear.asm"
INCLUDE "engine/fish.asm"
INCLUDE "engine/slot_machine.asm"
SECTION "Phone Engine", ROMX
INCLUDE "engine/more_phone_scripts.asm"
INCLUDE "engine/buena_phone_scripts.asm"
SECTION "Phone Text", ROMX
INCLUDE "text/phone/anthony_overworld.asm"
INCLUDE "text/phone/todd_overworld.asm"
INCLUDE "text/phone/gina_overworld.asm"
INCLUDE "text/phone/irwin_overworld.asm"
INCLUDE "text/phone/arnie_overworld.asm"
INCLUDE "text/phone/alan_overworld.asm"
INCLUDE "text/phone/dana_overworld.asm"
INCLUDE "text/phone/chad_overworld.asm"
INCLUDE "text/phone/derek_overworld.asm"
INCLUDE "text/phone/tully_overworld.asm"
INCLUDE "text/phone/brent_overworld.asm"
INCLUDE "text/phone/tiffany_overworld.asm"
INCLUDE "text/phone/vance_overworld.asm"
INCLUDE "text/phone/wilton_overworld.asm"
INCLUDE "text/phone/kenji_overworld.asm"
INCLUDE "text/phone/parry_overworld.asm"
INCLUDE "text/phone/erin_overworld.asm"
SECTION "bank2E", ROMX
INCLUDE "engine/events_3.asm"
INCLUDE "engine/radio.asm"
INCLUDE "gfx/mail.asm"
SECTION "bank2F", ROMX
INCLUDE "engine/std_scripts.asm"
INCLUDE "engine/phone_scripts.asm"
INCLUDE "engine/trainer_scripts.asm"
INCLUDE "gfx/sprites.asm"
SECTION "bank32", ROMX
INCLUDE "battle/bg_effects.asm"
INCLUDE "battle/anims.asm"
LoadPoisonBGPals: ; cbcdd
call .LoadPals
ld a, [hCGB]
and a
ret nz
ret ; ????
.LoadPals: ; cbce5
ld a, [hCGB]
and a
jr nz, .cgb
ld a, [TimeOfDayPal]
and $3
cp $3
ld a, %00000000
jr z, .convert_pals
ld a, %10101010
.convert_pals
call DmgToCgbBGPals
ld c, 4
call DelayFrames
callba _UpdateTimePals
ret
.cgb
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, BGPals
ld c, $20
.loop
; RGB 28, 21, 31
ld a, (palred 28 + palgreen 21 + palblue 31) % $100
ld [hli], a
ld a, (palred 28 + palgreen 21 + palblue 31) / $100
ld [hli], a
dec c
jr nz, .loop
pop af
ld [rSVBK], a
ld a, $1
ld [hCGBPalUpdate], a
ld c, 4
call DelayFrames
callba _UpdateTimePals
ret
TheEndGFX:: ; cbd2e
INCBIN "gfx/credits/theend.2bpp"
SECTION "bank33", ROMX
INCLUDE "event/bug_contest_mon_stats.asm"
INCLUDE "battle/anim_commands.asm"
INCLUDE "battle/anim_objects.asm"
SECTION "Pic Animations 1", ROMX
INCLUDE "gfx/pics/animation.asm"
INCLUDE "gfx/pics/anim_pointers.asm"
INCLUDE "gfx/pics/anims.asm"
INCLUDE "gfx/pics/extra_pointers.asm"
INCLUDE "gfx/pics/extras.asm"
INCLUDE "gfx/pics/unown_anim_pointers.asm"
INCLUDE "gfx/pics/unown_anims.asm"
INCLUDE "gfx/pics/unown_extra_pointers.asm"
INCLUDE "gfx/pics/unown_extras.asm"
INCLUDE "gfx/pics/bitmask_pointers.asm"
INCLUDE "gfx/pics/bitmasks.asm"
INCLUDE "gfx/pics/unown_bitmask_pointers.asm"
INCLUDE "gfx/pics/unown_bitmasks.asm"
SECTION "Pic Animations 2", ROMX
INCLUDE "gfx/pics/frame_pointers.asm"
INCLUDE "gfx/pics/kanto_frames.asm"
SECTION "Font Inversed", ROMX
FontInversed:
INCBIN "gfx/font/font_inversed.1bpp"
SECTION "Pic Animations 3", ROMX
INCLUDE "gfx/pics/johto_frames.asm"
INCLUDE "gfx/pics/unown_frame_pointers.asm"
INCLUDE "gfx/pics/unown_frames.asm"
SECTION "bank38", ROMX
RotateUnownFrontpic: ; e0000
; something to do with Unown printer
push de
xor a
call GetSRAMBank
ld hl, sScratch
ld bc, 0
.loop
push bc
push hl
push bc
ld de, wd002
call .Copy
call .Rotate
ld hl, UnownPrinter_OverworldMapRectangle
pop bc
add hl, bc
add hl, bc
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wd012
call .Copy
pop hl
ld bc, $10
add hl, bc
pop bc
inc c
ld a, c
cp 7 * 7
jr c, .loop
ld hl, OverworldMap
ld de, sScratch
ld bc, 7 * 7 tiles
call CopyBytes
pop hl
ld de, sScratch
ld c, 7 * 7
ld a, [hROMBank]
ld b, a
call Get2bpp
call CloseSRAM
ret
.Copy: ; e004e
ld c, $10
.loop_copy
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .loop_copy
ret
.Rotate: ; e0057
ld hl, wd012
ld e, %10000000
ld d, 8
.loop_decompress
push hl
ld hl, wd002
call .CountSetBit
pop hl
ld a, b
ld [hli], a
push hl
ld hl, wd003
call .CountSetBit
pop hl
ld a, b
ld [hli], a
srl e
dec d
jr nz, .loop_decompress
ret
.CountSetBit: ; e0078
ld b, 0
ld c, 8
.loop_count
ld a, [hli]
and e
jr z, .clear
scf
jr .apply
.clear
and a
.apply
rr b
inc hl
dec c
jr nz, .loop_count
ret
overworldmaprect: MACRO
y = 0
rept \1
x = \1 * (\2 +- 1) + y
rept \2
dw OverworldMap tile x
x = x +- \2
endr
y = y + 1
endr
endm
UnownPrinter_OverworldMapRectangle: ; e008b
overworldmaprect 7, 7
Unknown_e00ed:
; Graphics for an unused Game Corner
; game were meant to be here.
ret_e00ed: ; e00ed (38:40ed)
; How many coins?
ret
INCLUDE "engine/card_flip.asm"
INCLUDE "engine/unown_puzzle.asm"
INCLUDE "engine/dummy_game.asm"
INCLUDE "engine/billspc.asm"
SECTION "bank39", ROMX
CopyrightGFX:: ; e4000
INCBIN "gfx/splash/copyright.2bpp"
INCLUDE "engine/options_menu.asm"
INCLUDE "engine/crystal_intro.asm"
SECTION "bank3E", ROMX
INCLUDE "gfx/font.asm"
INCLUDE "engine/time_capsule.asm"
INCLUDE "event/name_rater.asm"
INCLUDE "engine/play_slow_cry.asm"
INCLUDE "engine/new_pokedex_entry.asm"
INCLUDE "engine/time_capsule_2.asm"
INCLUDE "engine/unown_dex.asm"
INCLUDE "event/magikarp.asm"
INCLUDE "battle/hidden_power.asm"
INCLUDE "battle/misc.asm"
SECTION "bank3F", ROMX
INCLUDE "tilesets/animations.asm"
INCLUDE "engine/npctrade.asm"
INCLUDE "event/mom_phone.asm"
SECTION "mobile_40", ROMX
INCLUDE "mobile/mobile_40.asm"
SECTION "bank41", ROMX
INCLUDE "engine/dma_transfer.asm"
INCLUDE "gfx/emotes.asm"
INCLUDE "engine/warp_connection.asm"
INCLUDE "engine/mysterygift.asm"
INCLUDE "battle/used_move_text.asm"
INCLUDE "mobile/mobile_41.asm"
INCLUDE "gfx/overworld_font.asm"
SECTION "mobile_42", ROMX
INCLUDE "mobile/mobile_42.asm"
SECTION "Intro Logo", ROMX
IntroLogoGFX: ; 109407
INCBIN "gfx/intro/logo.2bpp.lz"
SECTION "bank43", ROMX
INCLUDE "engine/unused_title.asm"
INCLUDE "engine/title.asm"
INCLUDE "mobile/mobile_45.asm"
INCLUDE "mobile/mobile_46.asm"
SECTION "battle_tower_47", ROMX
INCLUDE "mobile/battle_tower_47.asm"
SECTION "bank5B", ROMX
INCLUDE "mobile/mobile_5b.asm"
INCLUDE "engine/link_trade.asm"
SECTION "mobile_5c", ROMX
INCLUDE "mobile/mobile_5c.asm"
SECTION "Crystal Phone Text 2", ROMX
INCLUDE "text/phone/extra2.asm"
SECTION "bank5E", ROMX
_UpdateBattleHUDs:
callba DrawPlayerHUD
ld hl, PlayerHPPal
call SetHPPal
callba DrawEnemyHUD
ld hl, EnemyHPPal
call SetHPPal
callba FinishBattleAnim
ret
INCLUDE "mobile/mobile_5e.asm"
INCLUDE "mobile/mobile_5f.asm"
SECTION "Common Text 1", ROMX
INCLUDE "text/stdtext.asm"
INCLUDE "text/phone/jack_overworld.asm"
INCLUDE "text/phone/beverly_overworld.asm"
INCLUDE "text/phone/huey_overworld.asm"
INCLUDE "text/phone/gaven_overworld.asm"
INCLUDE "text/phone/beth_overworld.asm"
INCLUDE "text/phone/jose_overworld.asm"
INCLUDE "text/phone/reena_overworld.asm"
INCLUDE "text/phone/joey_overworld.asm"
INCLUDE "text/phone/wade_overworld.asm"
INCLUDE "text/phone/ralph_overworld.asm"
INCLUDE "text/phone/liz_overworld.asm"
SECTION "Special Phone Text", ROMX
INCLUDE "text/phone/mom.asm"
INCLUDE "text/phone/bill.asm"
INCLUDE "text/phone/elm.asm"
INCLUDE "text/phone/trainers1.asm"
SECTION "bank72", ROMX
INCLUDE "data/items/item_names.asm"
INCLUDE "data/items/item_descriptions.asm"
INCLUDE "battle/move_names.asm"
INCLUDE "engine/landmarks.asm"
SECTION "bank77", ROMX
UnownFont: ; 1dc000
INCBIN "gfx/font/unown_font.2bpp"
INCLUDE "engine/print_party.asm"
SECTION "bank77_2", ROMX
Function1dd6a9: ; 1dd6a9
; XXX
ld a, b
ld b, c
ld c, a
push bc
push de
ld hl, sp+$2
ld d, h
ld e, l
pop hl
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
pop bc
ret
PrintHoursMins ; 1dd6bb (77:56bb)
; Hours in b, minutes in c
ld a, b
cp 12
push af
jr c, .AM
jr z, .PM
sub 12
jr .PM
.AM:
or a
jr nz, .PM
ld a, 12
.PM:
ld b, a
; Crazy stuff happening with the stack
push bc
ld hl, sp+$1
push de
push hl
pop de
pop hl
ld [hl], " "
lb bc, 1, 2
call PrintNum
ld [hl], ":"
inc hl
ld d, h
ld e, l
ld hl, sp+$0
push de
push hl
pop de
pop hl
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
pop bc
ld de, String_AM
pop af
jr c, .place_am_pm
ld de, String_PM
.place_am_pm
inc hl
call PlaceString
ret
String_AM: db "AM@" ; 1dd6fc
String_PM: db "PM@" ; 1dd6ff
INCLUDE "engine/diploma.asm"
INCLUDE "engine/pokedex_3.asm"
INCLUDE "event/catch_tutorial_input.asm"
TownMap_ConvertLineBreakCharacters: ; 1de2c5
ld hl, StringBuffer1
.loop
ld a, [hl]
cp "@"
jr z, .end
cp "%"
jr z, .line_break
cp "¯"
jr z, .line_break
inc hl
jr .loop
.line_break
ld [hl], "<LNBRK>"
.end
ld de, StringBuffer1
hlcoord 9, 0
call PlaceString
ret
PokegearGFX: ; 1de2e4
INCBIN "gfx/pokegear/pokegear.2bpp.lz"
INCLUDE "engine/european_mail.asm"
SECTION "Battle Tower Text", ROMX
INCLUDE "text/battle_tower.asm"
SECTION "Battle Tower Trainer Data", ROMX
INCLUDE "data/battle_tower_2.asm"
SECTION "Mobile News Data", ROMX
INCLUDE "mobile/news/news.asm"
SECTION "bank7E", ROMX
INCLUDE "engine/battle_tower.asm"
INCLUDE "engine/odd_eggs.asm"
SECTION "bank7F", ROMX
SECTION "Mobile Stadium 2", ROMX
IF DEF(CRYSTAL11)
INCBIN "mobile/stadium/stadium2_2.bin"
ELSE
INCBIN "mobile/stadium/stadium2_1.bin"
ENDC