Merge remote-tracking branch 'upstream/master'

This commit is contained in:
JimB16
2015-10-07 20:38:24 +02:00
23 changed files with 1333 additions and 1277 deletions

View File

@@ -8816,7 +8816,7 @@ Function3f77c: ; 3f77c
callba Function106187 callba Function106187
ld c, $c8 ld c, $c8
call DelayFrames call DelayFrames
ld a, $1 ld a, BANK(sLinkBattleStats)
call GetSRAMBank call GetSRAMBank
call Function3fa42 call Function3fa42
call Function3f85f call Function3f85f
@@ -8891,7 +8891,7 @@ Function3f85f: ; 3f85f
call .asm_3f8e0 call .asm_3f8e0
hlcoord 0, 8 hlcoord 0, 8
ld b, $5 ld b, $5
ld de, $b268 ld de, sLinkBattleStats + $8
.asm_3f870 .asm_3f870
push bc push bc
push hl push hl

View File

@@ -830,3 +830,10 @@ NUM_SPAWNS EQU const_value
const SPRITEMOVEFN_1F const SPRITEMOVEFN_1F
const SPRITEMOVEFN_20 const SPRITEMOVEFN_20
const SPRITEMOVEFN_21 const SPRITEMOVEFN_21
const_def
const PALETTE_AUTO
const PALETTE_DAY
const PALETTE_NITE
const PALETTE_MORN
const PALETTE_DARK

View File

@@ -382,7 +382,7 @@ CheckTileEvent: ; 96874
call CheckBit4_ScriptFlags3 call CheckBit4_ScriptFlags3
jr z, .ok jr z, .ok
call Function97cc0 call RockSmashEncounter
ret c ret c
jr .ok jr .ok
@@ -582,7 +582,7 @@ CheckAPressOW: ; 96999
ret c ret c
call TryReadSign call TryReadSign
ret c ret c
call Function97c5f call CheckFacingTileEvent
ret c ret c
xor a xor a
ret ret

View File

@@ -44,7 +44,7 @@ Function97c4f:: ; 97c4f
ret ret
; 97c5f ; 97c5f
Function97c5f:: ; 97c5f CheckFacingTileEvent:: ; 97c5f
call GetFacingTileCoord call GetFacingTileCoord
ld [EngineBuffer1], a ld [EngineBuffer1], a
ld c, a ld c, a
@@ -95,41 +95,41 @@ Function97c5f:: ; 97c5f
; 97cc0 ; 97cc0
Function97cc0:: ; 97cc0 RockSmashEncounter:: ; 97cc0
; Rock Smash encounter ; Rock Smash encounter
call Function968c7 call Function968c7
jr c, .asm_97ce2 jr c, .nope
call Function97cfd call CanUseSweetScent
jr nc, .asm_97ce2 jr nc, .nope
ld hl, StatusFlags2 ld hl, StatusFlags2
bit 2, [hl] bit 2, [hl]
jr nz, .asm_97cdb jr nz, .bug_contest
callba TryWildEncounter callba TryWildEncounter
jr nz, .asm_97ce2 jr nz, .nope
jr .asm_97ce6 jr .ok
.asm_97cdb .bug_contest
call Function97d23 call _TryWildEncounter_BugContest
jr nc, .asm_97ce2 jr nc, .nope
jr .asm_97ced jr .ok_bug_contest
.asm_97ce2 .nope
ld a, 1 ld a, 1
and a and a
ret ret
.asm_97ce6 .ok
ld a, BANK(RockSmashBattleScript) ld a, BANK(RockSmashBattleScript)
ld hl, RockSmashBattleScript ld hl, RockSmashBattleScript
jr .asm_97cf4 jr .done
.asm_97ced .ok_bug_contest
ld a, BANK(BugCatchingContestBattleScript) ld a, BANK(BugCatchingContestBattleScript)
ld hl, BugCatchingContestBattleScript ld hl, BugCatchingContestBattleScript
jr .asm_97cf4 jr .done
.asm_97cf4 .done
call CallScript call CallScript
scf scf
ret ret
@@ -142,45 +142,45 @@ RockSmashBattleScript: ; 97cf9
end end
; 97cfd ; 97cfd
Function97cfd:: ; 97cfd CanUseSweetScent:: ; 97cfd
ld hl, StatusFlags ld hl, StatusFlags
bit 5, [hl] bit 5, [hl]
jr nz, .asm_97d21 jr nz, .no
ld a, [wPermission] ld a, [wPermission]
cp $4 cp $4
jr z, .asm_97d17 jr z, .ice_check
cp $7 cp $7
jr z, .asm_97d17 jr z, .ice_check
callba Function149dd callba Function149dd
jr nc, .asm_97d21 jr nc, .no
.asm_97d17 .ice_check
ld a, [StandingTile] ld a, [StandingTile]
call CheckIceTile call CheckIceTile
jr z, .asm_97d21 jr z, .no
scf scf
ret ret
.asm_97d21 .no
and a and a
ret ret
; 97d23 ; 97d23
Function97d23: ; 97d23 _TryWildEncounter_BugContest: ; 97d23
call TryWildEncounter_BugContest call TryWildEncounter_BugContest
ret nc ret nc
call Function97d31 call ChooseWildEncounter_BugContest
callba CheckRepelEffect callba CheckRepelEffect
ret ret
; 97d31 ; 97d31
Function97d31:: ; 97d31 ChooseWildEncounter_BugContest:: ; 97d31
; Pick a random mon out of ContestMons. ; Pick a random mon out of ContestMons.
.asm_97d31 .loop
call Random call Random
cp 100 << 1 cp 100 << 1
jr nc, .asm_97d31 jr nc, .loop
srl a srl a
ld hl, ContestMons ld hl, ContestMons
@@ -232,10 +232,10 @@ TryWildEncounter_BugContest: ; 97d64
ld a, [StandingTile] ld a, [StandingTile]
call CheckSuperTallGrassTile call CheckSuperTallGrassTile
ld b, $66 ld b, $66
jr z, .asm_97d70 jr z, .ok
ld b, $33 ld b, $33
.asm_97d70 .ok
callba ApplyMusicEffectOnEncounterRate callba ApplyMusicEffectOnEncounterRate
callba ApplyCleanseTagEffectOnEncounterRate callba ApplyCleanseTagEffectOnEncounterRate
call Random call Random

