Add some constants for options (#344)

Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
This commit is contained in:
Yoann Fievez 2021-11-06 00:45:09 +01:00 committed by GitHub
parent 8349bfd8e6
commit f68af5c6e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 13 deletions

View file

@ -7,3 +7,12 @@ TRUE EQU 1
const FLAG_RESET ; 0
const FLAG_SET ; 1
const FLAG_TEST ; 2
; wOptions
TEXT_DELAY_FAST EQU %001 ; 1
TEXT_DELAY_MEDIUM EQU %011 ; 3
TEXT_DELAY_SLOW EQU %101 ; 5
const_def 6
const BIT_BATTLE_SHIFT ; 6
const BIT_BATTLE_ANIMATION ; 7

View file

@ -395,7 +395,7 @@ MoveAnimation:
.moveAnimation
; check if battle animations are disabled in the options
ld a, [wOptions]
bit 7, a
bit BIT_BATTLE_ANIMATION, a
jr nz, .animationsDisabled
call ShareMoveAnimations
call PlayAnimation

View file

@ -1372,7 +1372,7 @@ EnemySendOutFirstMon:
cp LINK_STATE_BATTLING
jr z, .next4
ld a, [wOptions]
bit 6, a
bit BIT_BATTLE_SHIFT, a
jr nz, .next4
ld hl, TrainerAboutToUseText
call PrintText

View file

@ -45,7 +45,7 @@ SubstituteEffect_:
ld l, c
set HAS_SUBSTITUTE_UP, [hl]
ld a, [wOptions]
bit 7, a ; battle animation is enabled?
bit BIT_BATTLE_ANIMATION, a
ld hl, PlayCurrentMoveAnimation
ld b, BANK(PlayCurrentMoveAnimation)
jr z, .animationEnabled

View file

@ -26,7 +26,7 @@ IF DEF(_DEBUG)
ld de, DebugMenuOptions
call PlaceString
ld a, 3 ; medium speed
ld a, TEXT_DELAY_MEDIUM
ld [wOptions], a
ld a, A_BUTTON | B_BUTTON | START

View file

@ -125,9 +125,9 @@ MainMenu:
jp SpecialEnterMap
InitOptions:
ld a, 1 ; no delay
ld a, TEXT_DELAY_FAST
ld [wLetterPrintingDelayFlags], a
ld a, 3 ; medium speed
ld a, TEXT_DELAY_MEDIUM
ld [wOptions], a
ret
@ -678,11 +678,10 @@ SetCursorPositionsFromOptions:
; 00: X coordinate of menu cursor
; 01: delay after printing a letter (in frames)
TextSpeedOptionData:
db 14, 5 ; Slow
db 7, 3 ; Medium
db 1, 1 ; Fast
db 7 ; default X coordinate (Medium)
db -1 ; end
db 14, TEXT_DELAY_SLOW
db 7, TEXT_DELAY_MEDIUM
db 1, TEXT_DELAY_FAST
db 7, -1 ; end (default X coordinate)
CheckForPlayerNameInSRAM:
; Check if the player name data in SRAM has a string terminator character

View file

@ -33,7 +33,7 @@ RedisplayStartMenu::
call EraseMenuCursor
jr .loop
.checkIfDownPressed
bit 7, a
bit BIT_D_DOWN, a
jr z, .buttonPressed
; if the player pressed tried to go past the bottom item, wrap around to the top
CheckEvent EVENT_GOT_POKEDEX

View file

@ -68,7 +68,7 @@ HandleMenuInput_::
ld [wCurrentMenuItem], a ; wrap to the bottom of the menu
jr .checkOtherKeys
.checkIfDownPressed
bit 7, a
bit BIT_D_DOWN, a
jr z, .checkOtherKeys
.downPressed
ld a, [wCurrentMenuItem]