Merge pull request #237 from yenatch/incbins

Map triggers and egg hatching.
This commit is contained in:
Bryan Bishop
2014-03-03 23:38:54 -06:00
10 changed files with 431 additions and 128 deletions

View File

@@ -1884,7 +1884,7 @@ Script_checkmaptriggers: ; 0x975d1
ld b, a ld b, a
call GetScriptByte call GetScriptByte
ld c, a ld c, a
call Function2147 call GetMapTrigger
ld a, d ld a, d
or e or e
jr z, .asm_975e5 ; 0x975de $5 jr z, .asm_975e5 ; 0x975de $5
@@ -1923,7 +1923,7 @@ Script_domaptrigger: ; 0x975f5
; fallthrough ; fallthrough
Unknown_975fd: ; 0x975fd Unknown_975fd: ; 0x975fd
call Function2147 call GetMapTrigger
ld a, d ld a, d
or e or e
jr z, .asm_97608 ; 0x97602 $4 jr z, .asm_97608 ; 0x97602 $4

View File

@@ -1765,13 +1765,14 @@ Function37e2:: ; 37e2
push hl push hl
push de push de
push bc push bc
call Function381e call Function381e
jr c, .asm_37ef jr c, .asm_37ef
ld e, c ld e, c
ld d, b ld d, b
call PlayCryHeader call PlayCryHeader
.asm_37ef .asm_37ef
pop bc pop bc
pop de pop de
pop hl pop hl
@@ -1783,16 +1784,17 @@ Function37f3:: ; 37f3
ret c ret c
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, $3c ld a, BANK(CryHeaders)
rst Bankswitch rst Bankswitch
ld hl, $6787 ld hl, CryHeaders
add hl, bc add hl, bc
add hl, bc add hl, bc
add hl, bc add hl, bc
add hl, bc add hl, bc
add hl, bc add hl, bc
add hl, bc add hl, bc
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
@@ -1804,10 +1806,10 @@ Function37f3:: ; 37f3
ld a, [hli] ld a, [hli]
ld [CryLength], a ld [CryLength], a
ld a, [hl] ld a, [hl]
ld [$c2b3], a ld [CryLength + 1], a
pop af pop af
rst Bankswitch rst Bankswitch
and a and a
ret ret
; 381e ; 381e
@@ -1815,11 +1817,12 @@ Function37f3:: ; 37f3
Function381e:: ; 381e Function381e:: ; 381e
and a and a
jr z, .asm_382b jr z, .asm_382b
cp $fc cp NUM_POKEMON + 1
jr nc, .asm_382b jr nc, .asm_382b
dec a dec a
ld c, a ld c, a
ld b, $0 ld b, 0
and a and a
ret ret
@@ -2042,7 +2045,7 @@ GetPartyParamLocation:: ; 3917
push bc push bc
ld hl, PartyMons ld hl, PartyMons
ld c, a ld c, a
ld b, $00 ld b, 0
add hl, bc add hl, bc
ld a, [CurPartyMon] ld a, [CurPartyMon]
call GetPartyLocation call GetPartyLocation
@@ -2061,12 +2064,12 @@ Function392d:: ; 392d
push hl push hl
ld a, b ld a, b
dec a dec a
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld hl, $5424 ld hl, BaseData + 0
ld bc, $0020 ld bc, $0020
call AddNTimes call AddNTimes
ld a, $14 ld a, BANK(BaseData)
call GetFarHalfword call GetFarHalfword
ld b, l ld b, l
ld c, h ld c, h

View File