View File

@@ -83,11 +83,11 @@ SpecialsPointers:: ; c029
add_special PlayMapMusic add_special PlayMapMusic
add_special RestartMapMusic add_special RestartMapMusic
add_special HealMachineAnim add_special HealMachineAnim
add_special Function8379 add_special Special_SurfStartStep
add_special Functionc25a add_special Special_FindGreaterThanThatLevel
add_special Functionc268 add_special Special_FindAtLeastThatHappy
add_special Functionc276 add_special Special_FindThatSpecies
add_special Functionc284 add_special Special_FindThatSpeciesYourTrainerID
add_special Functionc3ef add_special Functionc3ef
add_special Function17421 add_special Function17421
add_special Function17440 add_special Function17440
@@ -163,7 +163,7 @@ SpecialsPointers:: ; c029
add_special Function103612 add_special Function103612
add_special SpecialHoOhChamber add_special SpecialHoOhChamber
add_special Function102142 add_special Function102142
add_special Function4989a add_special Special_CelebiShrineEvent
add_special Function49bf9 add_special Function49bf9
add_special SpecialPokeSeer add_special SpecialPokeSeer
add_special SpecialBuenasPassword add_special SpecialBuenasPassword
@@ -186,8 +186,8 @@ SpecialsPointers:: ; c029
add_special Function4ae12 add_special Function4ae12
add_special LoadMapPalettes add_special LoadMapPalettes
add_special Function4a927 add_special Function4a927
add_special Function90a54 add_special Special_InitialSetDSTFlag
add_special Function90a88 add_special Special_InitialClearDSTFlag
add_special SpecialNone add_special SpecialNone
; c224 ; c224
@@ -225,40 +225,40 @@ SpecialSeenMon: ; c252
ret ret
; c25a ; c25a
Functionc25a: ; c25a Special_FindGreaterThanThatLevel: ; c25a
ld a, [ScriptVar] ld a, [ScriptVar]
ld b, a ld b, a
callba Function4dbd2 callba _FindGreaterThanThatLevel
jr z, Functionc298 jr z, FoundNone
jr Functionc292 jr FoundOne
Functionc268: ; c268 Special_FindAtLeastThatHappy: ; c268
ld a, [ScriptVar] ld a, [ScriptVar]
ld b, a ld b, a
callba Function4dbd9 callba _FindAtLeastThatHappy
jr z, Functionc298 jr z, FoundNone
jr Functionc292 jr FoundOne
Functionc276: ; c276 Special_FindThatSpecies: ; c276
ld a, [ScriptVar] ld a, [ScriptVar]
ld b, a ld b, a
callba Function4dbe0 callba _FindThatSpecies
jr z, Functionc298 jr z, FoundNone
jr Functionc292 jr FoundOne
Functionc284: ; c284 Special_FindThatSpeciesYourTrainerID: ; c284
ld a, [ScriptVar] ld a, [ScriptVar]
ld b, a ld b, a
callba Function4dbe6 callba _FindThatSpeciesYourTrainerID
jr z, Functionc298 jr z, FoundNone
jr Functionc292 jr FoundOne
Functionc292: ; c292 FoundOne: ; c292
ld a, $1 ld a, $1
ld [ScriptVar], a ld [ScriptVar], a
ret ret
Functionc298: ; c298 FoundNone: ; c298
xor a xor a
ld [ScriptVar], a ld [ScriptVar], a
ret ret
@@ -314,9 +314,9 @@ Special_KrissHousePC: ; c2e7
; c2f6 ; c2f6
Special_CheckMysteryGift: ; c2f6 Special_CheckMysteryGift: ; c2f6
ld a, BANK(s0_abe2) ld a, BANK(sMysteryGiftItem)
call GetSRAMBank call GetSRAMBank
ld a, [s0_abe2] ld a, [sMysteryGiftItem]
and a and a
jr z, .no jr z, .no
inc a inc a
@@ -328,9 +328,9 @@ Special_CheckMysteryGift: ; c2f6
; c309 ; c309
Special_GetMysteryGiftItem: ; c309 Special_GetMysteryGiftItem: ; c309
ld a, BANK(s0_abe2) ld a, BANK(sMysteryGiftItem)
call GetSRAMBank call GetSRAMBank
ld a, [s0_abe2] ld a, [sMysteryGiftItem]
ld [CurItem], a ld [CurItem], a
ld a, $1 ld a, $1
ld [wd10c], a ld [wd10c], a
@@ -338,12 +338,12 @@ Special_GetMysteryGiftItem: ; c309
call ReceiveItem call ReceiveItem
jr nc, .asm_c33d jr nc, .asm_c33d
xor a xor a
ld [s0_abe2], a ld [sMysteryGiftItem], a
call CloseSRAM call CloseSRAM
ld a, [CurItem] ld a, [CurItem]
ld [wd265], a ld [wd265], a
call GetItemName call GetItemName
ld hl, UnknownText_0xc345 ld hl, .ReceiveItemText
call PrintText call PrintText
ld a, $1 ld a, $1
ld [ScriptVar], a ld [ScriptVar], a
@@ -356,7 +356,7 @@ Special_GetMysteryGiftItem: ; c309
ret ret
; c345 ; c345
UnknownText_0xc345: ; 0xc345 .ReceiveItemText: ; 0xc345
; received item ; received item
text_jump UnknownText_0x1bd3be text_jump UnknownText_0x1bd3be
db "@" db "@"
@@ -639,8 +639,8 @@ Functionc4ac: ; c4ac
; c4b9 ; c4b9
SpecialTrainerHouse: ; 0xc4b9 SpecialTrainerHouse: ; 0xc4b9
ld a, BANK(s0_abfd) ld a, BANK(sMysteryGiftTrainerHouseFlag)
call GetSRAMBank call GetSRAMBank
ld a, [s0_abfd] ld a, [sMysteryGiftTrainerHouseFlag]
ld [ScriptVar], a ld [ScriptVar], a
jp CloseSRAM jp CloseSRAM

