Merge pull request #416 from roukaour/master

Document bugs in docs/bugs.md
This commit is contained in:
yenatch 2017-12-12 23:37:31 -05:00 committed by GitHub
commit 0dd914e5f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 1317 additions and 533 deletions

View File

@ -749,7 +749,7 @@ TextJump_EnemyWithdrew: ; 384d0
Function384d5: ; This appears to be unused Function384d5: ; This appears to be unused
call AIUsedItemSound call AIUsedItemSound
call AI_HealStatus call AI_HealStatus
ld a, X_SPEED ld a, FULL_HEAL_RED ; X_SPEED
jp PrintText_UsedItemOn_AND_AIUpdateHUD jp PrintText_UsedItemOn_AND_AIUpdateHUD
; 384e0 ; 384e0
@ -761,6 +761,10 @@ AI_HealStatus: ; 384e0
xor a xor a
ld [hl], a ld [hl], a
ld [EnemyMonStatus], a ld [EnemyMonStatus], a
; Bug: this should reset SUBSTATUS_NIGHTMARE too
; Uncomment the lines below to fix
; ld hl, EnemySubStatus1
; res SUBSTATUS_NIGHTMARE, [hl]
ld hl, EnemySubStatus5 ld hl, EnemySubStatus5
res SUBSTATUS_TOXIC, [hl] res SUBSTATUS_TOXIC, [hl]
ret ret

View File

@ -1876,7 +1876,8 @@ AI_Smart_MeanLook: ; 38dfb
pop hl pop hl
jp z, AIDiscourageMove jp z, AIDiscourageMove
; 80% chance to greatly encourage this move if the enemy is badly poisoned (weird). ; 80% chance to greatly encourage this move if the enemy is badly poisoned (buggy).
; Should check PlayerSubStatus5 instead.
ld a, [EnemySubStatus5] ld a, [EnemySubStatus5]
bit SUBSTATUS_TOXIC, a bit SUBSTATUS_TOXIC, a
jr nz, .asm_38e26 jr nz, .asm_38e26

View File

@ -5998,7 +5998,7 @@ CheckPlayerHasUsableMoves: ; 3e786
swap a swap a
and $f and $f
ld b, a ld b, a
ld d, $5 ld d, NUM_MOVES + 1
xor a xor a
.loop .loop
dec d dec d
@ -6011,7 +6011,9 @@ CheckPlayerHasUsableMoves: ; 3e786
jr .loop jr .loop
.done .done
and a ; This is probably a bug, and will result in a move with PP Up confusing the game. ; Bug: this will result in a move with PP Up confusing the game.
; Replace with "and $3f" to fix.
and a
ret nz ret nz
.force_struggle .force_struggle

View File

@ -9810,7 +9810,7 @@ GetItemHeldEffect: ; 37dd0
dec a dec a
ld c, a ld c, a
ld b, 0 ld b, 0
ld a, Item2Attributes - Item1Attributes ld a, ITEMATTR_STRUCT_LENGTH
call AddNTimes call AddNTimes
ld a, BANK(ItemAttributes) ld a, BANK(ItemAttributes)
call GetFarHalfword call GetFarHalfword

View File

@ -298,7 +298,6 @@ CANT_TOSS EQU 1 << 7
; held item effects ; held item effects
const_def const_def
const HELD_NONE const HELD_NONE
const HELD_BERRY const HELD_BERRY
const HELD_2 const HELD_2
@ -382,7 +381,7 @@ const_value SET 70
const ITEMATTR_PERMISSIONS const ITEMATTR_PERMISSIONS
const ITEMATTR_POCKET const ITEMATTR_POCKET
const ITEMATTR_HELP const ITEMATTR_HELP
NUM_ITEMATTRS EQU const_value ITEMATTR_STRUCT_LENGTH EQU const_value
; item menu types ; item menu types
ITEMMENU_NOUSE EQU 0 ITEMMENU_NOUSE EQU 0