@@ -24,7 +24,7 @@ Function211b:: ; 211b
ret ret
; 212a ; 212a
Function212a:: ; 212a GetCurrentMapTrigger:: ; 212a
ld a, [MapGroup] ld a, [MapGroup]
ld b, a ld b, a
ld a, [MapNumber] ld a, [MapNumber]
@@ -32,7 +32,7 @@ Function212a:: ; 212a
xor a xor a
ld [$dbf7], a ld [$dbf7], a
ld [$dbf8], a ld [$dbf8], a
call Function2147 call GetMapTrigger
ret c ret c
ld a, e ld a, e
ld [$dbf7], a ld [$dbf7], a
@@ -42,14 +42,14 @@ Function212a:: ; 212a
ret ret
; 2147 ; 2147
Function2147:: ; 2147 GetMapTrigger:: ; 2147
push bc push bc
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, $13 ld a, BANK(MapTriggers)
rst Bankswitch rst Bankswitch
ld hl, $501e ld hl, MapTriggers
.asm_2151 .asm_2151
push hl push hl
ld a, [hli] ld a, [hli]
@@ -106,9 +106,9 @@ Function217a:: ; 217a
ld bc, TileMapEnd - TileMap ld bc, TileMapEnd - TileMap
call ByteFill call ByteFill
ld a, $13 ld a, BANK(Function4d15b)
rst Bankswitch rst Bankswitch
call $515b call Function4d15b
pop af pop af
rst Bankswitch rst Bankswitch

View File

@@ -586,10 +586,10 @@ Function2048:: ; 2048
Function2057:: ; 2057 Function2057:: ; 2057
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, $21 ld a, BANK(Function842db)
rst Bankswitch rst Bankswitch
call $42db call Function842db
pop af pop af
rst Bankswitch rst Bankswitch

View File