464
engine/time.asm Executable file
View File

@@ -0,0 +1,464 @@
Function113d6: ; 113d6
call Function114dd
ret
; 113da
Function113da: ; 113da
xor a
ld [wdc2d], a
ld [wdc3a], a
ld [wdc1c], a
ret
; 113e5
Function113e5:: ; 113e5
xor a
ld [wd464], a
Function113e9: ; 113e9
ld a, [wd464]
cp 3
jr c, .asm_113f2
ld a, 3
.asm_113f2
ld e, a
ld d, 0
ld hl, .data_113fd
add hl, de
ld a, [hl]
jp Function1142e
; 113fd
.data_113fd
db 20, 10, 5, 3
; 11401
Function11401: ; 11401
call Function1143c
ret nc
ld hl, wd464
ld a, [hl]
cp 3
jr nc, .asm_1140e
inc [hl]
.asm_1140e
call Function113e9
scf
ret
; 11413
Function11413: ; 11413
ld a, 1
Function11415: ; 11415
ld [hl], a
push hl
call UpdateTime
pop hl
inc hl
call Function11621
ret
; 11420
Function11420: ; 11420
inc hl
push hl
call Function115cf
call Function115c8
pop hl
dec hl
call Function11586
ret
; 1142e
Function1142e: ; 1142e
ld hl, wd465
ld [hl], a
call UpdateTime
ld hl, wd466
call Function1162e
ret
; 1143c
Function1143c: ; 1143c
ld hl, wd466
call Function115d6
call Function115ae
ld hl, wd465
call Function11586
ret
; 1144c
Function1144c: ; 1144c
ld hl, wdc1c
jp Function11413
; 11452
Function11452:: ; 11452
ld hl, wdc1c
call Function11420
ret nc
xor a
ld hl, DailyFlags
rept 3
ld [hli], a
endr
ld [hl], a
ld hl, wDailyRematchFlags
rept 4
ld [hli], a
endr
ld hl, wDailyPhoneItemFlags
rept 4
ld [hli], a
endr
ld hl, wDailyPhoneTimeOfDayFlags
rept 4
ld [hli], a
endr
ld hl, wdc58
ld a, [hl]
and a
jr z, .asm_11480
dec [hl]
jr nz, .asm_11483
.asm_11480
call Function11485
.asm_11483
jr Function1144c
; 11485
Function11485: ; 11485
call Random
and 3
add 3
ld [wdc58], a
ret
; 11490
Function11490: ; 11490
ld a, $14
ld [wd46c], a
ld a, $0
ld [wd46d], a
call UpdateTime
ld hl, wdc35
call Function11613
ret
; 114a4
Function114a4:: ; 114a4 (4:54a4)
ld hl, wdc35
call Function115db
ld a, [wcfd7]
and a
jr nz, .asm_114d4
ld a, [wcfd6]
and a
jr nz, .asm_114d4
ld a, [wcfd4]
ld b, a
ld a, [wd46d]
sub b
jr nc, .asm_114c2
add $3c
.asm_114c2
ld [wd46d], a
ld a, [wcfd5]
ld b, a
ld a, [wd46c]
sbc b
ld [wd46c], a
jr c, .asm_114d4
and a
ret
.asm_114d4
xor a
ld [wd46c], a
ld [wd46d], a
scf
ret
Function114dd: ; 114dd
call UpdateTime
ld hl, wdc23
call Function11621
ret
; 114e7
Function114e7:: ; 114e7
ld hl, wdc23
call Function115cf
call Function115c8
and a
jr z, .asm_114fa
ld b, a
callba ApplyPokerusTick
.asm_114fa
xor a
ret
; 114fc
Function114fc: ; 114fc
ld a, $2
ld hl, wdc3a
ld [hl], a
call UpdateTime
ld hl, wdc3b
call Function11621
ret
; 1150c
Function1150c: ; 1150c
ld hl, wdc3b
call Function115cf
call Function115c8
ld hl, wdc3a
call Function11586
ret
; 1151c
Function1151c: ; 1151c
ld hl, DailyFlags
set 2, [hl]
ret
; 11522
Function11522: ; 11522
and a
ld hl, DailyFlags
bit 2, [hl]
ret nz
scf
ret
; 1152b
Function1152b: ; 1152b
call Function11534
ld hl, wdc2d
jp Function11415
; 11534
Function11534: ; 11534
call GetWeekday
ld c, a
ld a, $5
sub c
jr z, .asm_1153f
jr nc, .asm_11541
.asm_1153f
add $7
.asm_11541
ret
; 11542
Function11542: ; 11542
ld hl, wdc2d
jp Function11420
; 11548
Function11548: ; 11548
ld a, BANK(s0_abfa)
call GetSRAMBank
ld hl, s0_abfa
ld a, [hli]
ld [Buffer1], a
ld a, [hl]
ld [Buffer2], a
call CloseSRAM
ld hl, Buffer1
call Function11420
jr nc, .asm_11572
ld hl, Buffer1
call Function11413
call CloseSRAM
callba Function1050c8
.asm_11572
ld a, BANK(s0_abfa)
call GetSRAMBank
ld hl, Buffer1
ld a, [hli]
ld [s0_abfa], a
ld a, [hl]
ld [s0_abfa + 1], a
call CloseSRAM
ret
; 11586
Function11586: ; 11586
cp -1
jr z, .skip
ld c, a
ld a, [hl]
sub c
jr nc, .ok
xor a
.ok
ld [hl], a
jr z, .skip
xor a
ret
.skip
xor a
ld [hl], a
scf
ret
; 11599
Function11599: ; 11599
ld a, [wcfd7]
and a
jr nz, Function115cc
ld a, [wcfd6]
and a
jr nz, Function115cc
ld a, [wcfd5]
jr nz, Function115cc
ld a, [wcfd4]
ret
; 115ae
Function115ae: ; 115ae
ld a, [wcfd7]
and a
jr nz, Function115cc
ld a, [wcfd6]
and a
jr nz, Function115cc
ld a, [wcfd5]
ret
; 115be
Function115be: ; 115be
ld a, [wcfd7]
and a
jr nz, Function115cc
ld a, [wcfd6]
ret
; 115c8
Function115c8: ; 115c8
ld a, [wcfd7]
ret
; 115cc
Function115cc: ; 115cc
ld a, $ff
ret
; 115cf
Function115cf: ; 115cf
xor a
jr Function11605
; 115d2
Function115d2: ; 115d2
inc hl
xor a
jr Function115f8
; 115d6
Function115d6: ; 115d6
rept 2
inc hl
endr
xor a
jr Function115eb
; 115db
Function115db: ; 115db
rept 3
inc hl
endr
ld a, [hSeconds]
ld c, a
sub [hl]
jr nc, .asm_115e6
add 60
.asm_115e6
ld [hl], c
dec hl
ld [wcfd4], a
Function115eb: ; 115eb
ld a, [hMinutes]
ld c, a
sbc [hl]
jr nc, .asm_115f3
add 60
.asm_115f3
ld [hl], c
dec hl
ld [wcfd5], a
Function115f8: ; 115f8
ld a, [hHours]
ld c, a
sbc [hl]
jr nc, .asm_11600
add 24
.asm_11600
ld [hl], c
dec hl
ld [wcfd6], a
Function11605
ld a, [CurDay]
ld c, a
sbc [hl]
jr nc, .skip
add 20 * 7
.skip
ld [hl], c
ld [wcfd7], a
ret
; 11613
Function11613: ; 11613
ld a, [CurDay]
ld [hli], a
ld a, [hHours]
ld [hli], a
ld a, [hMinutes]
ld [hli], a
ld a, [hSeconds]
ld [hli], a
ret
; 11621
Function11621: ; 11621
ld a, [CurDay]
ld [hl], a
ret
; 11626
Function11626: ; 11626
ld a, [CurDay]
ld [hli], a
ld a, [hHours]
ld [hli], a
ret
; 1162e
Function1162e: ; 1162e
ld a, [CurDay]
ld [hli], a
ld a, [hHours]
ld [hli], a
ld a, [hMinutes]
ld [hli], a
ret
; 11639

