-
Notifications
You must be signed in to change notification settings - Fork 991
[ARCHIVED] Design Flaws
NOTICE: This document has not been vetted by the maintainers of the project and will be deleted in the future.
These are parts of the code that do not work incorrectly, like bugs and glitches, but that clearly exist just to work around a problem. In other words, with a slightly different design, the code would not need to exist at all. Design flaws may be exceptions to a usual rule, or an inefficient way to do something the standard does 'better'. These usually are subjective improvements.
- _JumpMoveEffect overflows after 128 or more move effects
- Object events and BG events use the same event list
- Three copies of the audio engine exist
- To-do list
This design flaw prevents you from using more than 128 move effects.
Fix: Edit _JumpMoveEffect
in engine/battle/effects.asm:
_JumpMoveEffect:
ldh a, [hWhoseTurn]
and a
ld a, [wPlayerMoveEffect]
jr z, .next1
ld a, [wEnemyMoveEffect]
.next1
dec a
- add a
- ld hl, MoveEffectPointerTable
- ld b, 0
- ld c, a
+ ld bc, MoveEffectPointerTable
+ ld h, 0
+ ld l, a
+ add hl, hl
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
jp hl
The same event list defines both object and BG events, with object events defined at the lower end and BG events defined at the higher end. Due to this, it's impossible to have BG events and object events sharing the same ID.
Fix: Edit DisplayTextID
in home/text_script.asm to check for these IDs in a fashion that uses one list for BG events and another list for object events.
Three identical copies of the audio engine exist (at audio/engine_1.asm, audio/engine_2.asm, and audio/engine_3.asm respectively) and are used in different banks. This is an inefficient way to handle your audio engine code.
Fix: Delete the other two copies and call to just one of them everywhere the other two are used.
- Moves and animations using the same constant (limitation)