@@ -209,7 +209,7 @@ CheckDict:: ; 1087
and a and a
jp z, Function1383 jp z, Function1383
cp $4c cp $4c
jp z, $1337 jp z, Function1337
cp $4b cp $4b
jp z, Char4B jp z, Char4B
cp $51 ; Player name cp $51 ; Player name
@@ -249,7 +249,7 @@ CheckDict:: ; 1087
cp $56 cp $56
jp z, Function11d3 jp z, Function11d3
cp $57 cp $57
jp z, $137c jp z, Function137c
cp $58 cp $58
jp z, Function135a jp z, Function135a
cp $4a cp $4a
@@ -269,9 +269,9 @@ CheckDict:: ; 1087
cp $5a cp $5a
jp z, Char5D jp z, Char5D
cp $3f cp $3f
jp z, $121b jp z, Function121b
cp $14 cp $14
jp z, $1252 jp z, Function1252
cp $e4 cp $e4
jr z, .asm_1174 ; 0x113d $35 jr z, .asm_1174 ; 0x113d $35
cp $e5 cp $e5
@@ -322,103 +322,103 @@ Function117b:: ; 117b
Function1186:: ; 1186 Function1186:: ; 1186
push de push de
ld de, MomsName ld de, MomsName
jp $126a jp Function126a
; 118d ; 118d
Function118d:: ; 118d Function118d:: ; 118d
push de push de
ld de, PlayerName ld de, PlayerName
jp $126a jp Function126a
; 1194 ; 1194
Function1194:: ; 1194 Function1194:: ; 1194
push de push de
ld de, RivalName ld de, RivalName
jp $126a jp Function126a
; 119b ; 119b
Function119b:: ; 119b Function119b:: ; 119b
push de push de
ld de, RedsName ld de, RedsName
jp $126a jp Function126a
; 11a2 ; 11a2
Function11a2:: ; 11a2 Function11a2:: ; 11a2
push de push de
ld de, GreensName ld de, GreensName
jp $126a jp Function126a
; 11a9 ; 11a9
Function11a9:: ; 11a9 Function11a9:: ; 11a9
push de push de
ld de, Char5DText ld de, Char5DText
jp $126a jp Function126a
; 11b0 ; 11b0
Function11b0:: ; 11b0 Function11b0:: ; 11b0
push de push de
ld de, Char5CText ld de, Char5CText
jp $126a jp Function126a
; 11b7 ; 11b7
Function11b7:: ; 11b7 Function11b7:: ; 11b7
push de push de
ld de, Char5BText ld de, Char5BText
jp $126a jp Function126a
; 11be ; 11be
Function11be:: ; 11be Function11be:: ; 11be
push de push de
ld de, Char5EText ld de, Char5EText
jp $126a jp Function126a
; 11c5 ; 11c5
Function11c5:: ; 11c5 Function11c5:: ; 11c5
push de push de
ld de, Char54Text ld de, Char54Text
jp $126a jp Function126a
; 11cc ; 11cc
Function11cc:: ; 11cc Function11cc:: ; 11cc
push de push de
ld de, Char23Text ld de, Char23Text
jp $126a jp Function126a
; 11d3 ; 11d3
Function11d3:: ; 11d3 Function11d3:: ; 11d3
push de push de
ld de, $1292 ld de, Char56Text
jp $126a jp Function126a
; 11da ; 11da
Function11da:: ; 11da Function11da:: ; 11da
push de push de
ld de, Char4AText ld de, Char4AText
jp $126a jp Function126a
; 11e1 ; 11e1
Function11e1:: ; 11e1 Function11e1:: ; 11e1
push de push de
ld de, Char24Text ld de, Char24Text
jp $126a jp Function126a
; 11e8 ; 11e8
Function11e8:: ; 11e8 Function11e8:: ; 11e8
push de push de
ld de, Char37Text ld de, Char37Text
jp $126a jp Function126a
; 11ef ; 11ef
Function11ef:: ; 11ef Function11ef:: ; 11ef
push de push de
ld de, Char37Text ld de, Char37Text
jp $126a jp Function126a
; 11f6 ; 11f6
Function11f6:: ; 11f6 Function11f6:: ; 11f6
push de push de
ld de, Char37Text ld de, Char37Text
jp $126a jp Function126a
; 11fd ; 11fd
@@ -437,22 +437,24 @@ Function1205:: ; 1205
and a and a
jr nz, .asm_120e ; 0x1207 $5 jr nz, .asm_120e ; 0x1207 $5
ld de, BattleMonNick ld de, BattleMonNick
jr .asm_126a ; 0x120c $5c jr Function126a ; 0x120c $5c
.asm_120e .asm_120e
ld de, Char5AText ; Enemy ld de, Char5AText ; Enemy
call PlaceString call PlaceString
ld h, b ld h, b
ld l, c ld l, c
ld de, EnemyMonNick ld de, EnemyMonNick
jr .asm_126a ; 0x1219 $4f jr Function126a ; 0x1219 $4f
Function121b:: ; 121b
push de push de
ld a, [InLinkBattle] ld a, [InLinkBattle]
and a and a
jr nz, .linkbattle jr nz, .linkbattle
ld a, [TrainerClass] ld a, [TrainerClass]
cp $9 cp RIVAL1
jr z, .asm_1248 ; 0x1227 $1f jr z, .asm_1248 ; 0x1227 $1f
cp $2a cp RIVAL2
jr z, .asm_1248 ; 0x122b $1b jr z, .asm_1248 ; 0x122b $1b
ld de, $c656 ld de, $c656
call PlaceString call PlaceString
@@ -464,13 +466,15 @@ Function1205:: ; 1205
callab Function39939 callab Function39939
pop hl pop hl
ld de, StringBuffer1 ld de, StringBuffer1
jr .asm_126a ; 0x1246 $22 jr Function126a ; 0x1246 $22
.asm_1248 .asm_1248
ld de, RivalName ld de, RivalName
jr .asm_126a ; 0x124b $1d jr Function126a ; 0x124b $1d
.linkbattle .linkbattle
ld de, $c656 ld de, $c656
jr .asm_126a ; 0x1250 $18 jr Function126a ; 0x1250 $18
Function1252:: ; 1252
push de push de
ld de, PlayerName ld de, PlayerName
call PlaceString call PlaceString
@@ -479,10 +483,11 @@ Function1205:: ; 1205
ld a, [PlayerGender] ld a, [PlayerGender]
bit 0, a bit 0, a
ld de, String12a5 ld de, String12a5
jr z, .asm_126a ; 0x1263 $5 jr z, Function126a ; 0x1263 $5
ld de, String12a6 ld de, String12a6
jr .asm_126a ; 0x1268 $0 jr Function126a ; 0x1268 $0
.asm_126a
Function126a:: ; 126a
call PlaceString call PlaceString
ld h, b ld h, b
ld l, c ld l, c
@@ -629,6 +634,7 @@ Char4B:: ; 131f
or a or a
call z, Function13cd call z, Function13cd
Function1337:: ; 1337
push de push de
call Function138c call Function138c
call Function138c call Function138c
@@ -675,12 +681,12 @@ Function135a:: ; 135a
call Functionaaf call Functionaaf
ld a, [InLinkBattle] ld a, [InLinkBattle]
cp $3 cp $3
jr z, .asm_137c jr z, Function137c
cp $4 cp $4
jr z, .asm_137c jr z, Function137c
call Function13cd call Function13cd
.asm_137c Function137c:: ; 137c
pop hl pop hl
ld de, .string_1382 ld de, .string_1382
dec de dec de
@@ -770,10 +776,10 @@ Function13d4:: ; 13d4
; 13e0 ; 13e0
Function13e0:: ; 13e0 Function13e0:: ; 13e0
ld hl, $13e4 ld hl, String_13e4
ret ret
.string_13e4 String_13e4: ; 13e4
db "@" db "@"
; 13e5 ; 13e5