View File

@@ -221,49 +221,65 @@ else
endc endc
jp z, \2 jp z, \2
endm endm
dict $15, Char15
dict $4f, Line dict2: macro
dict $4e, NextLine if \1 == 0
dict $16, Char16 and a
else
cp \1
endc
jr nz, \@
ld a, \2
\@:
endm
dict3: macro
if \1 == 0
and a
else
cp \1
endc
jr z, \2
endm
dict "<DAY>", Char15
dict "<LINE>", LineChar
dict "<NEXT>", NextLineChar
dict TX_FAR, TextFar
dict $00, NullChar dict $00, NullChar
dict $4c, Function1337 dict $4c, Char4C
dict $4b, Char4B dict $4b, Char4B
dict $51, Paragraph dict "<PARA>", Paragraph
dict $49, PrintMomsName dict "<MOM>", PrintMomsName
dict $52, PrintPlayerName dict "<PLAYER>", PrintPlayerName
dict $53, PrintRivalName dict "<RIVAL>", PrintRivalName
dict $35, Char35 dict $35, Char35
dict $36, Char36 dict $36, Char36
dict $37, Char37 dict $37, Char37
dict $38, PrintRedsName dict "<RED>", PrintRedsName
dict $39, PrintGreensName dict "<GREEN>", PrintGreensName
dict $54, Char54 dict "#", PlacePOKe
dict $5b, Char5B dict "<PC>", PCChar
dict $5e, Char5E dict "<ROCKET>", RocketChar
dict $5c, Char5C dict "<TM>", TMChar
dict $5d, Char5D dict "<TRNER>", TrainerChar
dict $23, Char23 dict $23, Char23
dict $22, Char22 dict $22, Char22
dict $55, ContText dict "<CONT>", ContText
dict $56, Char56 dict "<......>", SixDotsChar
dict $57, DoneText dict "<DONE>", DoneText
dict $58, PromptText dict "<PROMPT>", PromptText
dict $4a, Char4A dict "<PKMN>", PlacePKMN
dict $24, Char24 dict $24, PlacePOKE
dict $25, NextChar dict $25, NextChar
cp $1f dict2 $1f, " "
jr nz, .ok
ld a, $7f
.ok
dict $5f, Char5F dict $5f, Char5F
dict $59, Char59 dict "<TARGET>", PlaceMoveTargetsName
dict $5a, Char5A dict "<USER>", PlaceMoveUsersName
dict $3f, Char3F dict "<ENEMY>", PlaceEnemysName
dict $14, Char14 dict "<PLAY_G>", PlaceGenderedPlayerName
cp $e4 ; handakuten dict3 $e4, .place
jr z, .place dict3 $e5, .place
cp $e5 ; dakuten
jr z, .place
jr .nope jr .nope
ld b, a ld b, a
@@ -319,7 +335,7 @@ Char15:: ; 117b
print_name: macro print_name: macro
push de push de
ld de, \1 ld de, \1
jp Function126a jp PlaceCommandCharacter
endm endm
PrintMomsName: print_name MomsName ; 1186 PrintMomsName: print_name MomsName ; 1186
@@ -328,46 +344,46 @@ PrintRivalName: print_name RivalName ; 1194
PrintRedsName: print_name RedsName ; 119b PrintRedsName: print_name RedsName ; 119b
PrintGreensName: print_name GreensName ; 11a2 PrintGreensName: print_name GreensName ; 11a2
Char5D: print_name Char5DText ; 11a9 TrainerChar: print_name TrainerCharText ; 11a9
Char5C: print_name Char5CText ; 11b0 TMChar: print_name TMCharText ; 11b0
Char5B: print_name Char5BText ; 11b7 PCChar: print_name PCCharText ; 11b7
Char5E: print_name Char5EText ; 11be RocketChar: print_name RocketCharText ; 11be
Char54: print_name Char54Text ; 11c5 PlacePOKe: print_name PlacePOKeText ; 11c5
Char23: print_name Char23Text ; 11cc Char23: print_name Char23Text ; 11cc
Char56: print_name Char56Text ; 11d3 SixDotsChar: print_name SixDotsCharText ; 11d3
Char4A: print_name Char4AText ; 11da PlacePKMN: print_name PlacePKMNText ; 11da
Char24: print_name Char24Text ; 11e1 PlacePOKE: print_name PlacePOKEText ; 11e1
Char35: print_name Char35Text ; 11e8 Char35: print_name Char35Text ; 11e8
Char36: print_name Char36Text ; 11ef Char36: print_name Char36Text ; 11ef
Char37: print_name Char37Text ; 11f6 Char37: print_name Char37Text ; 11f6
Char59:: ; 11fd PlaceMoveTargetsName:: ; 11fd
ld a, [hBattleTurn] ld a, [hBattleTurn]
xor 1 xor 1
jr Char59_5A jr PlaceMoveTargetsName_5A
Char5A:: ; 1203 PlaceMoveUsersName:: ; 1203
ld a, [hBattleTurn] ld a, [hBattleTurn]
Char59_5A: ; 1205 PlaceMoveTargetsName_5A: ; 1205
push de push de
and a and a
jr nz, .enemy jr nz, .enemy
ld de, BattleMonNick ld de, BattleMonNick
jr Function126a jr PlaceCommandCharacter
.enemy .enemy
ld de, Char5AText ; Enemy ld de, EnemyText ; Enemy
call PlaceString call PlaceString
ld h, b ld h, b
ld l, c ld l, c
ld de, EnemyMonNick ld de, EnemyMonNick
jr Function126a jr PlaceCommandCharacter
Char3F:: ; 121b PlaceEnemysName:: ; 121b
push de push de
ld a, [InLinkBattle] ld a, [InLinkBattle]
@@ -390,18 +406,18 @@ Char3F:: ; 121b
callab Battle_GetTrainerName callab Battle_GetTrainerName
pop hl pop hl
ld de, StringBuffer1 ld de, StringBuffer1
jr Function126a jr PlaceCommandCharacter
.rival .rival
ld de, RivalName ld de, RivalName
jr Function126a jr PlaceCommandCharacter
.linkbattle .linkbattle
ld de, OTName ld de, OTName
jr Function126a jr PlaceCommandCharacter
Char14:: ; 1252 PlaceGenderedPlayerName:: ; 1252
push de push de
ld de, PlayerName ld de, PlayerName
call PlaceString call PlaceString
@@ -410,12 +426,12 @@ Char14:: ; 1252
ld a, [PlayerGender] ld a, [PlayerGender]
bit 0, a bit 0, a
ld de, String12a5 ld de, String12a5
jr z, Function126a jr z, PlaceCommandCharacter
ld de, String12a6 ld de, String12a6
jr Function126a jr PlaceCommandCharacter
Function126a:: ; 126a PlaceCommandCharacter:: ; 126a
call PlaceString call PlaceString
ld h, b ld h, b
ld l, c ld l, c
@@ -423,16 +439,16 @@ Function126a:: ; 126a
jp NextChar jp NextChar
; 0x1273 ; 0x1273
Char5CText:: db "TM@" ; 1273 TMCharText:: db "TM@" ; 1273
Char5DText:: db "TRAINER@" ; 1276 TrainerCharText:: db "TRAINER@" ; 1276
Char5BText:: db "PC@" ; 127e PCCharText:: db "PC@" ; 127e
Char5EText:: db "ROCKET@" ; 1281 RocketCharText:: db "ROCKET@" ; 1281
Char54Text:: db "POKé@" ; 1288 PlacePOKeText:: db "POKé@" ; 1288
Char23Text:: db "こうげき@" ; 128d Char23Text:: db "こうげき@" ; 128d
Char56Text:: db "……@" ; 1292 SixDotsCharText:: db "……@" ; 1292
Char5AText:: db "Enemy @" ; 1295 EnemyText:: db "Enemy @" ; 1295
Char4AText:: db $e1, $e2, "@" ; PK MN ; 129c PlacePKMNText:: db "<PK><MN>@" ; PK MN ; 129c
Char24Text:: db $70, $71, "@" ; PO KE ; 129f PlacePOKEText:: db "<PO><KE>@" ; PO KE ; 129f
String12a2:: db " @" ; 12a2 String12a2:: db " @" ; 12a2
Char35Text:: Char35Text::
Char36Text:: Char36Text::
@@ -441,7 +457,7 @@ String12a5:: db "@" ; 12a5
String12a6:: db "@" ; 12a6 String12a6:: db "@" ; 12a6
; 12a7 ; 12a7
NextLine:: ; 12a7 NextLineChar:: ; 12a7
pop hl pop hl
ld bc, SCREEN_WIDTH * 2 ld bc, SCREEN_WIDTH * 2
add hl, bc add hl, bc
@@ -457,7 +473,7 @@ Char22:: ; 12b0
jp NextChar jp NextChar
; 12b9 ; 12b9
Char16:: ; 12b9 TextFar:: ; 12b9
pop hl pop hl
push de push de
ld bc, -TileMap + $10000 ld bc, -TileMap + $10000
@@ -500,7 +516,7 @@ Char16:: ; 12b9
; 12ea ; 12ea
Line:: ; 12ea LineChar:: ; 12ea
pop hl pop hl
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2 hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2
push hl push hl
@@ -549,7 +565,7 @@ Char4B:: ; 131f
or a or a
call z, Function13cd call z, Function13cd
Function1337:: ; 1337 Char4C:: ; 1337
push de push de
call Function138c call Function138c
call Function138c call Function138c

