You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Move some more main.asm routines into individual files
This commit is contained in:
47
engine/check_battle_scene.asm
Normal file
47
engine/check_battle_scene.asm
Normal file
@@ -0,0 +1,47 @@
|
||||
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
|
||||
@@ -1,29 +0,0 @@
|
||||
CheckFacingTileForStd:: ; 1365b
|
||||
; Checks to see if the tile you're facing has a std script associated with it. If so, executes the script and returns carry.
|
||||
ld a, c
|
||||
ld de, 3
|
||||
ld hl, TileCollisionStdScripts
|
||||
call IsInArray
|
||||
jr nc, .notintable
|
||||
|
||||
ld a, jumpstd_command
|
||||
ld [wJumpStdScriptBuffer], a
|
||||
inc hl
|
||||
ld a, [hli]
|
||||
ld [wJumpStdScriptBuffer + 1], a
|
||||
ld a, [hli]
|
||||
ld [wJumpStdScriptBuffer + 2], a
|
||||
ld a, BANK(Script_JumpStdFromRAM)
|
||||
ld hl, Script_JumpStdFromRAM
|
||||
call CallScript
|
||||
scf
|
||||
ret
|
||||
|
||||
.notintable
|
||||
xor a
|
||||
ret
|
||||
|
||||
INCLUDE "data/collision_stdscripts.asm"
|
||||
|
||||
Script_JumpStdFromRAM: ; 0x1369a
|
||||
jump wJumpStdScriptBuffer
|
||||
27
engine/get_breedmon_growth.asm
Normal file
27
engine/get_breedmon_growth.asm
Normal file
@@ -0,0 +1,27 @@
|
||||
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
|
||||
25
engine/knows_move.asm
Normal file
25
engine/knows_move.asm
Normal file
@@ -0,0 +1,25 @@
|
||||
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 "@"
|
||||
@@ -1315,10 +1315,10 @@ DrawPackGFX: ; 1089d
|
||||
; 108cc
|
||||
|
||||
PackGFXPointers: ; 108cc
|
||||
dw PackGFX + $f0 * 1
|
||||
dw PackGFX + $f0 * 3
|
||||
dw PackGFX + $f0 * 0
|
||||
dw PackGFX + $f0 * 2
|
||||
dw PackGFX + (15 tiles) * 1
|
||||
dw PackGFX + (15 tiles) * 3
|
||||
dw PackGFX + (15 tiles) * 0
|
||||
dw PackGFX + (15 tiles) * 2
|
||||
; 108d4
|
||||
|
||||
Pack_InterpretJoypad: ; 108d4 (4:48d4)
|
||||
|
||||
5
engine/player_gfx_2.asm
Normal file
5
engine/player_gfx_2.asm
Normal file
@@ -0,0 +1,5 @@
|
||||
ChrisBackpic: ; 2ba1a
|
||||
INCBIN "gfx/player/chris_back.2bpp.lz"
|
||||
|
||||
DudeBackpic: ; 2bbaa
|
||||
INCBIN "gfx/battle/dude.2bpp.lz"
|
||||
38
engine/trademon_frontpic.asm
Normal file
38
engine/trademon_frontpic.asm
Normal file
@@ -0,0 +1,38 @@
|
||||
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
|
||||
Reference in New Issue
Block a user