Name the script special function and clean up a couple specials.

This commit is contained in:
yenatch 2014-07-19 14:02:58 -07:00
parent 52c5047a53
commit be08d93b61
2 changed files with 52 additions and 43 deletions

View File

@ -293,7 +293,7 @@ Script_special: ; 0x96e26
ld e, a ld e, a
call GetScriptByte call GetScriptByte
ld d, a ld d, a
callba Functionc01b callba Special
ret ret
; 0x96e35 ; 0x96e35

View File

@ -7861,7 +7861,9 @@ Datac012: ; c012
db $ff db $ff
; c01b ; c01b
Functionc01b:: ; c01b
Special:: ; c01b
; Run script special de.
ld hl, SpecialsPointers ld hl, SpecialsPointers
add hl, de add hl, de
add hl, de add hl, de
@ -7876,7 +7878,6 @@ Functionc01b:: ; c01b
ret ret
; c029 ; c029
SpecialsPointers: ; c029 SpecialsPointers: ; c029
dbw BANK(Function97c28), Function97c28 dbw BANK(Function97c28), Function97c28
dbw BANK(Function29ce8), Function29ce8 dbw BANK(Function29ce8), Function29ce8
@ -8434,46 +8435,47 @@ SpecialSnorlaxAwake: ; 0xc43d
ret ret
.ProximityCoords .ProximityCoords
db $21, $08 ; x, y
db $22, $0a db 33, 8 ; left
db $23, $0a db 34, 10 ; below
db $24, $08 db 35, 10 ; below
db $24, $09 db 36, 8 ; right
db 36, 9 ; right
db $ff db $ff
Functionc472: ; c472 Functionc472: ; c472
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
jp PlayCry jp PlayCry
; c478 ; c478
SpecialGameboyCheck: ; c478 SpecialGameboyCheck: ; c478
; check cgb
ld a, [hCGB] ld a, [hCGB]
and a and a
jr nz, .cgb jr nz, .cgb
; check sgb
ld a, [hSGB] ld a, [hSGB]
and a and a
jr nz, .sgb jr nz, .sgb
; gb
.gb
xor a xor a
jr .done jr .done
.sgb .sgb
ld a, 1 ld a, 1
jr .done jr .done
.cgb .cgb
ld a, 2 ld a, 2
.done .done
ld [ScriptVar], a ld [ScriptVar], a
ret ret
Functionc48f: ; c48f Functionc48f: ; c48f
ld a, $0 ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a ld [MusicFadeIDLo], a
ld a, $0 ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a ld [MusicFadeIDHi], a
ld a, $2 ld a, $2
ld [MusicFade], a ld [MusicFade], a
@ -8834,23 +8836,28 @@ Functionc677: ; c677
call GetPartyParamLocation call GetPartyParamLocation
ld d, h ld d, h
ld e, l ld e, l
ld hl, PartyMon1Status - PartyMon1Species ld hl, PartyMon1Status - PartyMon1Species
add hl, de add hl, de
xor a xor a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld hl, PartyMon1MaxHP - PartyMon1Species ld hl, PartyMon1MaxHP - PartyMon1Species
add hl, de add hl, de
; bc = PartyMon1HP - PartyMon1Species ; bc = PartyMon1HP - PartyMon1Species
ld b, h ld b, h
ld c, l ld c, l
dec bc dec bc
dec bc dec bc
ld a, [hli] ld a, [hli]
ld [bc], a ld [bc], a
inc bc inc bc
ld a, [hl] ld a, [hl]
ld [bc], a ld [bc], a
callba Functionf8b9 callba Functionf8b9
ret ret
; c699 ; c699
@ -8952,6 +8959,7 @@ GetPartyNick: ; c706
ret ret
; c721 ; c721
CheckEngineFlag: ; c721 CheckEngineFlag: ; c721
; Check engine flag de ; Check engine flag de
; Return carry if flag is not set ; Return carry if flag is not set
@ -8985,52 +8993,53 @@ BadgeRequiredText: ; c73d
db "@" db "@"
; c742 ; c742
CheckPartyMove: ; c742
; checks if a pokemon in your party has a move
; e = partymon being checked
; input: d = move id CheckPartyMove: ; c742
ld e, $00 ; mon # ; Check if a monster in your party has move d.
ld e, 0
xor a xor a
ld [CurPartyMon], a ld [CurPartyMon], a
.checkmon .loop
; check for valid species
ld c, e ld c, e
ld b, $00 ld b, 0
ld hl, PartySpecies ld hl, PartySpecies
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
and a ; no id and a
jr z, .quit jr z, .no
cp a, $ff ; terminator cp a, $ff
jr z, .quit jr z, .no
cp a, EGG cp a, EGG
jr z, .nextmon jr z, .next
; navigate to appropriate move table
ld bc, PartyMon2 - PartyMon1 ld bc, PartyMon2 - PartyMon1
ld hl, PartyMon1Moves ld hl, PartyMon1Moves
ld a, e ld a, e
call AddNTimes call AddNTimes
ld b, $04 ; number of moves ld b, NUM_MOVES
.checkmove .check
ld a, [hli] ld a, [hli]
cp d ; move id cp d
jr z, .end jr z, .yes
dec b ; how many moves left? dec b
jr nz, .checkmove jr nz, .check
.nextmon
inc e ; mon # .next
jr .checkmon inc e
.end jr .loop
.yes
ld a, e ld a, e
ld [CurPartyMon], a ; which mon has the move ld [CurPartyMon], a ; which mon has the move
xor a xor a
ret ret
.quit .no
scf scf
ret ret
; c779 ; c779
Functionc779: ; c779 Functionc779: ; c779
ld hl, UnknownText_0xc780 ld hl, UnknownText_0xc780
call Function1d67 call Function1d67
@ -9044,10 +9053,10 @@ UnknownText_0xc780: ; 0xc780
Functionc785: ; c785 Functionc785: ; c785
call Functionc6ea call Functionc6ea
.asm_c788 .loop
ld hl, Jumptable_c796 ld hl, Jumptable_c796
call Functionc6f5 call Functionc6f5
jr nc, .asm_c788 jr nc, .loop
and $7f and $7f
ld [$d0ec], a ld [$d0ec], a
ret ret