View File

@@ -658,27 +658,27 @@ endr
ld b, $0 ld b, $0
callba Function116c1 callba Function116c1
ld a, $1 ld a, BANK(sBoxMonNicknames)
call GetSRAMBank call GetSRAMBank
ld hl, wd050 ld hl, wd050
ld de, $b082 ld de, sBoxMonNicknames
ld bc, $000b ld bc, PKMN_NAME_LENGTH
call CopyBytes call CopyBytes
ld hl, $b082 ld hl, sBoxMonNicknames
ld de, StringBuffer1 ld de, StringBuffer1
call InitName call InitName
call CloseSRAM call CloseSRAM
.asm_ebaf .asm_ebaf
ld a, $1 ld a, BANK(sBoxMonNicknames)
call GetSRAMBank call GetSRAMBank
ld hl, $b082 ld hl, sBoxMonNicknames
ld de, wd050 ld de, wd050
ld bc, $000b ld bc, PKMN_NAME_LENGTH
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM

View File

@@ -104,6 +104,13 @@ dwcoord: MACRO
endr endr
ENDM ENDM
ldcoord: MACRO
if _NARG < 3
ld [TileMap + SCREEN_WIDTH * (\2) + (\1)], a
else
ld [\3 + SCREEN_WIDTH * (\2) + (\1)], a
endc
ENDM
; pic animations ; pic animations
frame: MACRO frame: MACRO

