Merge pull request #714 from Rangi42/master

Miscellaneous updates and corrections
This commit is contained in:
Rangi 2020-04-23 16:35:47 -04:00 committed by GitHub
commit 38cdad798d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 96 additions and 93 deletions

View File

@ -1057,7 +1057,7 @@ Sfx_RegisterPhoneNumber_Ch5:
rest 8
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_RegisterPhoneNumber_Ch6:
toggle_sfx
@ -1081,7 +1081,7 @@ Sfx_RegisterPhoneNumber_Ch6:
rest 8
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_RegisterPhoneNumber_Ch7:
toggle_sfx
@ -1102,7 +1102,7 @@ Sfx_RegisterPhoneNumber_Ch7:
rest 8
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_RegisterPhoneNumber_Ch8:
toggle_sfx
@ -1113,7 +1113,7 @@ Sfx_RegisterPhoneNumber_Ch8:
rest 16
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_3rdPlace:
channel_count 3
@ -1138,7 +1138,7 @@ Sfx_3rdPlace_Ch5:
note D_, 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_3rdPlace_Ch6:
toggle_sfx
@ -1155,7 +1155,7 @@ Sfx_3rdPlace_Ch6:
note G_, 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_3rdPlace_Ch7:
toggle_sfx
@ -1172,7 +1172,7 @@ Sfx_3rdPlace_Ch7:
note B_, 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetEgg:
channel_count 4
@ -1211,7 +1211,7 @@ Sfx_GetEgg_Ch5:
rest 9
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetEgg_Ch6:
toggle_sfx
@ -1240,7 +1240,7 @@ Sfx_GetEgg_Ch6:
rest 9
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetEgg_Ch7:
toggle_sfx
@ -1259,7 +1259,7 @@ Sfx_GetEgg_Ch7:
rest 9
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetEgg_Ch8:
toggle_sfx
@ -1271,7 +1271,7 @@ Sfx_GetEgg_Ch8:
rest 12
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_MoveDeleted:
channel_count 4
@ -1308,7 +1308,7 @@ Sfx_MoveDeleted_Ch5:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_MoveDeleted_Ch6:
toggle_sfx
@ -1344,7 +1344,7 @@ Sfx_MoveDeleted_Ch6:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_MoveDeleted_Ch7:
toggle_sfx
@ -1371,7 +1371,7 @@ Sfx_MoveDeleted_Ch7:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_MoveDeleted_Ch8:
toggle_sfx
@ -1383,7 +1383,7 @@ Sfx_MoveDeleted_Ch8:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_2ndPlace:
channel_count 4
@ -1424,7 +1424,7 @@ Sfx_2ndPlace_Ch5:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_2ndPlace_Ch6:
toggle_sfx
@ -1448,7 +1448,7 @@ Sfx_2ndPlace_Ch6:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_2ndPlace_Ch7:
toggle_sfx
@ -1486,7 +1486,7 @@ Sfx_2ndPlace_Ch7:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_2ndPlace_Ch8:
toggle_sfx
@ -1501,7 +1501,7 @@ Sfx_2ndPlace_branch_f0fd7:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_1stPlace:
channel_count 4
@ -1549,7 +1549,7 @@ Sfx_1stPlace_Ch5:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_1stPlace_Ch6:
toggle_sfx
@ -1573,7 +1573,7 @@ Sfx_1stPlace_Ch6:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_1stPlace_Ch7:
toggle_sfx
@ -1597,7 +1597,7 @@ Sfx_1stPlace_Ch7:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_1stPlace_Ch8:
toggle_sfx
@ -1618,7 +1618,7 @@ Sfx_1stPlace_Ch8:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_ChooseACard:
channel_count 4
@ -1671,7 +1671,7 @@ Sfx_ChooseACard_Ch5:
rest 12
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_ChooseACard_Ch6:
toggle_sfx
@ -1703,7 +1703,7 @@ Sfx_ChooseACard_Ch6:
rest 12
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_ChooseACard_Ch7:
toggle_sfx
@ -1739,7 +1739,7 @@ Sfx_ChooseACard_Ch7:
rest 12
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_ChooseACard_Ch8:
toggle_sfx
@ -1764,7 +1764,7 @@ Sfx_ChooseACard_Ch8:
note B_, 16
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetTm:
channel_count 4
@ -1797,7 +1797,7 @@ Sfx_GetTm_Ch5:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetTm_Ch6:
toggle_sfx
@ -1820,7 +1820,7 @@ Sfx_GetTm_Ch6:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetTm_Ch7:
toggle_sfx
@ -1851,7 +1851,7 @@ Sfx_GetTm_Ch7:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetTm_Ch8:
toggle_sfx
@ -1871,7 +1871,7 @@ Sfx_GetTm_Ch8:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetBadge:
channel_count 4
@ -1899,7 +1899,7 @@ Sfx_GetBadge_Ch5:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetBadge_branch_f11aa:
rest 5
@ -1970,7 +1970,7 @@ Sfx_GetBadge_Ch6:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetBadge_Ch7:
toggle_sfx
@ -2009,7 +2009,7 @@ Sfx_GetBadge_Ch7:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_GetBadge_Ch8:
toggle_sfx
@ -2035,7 +2035,7 @@ Sfx_GetBadge_branch_f1220:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_QuitSlots:
channel_count 4
@ -2074,7 +2074,7 @@ Sfx_QuitSlots_Ch5:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_QuitSlots_Ch6:
toggle_sfx
@ -2101,7 +2101,7 @@ Sfx_QuitSlots_Ch6:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_QuitSlots_Ch7:
toggle_sfx
@ -2132,7 +2132,7 @@ Sfx_QuitSlots_Ch7:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_QuitSlots_Ch8:
toggle_sfx
@ -2152,7 +2152,7 @@ Sfx_QuitSlots_Ch8:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_Protect:
channel_count 2
@ -3042,7 +3042,7 @@ Sfx_DexFanfareLessThan20_Ch5:
note D_, 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfareLessThan20_Ch6:
toggle_sfx
@ -3061,7 +3061,7 @@ Sfx_DexFanfareLessThan20_Ch6:
note F#, 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfareLessThan20_Ch7:
toggle_sfx
@ -3089,7 +3089,7 @@ Sfx_DexFanfareLessThan20_Ch7:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfareLessThan20_Ch8:
toggle_sfx
@ -3100,7 +3100,7 @@ Sfx_DexFanfareLessThan20_Ch8:
rest 12
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare140169:
channel_count 4
@ -3136,7 +3136,7 @@ Sfx_DexFanfare140169_Ch5:
rest 8
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare140169_Ch6:
toggle_sfx
@ -3162,7 +3162,7 @@ Sfx_DexFanfare140169_Ch6:
rest 8
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare140169_Ch7:
toggle_sfx
@ -3196,7 +3196,7 @@ Sfx_DexFanfare140169_Ch7:
rest 4
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare140169_Ch8:
toggle_sfx
@ -3213,7 +3213,7 @@ Sfx_DexFanfare140169_branch_f1945:
note D_, 8
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare170199:
channel_count 4
@ -3249,7 +3249,7 @@ Sfx_DexFanfare170199_Ch5:
rest 4
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare170199_Ch6:
toggle_sfx
@ -3277,7 +3277,7 @@ Sfx_DexFanfare170199_Ch6:
rest 4
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare170199_Ch7:
toggle_sfx
@ -3305,7 +3305,7 @@ Sfx_DexFanfare170199_Ch7:
rest 4
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare170199_Ch8:
toggle_sfx
@ -3327,7 +3327,7 @@ Sfx_DexFanfare170199_Ch8:
note B_, 16
sound_ret
db $fd
db sound_loop_cmd ; unused
Sfx_DexFanfare200229:
channel_count 4
@ -3361,7 +3361,7 @@ Sfx_DexFanfare200229_Ch5:
rest 4
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare200229_Ch6:
toggle_sfx
@ -3384,7 +3384,7 @@ Sfx_DexFanfare200229_Ch6:
rest 4
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare200229_Ch7:
toggle_sfx
@ -3428,7 +3428,7 @@ Sfx_DexFanfare200229_Ch7:
rest 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare200229_Ch8:
toggle_sfx
@ -3457,7 +3457,7 @@ Sfx_DexFanfare200229_Ch8:
note B_, 12
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare230Plus:
channel_count 4
@ -3512,7 +3512,7 @@ Sfx_DexFanfare230Plus_Ch5:
rest 2
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare230Plus_Ch6:
toggle_sfx
@ -3547,7 +3547,7 @@ Sfx_DexFanfare230Plus_Ch6:
rest 2
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare230Plus_Ch7:
toggle_sfx
@ -3596,7 +3596,7 @@ Sfx_DexFanfare230Plus_Ch7:
rest 2
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_DexFanfare230Plus_Ch8:
toggle_sfx
@ -3632,7 +3632,7 @@ Sfx_DexFanfare230Plus_branch_f1b2b:
note D_, 6
sound_ret
toggle_sfx
toggle_sfx ; unused
Sfx_NotVeryEffective:
channel_count 1