1029
docs/bugs_and_glitches.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -382,7 +382,10 @@ ShortHPBar_CalcPixelFrame: ; d839
and a and a
jr z, .return_zero jr z, .return_zero
call AddNTimes call AddNTimes
ld b, 0 ld b, 0
; This routine is buggy. If [wCurHPAnimMaxHP] * [wCurHPBarPixels] is divisible
; by 48, the loop runs one extra time. To fix, uncomment the line below.
.loop .loop
ld a, l ld a, l
sub 6 * 8 sub 6 * 8
@ -390,6 +393,7 @@ ShortHPBar_CalcPixelFrame: ; d839
ld a, h ld a, h
sbc $0 sbc $0
ld h, a ld h, a
; jr z, .done
jr c, .done jr c, .done
inc b inc b
jr .loop jr .loop

View File

@ -196,9 +196,10 @@ FlashyTransitionToBattle: ; 8c314
StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365) StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
; The screen flashes a different number of ; The screen flashes a different number of times depending on the level of
; times depending on the level of your lead ; your lead Pokemon relative to the opponent's.
; Pokemon relative to the opponent's. ; BUG: BattleMonLevel and EnemyMonLevel are not set at this point, so whatever
; values happen to be there will determine the animation.
ld de, 0 ld de, 0
ld a, [BattleMonLevel] ld a, [BattleMonLevel]
add 3 add 3

View File

@ -554,7 +554,7 @@ GetItemAttr: ; d460
ld a, [CurItem] ld a, [CurItem]
dec a dec a
ld c, a ld c, a
ld a, NUM_ITEMATTRS ld a, ITEMATTR_STRUCT_LENGTH
call AddNTimes call AddNTimes
ld a, BANK(ItemAttributes) ld a, BANK(ItemAttributes)
call GetFarByte call GetFarByte

View File

@ -219,7 +219,7 @@ CheckOwnMon: ; 0x4a7ba
ld hl, PlayerName ld hl, PlayerName
rept 4 rept NAME_LENGTH_JAPANESE +- 2 ; should be PLAYER_NAME_LENGTH +- 2
ld a, [de] ld a, [de]
cp [hl] cp [hl]
jr nz, .notfound jr nz, .notfound
@ -227,7 +227,7 @@ CheckOwnMon: ; 0x4a7ba
jr z, .found ; reached end of string jr z, .found ; reached end of string
inc hl inc hl
inc de inc de
endr endr
ld a, [de] ld a, [de]
cp [hl] cp [hl]

View File

@ -152,9 +152,12 @@ LoadMetatiles:: ; 2198
ld e, l ld e, l
ld d, h ld d, h
; Set hl to the address of the current metatile data ([TilesetBlocksAddress] + (a) tiles). ; Set hl to the address of the current metatile data ([TilesetBlocksAddress] + (a) tiles).
add a ; This is buggy; it wraps around past 128 blocks.
; To fix, uncomment the line below.
add a ; Comment or delete this line to fix the above bug.
ld l, a ld l, a
ld h, 0 ld h, 0
; add hl, hl
add hl, hl add hl, hl
add hl, hl add hl, hl
add hl, hl add hl, hl

File diff suppressed because it is too large Load Diff

View File

@ -1006,7 +1006,7 @@ LoveBallMultiplier:
pop de pop de
cp d cp d
pop bc pop bc
ret nz ; for the intended effect, this should be “ret z” ret nz ; for the intended effect, this should be "ret z"
sla b sla b
jr c, .max jr c, .max
@ -1044,7 +1044,7 @@ FastBallMultiplier:
cp -1 cp -1
jr z, .next jr z, .next
cp c cp c
jr nz, .next ; for the intended effect, this should be “jr nz, .loop” jr nz, .next ; for the intended effect, this should be "jr nz, .loop"
sla b sla b
jr c, .max jr c, .max

View File

@ -236,8 +236,6 @@ CheckNickErrors:: ; 669f
db -1 ; end db -1 ; end
INCLUDE "engine/math.asm" INCLUDE "engine/math.asm"
ItemAttributes: ; 67c1
INCLUDE "items/item_attributes.asm" INCLUDE "items/item_attributes.asm"
INCLUDE "engine/npc_movement.asm" INCLUDE "engine/npc_movement.asm"
INCLUDE "event/happiness_egg.asm" INCLUDE "event/happiness_egg.asm"