View File

@@ -282,5 +282,22 @@
charmap "<USER>", $5a charmap "<USER>", $5a
charmap "<ENEMY>", $3f charmap "<ENEMY>", $3f
charmap "<PKMN>", $4a charmap "<PKMN>", $4a
charmap "<PK>", $e1
charmap "<MN>", $e2
charmap "<PO>", $70
charmap "<KE>", $71
charmap "<MOM>", $49
charmap "<POKE>", $24
charmap "<PLAY_G>", $14 ; <PLAYER> + gender charmap "<PLAY_G>", $14 ; <PLAYER> + gender
charmap "<PARA>", $51
charmap "<LINE>", $4f
charmap "<NEXT>", $4e
charmap "<CONT>", $55
charmap "<DONE>", $57
charmap "<PROMPT>", $58
charmap "<DAY>", $15
charmap "<PC>", $5b
charmap "<TM>", $5c
charmap "<TRNER>", $5d
charmap "<ROCKET>", $5e
charmap "<......>", $56

View File

@@ -300,12 +300,20 @@ givepoke: macro
db givepoke_command db givepoke_command
db \1 ; pokemon db \1 ; pokemon
db \2 ; level db \2 ; level
if _NARG >= 3
db \3 ; item db \3 ; item
if _NARG >= 4
db \4 ; trainer db \4 ; trainer
if \4 if \4
dw \5 ; trainer_name_pointer dw \5 ; trainer_name_pointer
dw \6 ; pkmn_nickname dw \6 ; pkmn_nickname
endc endc
else
db 0
endc
else
db 0, 0
endc
endm endm
enum giveegg_command enum giveegg_command