View File

@@ -20,6 +20,11 @@ dbw: MACRO
dw \2 dw \2
ENDM ENDM
dbbw: MACRO
db \1, \2
dw \3
ENDM
dn: MACRO dn: MACRO
db \1 << 4 + \2 db \1 << 4 + \2
ENDM ENDM

340
main.asm

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
EggMovePointers: ; 0x23b11 EggMovePointers:: ; 0x23b11
dw BulbasaurEggMoves dw BulbasaurEggMoves
dw NoEggMoves dw NoEggMoves
dw NoEggMoves dw NoEggMoves

View File

@@ -13,6 +13,8 @@ SECTION "Egg Moves", ROMX, BANK[EGG_MOVES]
INCLUDE "stats/egg_move_pointers.asm" INCLUDE "stats/egg_move_pointers.asm"
EggMoves::
BulbasaurEggMoves: BulbasaurEggMoves:
db LIGHT_SCREEN db LIGHT_SCREEN
db SKULL_BASH db SKULL_BASH

View File

@@ -1782,6 +1782,89 @@ UndergroundSwitchPositions:: ; d963
FarfetchdPosition:: ; d964 FarfetchdPosition:: ; d964
ds 1 ; which position the ilex farfetch'd is in ds 1 ; which position the ilex farfetch'd is in
SECTION "Map Triggers", WRAMX[$d972], BANK[1]
wPokecenter2FTrigger:: ds 1 ; d972
wTradeCenterTrigger:: ds 1 ; d973
wColosseumTrigger:: ds 1 ; d974
wTimeCapsuleTrigger:: ds 1 ; d975
wPowerPlantTrigger:: ds 1 ; d976
wCeruleanGymTrigger:: ds 1 ; d977
wRoute25Trigger:: ds 1 ; d978
wTrainerHouseB1FTrigger:: ds 1 ; d979
wVictoryRoadGateTrigger:: ds 1 ; d97a
wSaffronTrainStationTrigger:: ds 1 ; d97b
wRoute16GateTrigger:: ds 1 ; d97c
wRoute1718GateTrigger:: ds 1 ; d97d
wIndigoPlateauPokecenter1FTrigger:: ds 1 ; d97e
wWillsRoomTrigger:: ds 1 ; d97f
wKogasRoomTrigger:: ds 1 ; d980
wBrunosRoomTrigger:: ds 1 ; d981
wKarensRoomTrigger:: ds 1 ; d982
wLancesRoomTrigger:: ds 1 ; d983
wHallOfFameTrigger:: ds 1 ; d984
wRoute27Trigger:: ds 1 ; d985
wNewBarkTownTrigger:: ds 1 ; d986
wElmsLabTrigger:: ds 1 ; d987
wKrissHouse1FTrigger:: ds 1 ; d988
wRoute29Trigger:: ds 1 ; d989
wCherrygroveCityTrigger:: ds 1 ; d98a
wMrPokemonsHouseTrigger:: ds 1 ; d98b
wRoute32Trigger:: ds 1 ; d98c
wRoute35NationalParkGateTrigger:: ds 1 ; d98d
wRoute36Trigger:: ds 1 ; d98e
wRoute36NationalParkGateTrigger:: ds 1 ; d98f
wAzaleaTownTrigger:: ds 1 ; d990
wGoldenrodGymTrigger:: ds 1 ; d991
wGoldenrodMagnetTrainStationTrigger:: ds 1 ; d992
wGoldenrodPokecenter1FTrigger:: ds 1 ; d993
wOlivineCityTrigger:: ds 1 ; d994
wRoute34Trigger:: ds 1 ; d995
wRoute34IlexForestGateTrigger:: ds 1 ; d996
wEcruteakHouseTrigger:: ds 1 ; d997
wWiseTriosRoomTrigger:: ds 1 ; d998
wEcruteakPokecenter1FTrigger:: ds 1 ; d999
wEcruteakGymTrigger:: ds 1 ; d99a
wMahoganyTownTrigger:: ds 1 ; d99b
wRoute42Trigger:: ds 1 ; d99c
wCianwoodCityTrigger:: ds 1 ; d99d
wBattleTower1FTrigger:: ds 1 ; d99e
wBattleTowerBattleRoomTrigger:: ds 1 ; d99f
wBattleTowerElevatorTrigger:: ds 1 ; d9a0
wBattleTowerHallwayTrigger:: ds 1 ; d9a1
wBattleTowerOutsideTrigger:: ds 1 ; d9a2
wRoute43GateTrigger:: ds 1 ; d9a3
wMountMoonTrigger:: ds 1 ; d9a4
wSproutTower3FTrigger:: ds 1 ; d9a5
wTinTower1FTrigger:: ds 1 ; d9a6
wBurnedTower1FTrigger:: ds 1 ; d9a7
wBurnedTowerB1FTrigger:: ds 1 ; d9a8
wRadioTower5FTrigger:: ds 1 ; d9a9
wRuinsOfAlphOutsideTrigger:: ds 1 ; d9aa
wRuinsOfAlphResearchCenterTrigger:: ds 1 ; d9ab
wRuinsOfAlphHoOhChamberTrigger:: ds 1 ; d9ac
wRuinsOfAlphKabutoChamberTrigger:: ds 1 ; d9ad
wRuinsOfAlphOmanyteChamberTrigger:: ds 1 ; d9ae
wRuinsOfAlphAerodactylChamberTrigger:: ds 1 ; d9af
wRuinsOfAlphInnerChamberTrigger:: ds 1 ; d9b0
wMahoganyMart1FTrigger:: ds 1 ; d9b1
wTeamRocketBaseB1FTrigger:: ds 1 ; d9b2
wTeamRocketBaseB2FTrigger:: ds 1 ; d9b3
wTeamRocketBaseB3FTrigger:: ds 1 ; d9b4
wUndergroundPathSwitchRoomEntrancesTrigger:: ds 1 ; d9b5
wSilverCaveRoom3Trigger:: ds 1 ; d9b6
wVictoryRoadTrigger:: ds 1 ; d9b7
wDragonsDenB1FTrigger:: ds 1 ; d9b8
wDragonShrineTrigger:: ds 1 ; d9b9
wOlivinePortTrigger:: ds 1 ; d9ba
wVermilionPortTrigger:: ds 1 ; d9bb
wFastShip1FTrigger:: ds 1 ; d9bc
wFastShipB1FTrigger:: ds 1 ; d9bd
wMountMoonSquareTrigger:: ds 1 ; d9be
wMobileTradeRoomMobileTrigger:: ds 1 ; d9bf
wMobileBattleRoomTrigger:: ds 1 ; d9c0
SECTION "Events",WRAMX[$da72],BANK[1] SECTION "Events",WRAMX[$da72],BANK[1]
EventFlags:: ; da72 EventFlags:: ; da72