Copy pokered's organization some more, with further constant and data files

This commit is contained in:
Remy Oukaour
2017-12-15 17:22:52 -05:00
parent dc76bf804f
commit 59fe407812
28 changed files with 893 additions and 858 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -103,7 +103,7 @@ GetFruitTreeItem: ; 4408a
; 44097
INCLUDE "data/fruit_tree_items.asm"
INCLUDE "data/items/fruit_trees.asm"
FruitBearingTreeText: ; 440b5

View File

@@ -99,23 +99,7 @@ RooftopSale: ; 15ac4
ret
; 15aee
RooftopSaleData1: ; 15aee
db 5
dbw POKE_BALL, 150
dbw GREAT_BALL, 500
dbw SUPER_POTION, 500
dbw FULL_HEAL, 500
dbw REVIVE, 1200
db -1
RooftopSaleData2: ; 15aff
db 5
dbw HYPER_POTION, 1000
dbw FULL_RESTORE, 2000
dbw FULL_HEAL, 500
dbw ULTRA_BALL, 1000
dbw PROTEIN, 7800
db -1
; 15b10
INCLUDE "data/items/rooftop_sale.asm"
LoadMartPointer: ; 15b10
ld a, b
@@ -355,15 +339,7 @@ ReadMart: ; 15c25
ret
; 15c51
BargainShopData: ; 15c51
db 5
dbw NUGGET, 4500
dbw PEARL, 650
dbw BIG_PEARL, 3500
dbw STARDUST, 900
dbw STAR_PIECE, 4600
db -1
; 15c62
INCLUDE "data/items/bargain_shop.asm"
BuyMenu: ; 15c62

View File

@@ -0,0 +1,52 @@
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 _NewPokedexEntry
call WaitPressAorB_BlinkCursor
ld a, $1
ld [wPokedexStatus], a
callba DisplayDexEntry
call WaitPressAorB_BlinkCursor
pop af
ld [wPokedexStatus], a
call MaxVolume
call RotateThreePalettesRight
ld a, [hSCX]
add -5 ; 251 ; NUM_POKEMON
ld [hSCX], a
call .ReturnFromDexRegistration
pop af
ld [hMapAnims], a
ret
; fb8c8
.ReturnFromDexRegistration: ; fb8c8
call ClearTileMap
call LoadFontsExtra
call LoadStandardFont
callba Pokedex_PlaceFrontpicTopLeftCorner
call WaitBGMap2
callba GetEnemyMonDVs
ld a, [hli]
ld [TempMonDVs], a
ld a, [hl]
ld [TempMonDVs + 1], a
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call SetPalettes
ret
; fb8f1

31
engine/play_slow_cry.asm Normal file
View File

@@ -0,0 +1,31 @@
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

View File

@@ -2338,44 +2338,7 @@ HasVisitedSpawn: ; 91c50
; 91c5e
Flypoints: ; 91c5e
; landmark, spawn point
flypoint: MACRO
const FLY_\1
db \2, SPAWN_\1
ENDM
const_def
; Johto
flypoint NEW_BARK, NEW_BARK_TOWN
flypoint CHERRYGROVE, CHERRYGROVE_CITY
flypoint VIOLET, VIOLET_CITY
flypoint AZALEA, AZALEA_TOWN
flypoint GOLDENROD, GOLDENROD_CITY
flypoint ECRUTEAK, ECRUTEAK_CITY
flypoint OLIVINE, OLIVINE_CITY
flypoint CIANWOOD, CIANWOOD_CITY
flypoint MAHOGANY, MAHOGANY_TOWN
flypoint LAKE, LAKE_OF_RAGE
flypoint BLACKTHORN, BLACKTHORN_CITY
flypoint MT_SILVER, SILVER_CAVE
; Kanto
KANTO_FLYPOINT EQU const_value
flypoint PALLET, PALLET_TOWN
flypoint VIRIDIAN, VIRIDIAN_CITY
flypoint PEWTER, PEWTER_CITY
flypoint CERULEAN, CERULEAN_CITY
flypoint VERMILION, VERMILION_CITY
flypoint ROCK_TUNNEL, ROCK_TUNNEL
flypoint LAVENDER, LAVENDER_TOWN
flypoint CELADON, CELADON_CITY
flypoint SAFFRON, SAFFRON_CITY
flypoint FUCHSIA, FUCHSIA_CITY
flypoint CINNABAR, CINNABAR_ISLAND
flypoint INDIGO, INDIGO_PLATEAU
db -1
; 91c8f
INCLUDE "data/flypoints.asm"
ret_91c8f: ; 91c8f
ret
@@ -2872,19 +2835,7 @@ TownMapPals: ; 91f13
ret
.PalMap:
townmappals: MACRO
rept _NARG / 2
dn \2, \1
shift
shift
endr
endm
townmappals 1, 1, 1, 2, 2, 2, 0, 0, 1, 1, 3, 1, 4, 5, 4, 5
townmappals 1, 1, 1, 2, 2, 2, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0
townmappals 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
townmappals 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0
townmappals 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0
townmappals 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0
INCLUDE "data/palettes/town_map.asm"
; 91f7b
TownMapMon: ; 91f7b

View File

@@ -144,134 +144,4 @@ PlaceTradePartnerNamesAndParty: ; fb60d
jr .loop
; fb656
INCLUDE "data/time_capsule/special_stats.asm"
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 _NewPokedexEntry
call WaitPressAorB_BlinkCursor
ld a, $1
ld [wPokedexStatus], a
callba DisplayDexEntry
call WaitPressAorB_BlinkCursor
pop af
ld [wPokedexStatus], a
call MaxVolume
call RotateThreePalettesRight
ld a, [hSCX]
add -5 ; 251 ; NUM_POKEMON
ld [hSCX], a
call .ReturnFromDexRegistration
pop af
ld [hMapAnims], a
ret
; fb8c8
.ReturnFromDexRegistration: ; fb8c8
call ClearTileMap
call LoadFontsExtra
call LoadStandardFont
callba Pokedex_PlaceFrontpicTopLeftCorner
call WaitBGMap2
callba GetEnemyMonDVs
ld a, [hli]
ld [TempMonDVs], a
ld a, [hl]
ld [TempMonDVs + 1], a
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
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
INCLUDE "data/time_capsule/mon_order.asm"

39
engine/time_capsule_2.asm Normal file
View File

@@ -0,0 +1,39 @@
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
INCLUDE "data/time_capsule/mon_order.asm"