699
main.asm

File diff suppressed because it is too large Load Diff

View File

@@ -147,7 +147,7 @@ UnknownScript_0x727ed:
closetext closetext
writebyte PIKACHU writebyte PIKACHU
special Special_GameCornerPrizeMonCheckDex special Special_GameCornerPrizeMonCheckDex
givepoke PIKACHU, 25, 0, 0 givepoke PIKACHU, 25
takecoins 2222 takecoins 2222
jump UnknownScript_0x727d3 jump UnknownScript_0x727d3
@@ -165,7 +165,7 @@ UnknownScript_0x7281b:
closetext closetext
writebyte PORYGON writebyte PORYGON
special Special_GameCornerPrizeMonCheckDex special Special_GameCornerPrizeMonCheckDex
givepoke PORYGON, 15, 0, 0 givepoke PORYGON, 15
takecoins 5555 takecoins 5555
jump UnknownScript_0x727d3 jump UnknownScript_0x727d3
@@ -183,7 +183,7 @@ UnknownScript_0x72849:
closetext closetext
writebyte LARVITAR writebyte LARVITAR
special Special_GameCornerPrizeMonCheckDex special Special_GameCornerPrizeMonCheckDex
givepoke LARVITAR, 40, 0, 0 givepoke LARVITAR, 40
takecoins 8888 takecoins 8888
jump UnknownScript_0x727d3 jump UnknownScript_0x727d3

View File

@@ -211,7 +211,7 @@ ElderScript_0x18d1a5:
writetext UnknownText_0x18d697 writetext UnknownText_0x18d697
playsound SFX_CAUGHT_MON playsound SFX_CAUGHT_MON
waitbutton waitbutton
givepoke DRATINI, 15, 0, 0 givepoke DRATINI, 15
checkevent EVENT_ANSWERED_DRAGON_MASTER_QUIZ_WRONG checkevent EVENT_ANSWERED_DRAGON_MASTER_QUIZ_WRONG
special SpecialDratini special SpecialDratini
setevent EVENT_GOT_DRATINI setevent EVENT_GOT_DRATINI

View File

@@ -105,10 +105,10 @@ ElmCheckEverstone:
checkevent EVENT_TOLD_ELM_ABOUT_TOGEPI_OVER_THE_PHONE checkevent EVENT_TOLD_ELM_ABOUT_TOGEPI_OVER_THE_PHONE
iffalse ElmCheckTogepiEgg iffalse ElmCheckTogepiEgg
writebyte TOGEPI writebyte TOGEPI
special Functionc284 special Special_FindThatSpeciesYourTrainerID
iftrue ShowElmTogepiScript iftrue ShowElmTogepiScript
writebyte TOGETIC writebyte TOGETIC
special Functionc284 special Special_FindThatSpeciesYourTrainerID
iftrue ShowElmTogepiScript iftrue ShowElmTogepiScript
writetext UnknownText_0x79a40 writetext UnknownText_0x79a40
closetext closetext
@@ -117,10 +117,10 @@ ElmCheckEverstone:
ElmEggHatchedScript: ElmEggHatchedScript:
writebyte TOGEPI writebyte TOGEPI
special Functionc284 special Special_FindThatSpeciesYourTrainerID
iftrue ShowElmTogepiScript iftrue ShowElmTogepiScript
writebyte TOGETIC writebyte TOGETIC
special Functionc284 special Special_FindThatSpeciesYourTrainerID
iftrue ShowElmTogepiScript iftrue ShowElmTogepiScript
jump ElmCheckGotEggAgain jump ElmCheckGotEggAgain
@@ -177,7 +177,7 @@ CyndaquilPokeBallScript:
playsound SFX_CAUGHT_MON playsound SFX_CAUGHT_MON
waitbutton waitbutton
keeptextopen keeptextopen
givepoke CYNDAQUIL, 5, BERRY, 0 givepoke CYNDAQUIL, 5, BERRY
loadmovesprites loadmovesprites
checkcode VAR_FACING checkcode VAR_FACING
if_equal $3, ElmDirectionsScript if_equal $3, ElmDirectionsScript
@@ -207,7 +207,7 @@ TotodilePokeBallScript:
playsound SFX_CAUGHT_MON playsound SFX_CAUGHT_MON
waitbutton waitbutton
keeptextopen keeptextopen
givepoke TOTODILE, 5, BERRY, 0 givepoke TOTODILE, 5, BERRY
loadmovesprites loadmovesprites
applymovement PLAYER, AfterTotodileMovement applymovement PLAYER, AfterTotodileMovement
jump ElmDirectionsScript jump ElmDirectionsScript
@@ -235,7 +235,7 @@ ChikoritaPokeBallScript:
playsound SFX_CAUGHT_MON playsound SFX_CAUGHT_MON
waitbutton waitbutton
keeptextopen keeptextopen
givepoke CHIKORITA, 5, BERRY, 0 givepoke CHIKORITA, 5, BERRY
loadmovesprites loadmovesprites
applymovement PLAYER, AfterChikoritaMovement applymovement PLAYER, AfterChikoritaMovement
jump ElmDirectionsScript jump ElmDirectionsScript