View File

@ -617,7 +617,7 @@ And edit [engine/pokegear/radio.asm](https://github.com/pret/pokecrystal/blob/ma
add hl, bc
add hl, bc
+ add hl, bc
+ b = bank
+ ; b = bank
+ ld a, BANK(PokedexDataPointerTable)
+ call GetFarByte
+ ld b, a

View File

@ -6219,7 +6219,7 @@ LoadEnemyMon:
; Fill stats
ld de, wEnemyMonMaxHP
ld b, FALSE
ld hl, wEnemyMonDVs - (MON_DVS - MON_STAT_EXP + 1) ; wLinkBattleRNs + 7 ; ?
ld hl, wEnemyMonDVs - (MON_DVS - MON_STAT_EXP + 1)
predef CalcMonStats
; If we're in a trainer battle,
@ -8401,7 +8401,7 @@ DisplayLinkBattleResult:
ld a, BANK(sLinkBattleStats)
call GetSRAMBank
call AddLastMobileBattleToLinkRecord
call AddLastLinkBattleToLinkRecord
call ReadAndPrintLinkBattleRecord
call CloseSRAM
@ -8442,6 +8442,9 @@ IsMobileBattle2:
cp LINK_MOBILE
ret
LINK_BATTLE_RECORD_LENGTH EQUS "(sLinkBattleRecord1End - sLinkBattleRecord1)" ; 18
NUM_LINK_BATTLE_RECORDS EQUS "((sLinkBattleStatsEnd - sLinkBattleRecord) / LINK_BATTLE_RECORD_LENGTH)" ; 5
_DisplayLinkRecord:
ld a, BANK(sLinkBattleStats)
call GetSRAMBank
@ -8467,7 +8470,7 @@ ReadAndPrintLinkBattleRecord:
call ClearSprites
call .PrintBattleRecord
hlcoord 0, 8
ld b, 5
ld b, NUM_LINK_BATTLE_RECORDS
ld de, sLinkBattleRecord + 2
.loop
push bc
@ -8484,7 +8487,7 @@ ReadAndPrintLinkBattleRecord:
ld h, d
ld l, e
ld de, wd002
ld bc, 10
ld bc, NAME_LENGTH - 1
call CopyBytes
ld a, "@"
ld [de], a
@ -8521,7 +8524,7 @@ ReadAndPrintLinkBattleRecord:
call PlaceString
.next
pop hl
ld bc, 18
ld bc, LINK_BATTLE_RECORD_LENGTH
add hl, bc
ld d, h
ld e, l
@ -8694,7 +8697,7 @@ GetRoamMonSpecies:
ld hl, wRoamMon3Species
ret
AddLastMobileBattleToLinkRecord:
AddLastLinkBattleToLinkRecord:
ld hl, wOTPlayerID
ld de, wStringBuffer1
ld bc, 2
@ -8702,10 +8705,10 @@ AddLastMobileBattleToLinkRecord:
ld hl, wOTPlayerName
ld bc, NAME_LENGTH - 1
call CopyBytes
ld hl, sLinkBattleResults
ld hl, sLinkBattleStats - (LINK_BATTLE_RECORD_LENGTH - 6)
call .StoreResult
ld hl, sLinkBattleRecord
ld d, 5
ld d, NUM_LINK_BATTLE_RECORDS
.loop
push hl
inc hl
@ -8716,17 +8719,17 @@ AddLastMobileBattleToLinkRecord:
and a
jr z, .copy
push de
ld bc, 12
ld bc, LINK_BATTLE_RECORD_LENGTH - 6
ld de, wStringBuffer1
call CompareBytesLong
pop de
pop hl
jr c, .done
ld bc, 18
ld bc, LINK_BATTLE_RECORD_LENGTH
add hl, bc
dec d
jr nz, .loop
ld bc, -18
ld bc, -LINK_BATTLE_RECORD_LENGTH
add hl, bc
push hl
@ -8734,7 +8737,7 @@ AddLastMobileBattleToLinkRecord:
ld d, h
ld e, l
ld hl, wStringBuffer1
ld bc, 12
ld bc, LINK_BATTLE_RECORD_LENGTH - 6
call CopyBytes
ld b, 6
xor a
@ -8749,16 +8752,17 @@ AddLastMobileBattleToLinkRecord:
call .StoreResult
call .FindOpponentAndAppendRecord
ret
.StoreResult:
ld a, [wBattleResult]
and $f
cp LOSE
ld bc, sLinkBattleWins + 1 - sLinkBattleResults
ld bc, (sLinkBattleRecord1Wins - sLinkBattleRecord1) + 1
jr c, .okay ; WIN
ld bc, sLinkBattleLosses + 1 - sLinkBattleResults
ld bc, (sLinkBattleRecord1Losses - sLinkBattleRecord1) + 1
jr z, .okay ; LOSE
; DRAW
ld bc, sLinkBattleDraws + 1 - sLinkBattleResults
ld bc, (sLinkBattleRecord1Draws - sLinkBattleRecord1) + 1
.okay
add hl, bc
call .CheckOverflow
@ -8780,8 +8784,8 @@ AddLastMobileBattleToLinkRecord:
ret
.FindOpponentAndAppendRecord:
ld b, 5
ld hl, sLinkBattleRecord + 17
ld b, NUM_LINK_BATTLE_RECORDS
ld hl, sLinkBattleRecord1End - 1
ld de, wd002
.loop3
push bc
@ -8799,7 +8803,7 @@ AddLastMobileBattleToLinkRecord:
ld a, c
ld [de], a
inc de
ld bc, 18
ld bc, LINK_BATTLE_RECORD_LENGTH
add hl, bc
pop bc
dec b
@ -8848,26 +8852,26 @@ AddLastMobileBattleToLinkRecord:
.done2
push bc
ld a, b
ld bc, 18
ld bc, LINK_BATTLE_RECORD_LENGTH
ld hl, sLinkBattleRecord
call AddNTimes
push hl
ld de, wd002
ld bc, 18
ld bc, LINK_BATTLE_RECORD_LENGTH
call CopyBytes
pop hl
pop bc
push hl
ld a, c
ld bc, 18
ld bc, LINK_BATTLE_RECORD_LENGTH
ld hl, sLinkBattleRecord
call AddNTimes
pop de
push hl
ld bc, 18
ld bc, LINK_BATTLE_RECORD_LENGTH
call CopyBytes
ld hl, wd002
ld bc, 18
ld bc, LINK_BATTLE_RECORD_LENGTH
pop de
call CopyBytes
ret

View File

@ -51,7 +51,7 @@ calc_sine_wave: MACRO
; input: a = a signed 6-bit value
; output: a = d * sin(a * pi/32)
and %111111
cp %100000
cp %100000
jr nc, .negative\@
call .apply\@
ld a, h

View File

@ -238,6 +238,7 @@ link_battle_record: MACRO
\1Wins:: dw
\1Losses:: dw
\1Draws:: dw
\1End::
ENDM
trademon: MACRO

View File

@ -125,13 +125,11 @@ SECTION "Active Box", SRAM
sBox:: box sBox
; b160
ds $f4
ds $100
SECTION "Link Battle Data", SRAM
sLinkBattleResults:: ds $c
sLinkBattleStats::
sLinkBattleWins:: dw ; b260
sLinkBattleLosses:: dw ; b262

View File

@ -2851,15 +2851,15 @@ wCurMapData::
wVisitedSpawns:: flag_array NUM_SPAWNS ; dca5
wDigWarpNumber:: db ; dcaa
wDigMapGroup:: db ; dcab
wDigMapNumber:: db ; dcac
wDigWarpNumber:: db ; dca9
wDigMapGroup:: db ; dcaa
wDigMapNumber:: db ; dcab
; used on maps like second floor pokécenter, which are reused, so we know which
; map to return to
wBackupWarpNumber:: db ; dcad
wBackupMapGroup:: db ; dcae
wBackupMapNumber:: db ; dcaf
wBackupWarpNumber:: db ; dcac
wBackupMapGroup:: db ; dcad
wBackupMapNumber:: db ; dcae
ds 3