View File

@@ -176,7 +176,7 @@ UnknownScript_0x56d26:
closetext closetext
writebyte ABRA writebyte ABRA
special Special_GameCornerPrizeMonCheckDex special Special_GameCornerPrizeMonCheckDex
givepoke ABRA, 5, 0, 0 givepoke ABRA, 5
takecoins 100 takecoins 100
jump UnknownScript_0x56d0c jump UnknownScript_0x56d0c
@@ -194,7 +194,7 @@ UnknownScript_0x56d54:
closetext closetext
writebyte CUBONE writebyte CUBONE
special Special_GameCornerPrizeMonCheckDex special Special_GameCornerPrizeMonCheckDex
givepoke CUBONE, 15, 0, 0 givepoke CUBONE, 15
takecoins 800 takecoins 800
jump UnknownScript_0x56d0c jump UnknownScript_0x56d0c
@@ -212,7 +212,7 @@ UnknownScript_0x56d82:
closetext closetext
writebyte WOBBUFFET writebyte WOBBUFFET
special Special_GameCornerPrizeMonCheckDex special Special_GameCornerPrizeMonCheckDex
givepoke WOBBUFFET, 15, 0, 0 givepoke WOBBUFFET, 15
takecoins 1500 takecoins 1500
jump UnknownScript_0x56d0c jump UnknownScript_0x56d0c

View File

@@ -455,7 +455,7 @@ UnknownScript_0x6ee42:
spriteface PLAYER, DOWN spriteface PLAYER, DOWN
pause 20 pause 20
clearflag ENGINE_HAVE_EXAMINED_GS_BALL clearflag ENGINE_HAVE_EXAMINED_GS_BALL
special Function4989a special Special_CelebiShrineEvent
loadpokedata CELEBI, 30 loadpokedata CELEBI, 30
startbattle startbattle
returnafterbattle returnafterbattle

View File

@@ -48,13 +48,13 @@ UnknownScript_0x7a519:
writetext UnknownText_0x7a742 writetext UnknownText_0x7a742
yesorno yesorno
iffalse UnknownScript_0x7a52a iffalse UnknownScript_0x7a52a
special Function90a54 special Special_InitialSetDSTFlag
yesorno yesorno
iffalse UnknownScript_0x7a519 iffalse UnknownScript_0x7a519
jump UnknownScript_0x7a531 jump UnknownScript_0x7a531
UnknownScript_0x7a52a: UnknownScript_0x7a52a:
special Function90a88 special Special_InitialClearDSTFlag
yesorno yesorno
iffalse UnknownScript_0x7a519 iffalse UnknownScript_0x7a519
UnknownScript_0x7a531: UnknownScript_0x7a531:

View File

@@ -37,7 +37,7 @@ UnknownScript_0x19a6d7:
UnknownScript_0x19a6e0: UnknownScript_0x19a6e0:
writebyte MAGIKARP writebyte MAGIKARP
special Functionc276 special Special_FindThatSpecies
iffalse UnknownScript_0x19a6d7 iffalse UnknownScript_0x19a6d7
writetext UnknownText_0x19a93e writetext UnknownText_0x19a93e
closetext closetext

View File

@@ -30,7 +30,7 @@ UnknownScript_0x7e217:
writetext UnknownText_0x7e355 writetext UnknownText_0x7e355
playsound SFX_CAUGHT_MON playsound SFX_CAUGHT_MON
waitbutton waitbutton
givepoke TYROGUE, 10, 0, 0 givepoke TYROGUE, 10
setevent EVENT_GOT_TYROGUE_FROM_KIYO setevent EVENT_GOT_TYROGUE_FROM_KIYO
UnknownScript_0x7e231: UnknownScript_0x7e231:
writetext UnknownText_0x7e36a writetext UnknownText_0x7e36a

Some files were not shown because too many files have changed in this diff Show More