mirror of
https://github.com/pret/pokered.git
synced 2024-10-22 22:55:31 +00:00
Identify more flag bits (#464)
This commit is contained in:
parent
21cfdbd458
commit
8f1dcf07e5
53 changed files with 267 additions and 193 deletions
|
@ -15,9 +15,9 @@ Audio1_UpdateMusic::
|
||||||
ld a, [wMuteAudioAndPauseMusic]
|
ld a, [wMuteAudioAndPauseMusic]
|
||||||
and a
|
and a
|
||||||
jr z, .applyAffects
|
jr z, .applyAffects
|
||||||
bit 7, a
|
bit BIT_MUTE_AUDIO, a
|
||||||
jr nz, .nextChannel
|
jr nz, .nextChannel
|
||||||
set 7, a
|
set BIT_MUTE_AUDIO, a
|
||||||
ld [wMuteAudioAndPauseMusic], a
|
ld [wMuteAudioAndPauseMusic], a
|
||||||
xor a ; disable all channels' output
|
xor a ; disable all channels' output
|
||||||
ldh [rNR51], a
|
ldh [rNR51], a
|
||||||
|
@ -197,7 +197,7 @@ Audio1_sound_ret:
|
||||||
.dontDisable
|
.dontDisable
|
||||||
jr .afterDisable
|
jr .afterDisable
|
||||||
.returnFromCall
|
.returnFromCall
|
||||||
res 1, [hl]
|
res BIT_SOUND_CALL, [hl]
|
||||||
ld d, $0
|
ld d, $0
|
||||||
ld a, c
|
ld a, c
|
||||||
add a
|
add a
|
||||||
|
@ -377,8 +377,8 @@ Audio1_toggle_perfect_pitch:
|
||||||
ld hl, wChannelFlags1
|
ld hl, wChannelFlags1
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
xor $1
|
xor 1 << BIT_PERFECT_PITCH
|
||||||
ld [hl], a ; flip bit 0 of wChannelFlags1
|
ld [hl], a
|
||||||
jp Audio1_sound_ret
|
jp Audio1_sound_ret
|
||||||
|
|
||||||
Audio1_vibrato:
|
Audio1_vibrato:
|
||||||
|
|
|
@ -17,9 +17,9 @@ Audio2_UpdateMusic::
|
||||||
ld a, [wMuteAudioAndPauseMusic]
|
ld a, [wMuteAudioAndPauseMusic]
|
||||||
and a
|
and a
|
||||||
jr z, .applyAffects
|
jr z, .applyAffects
|
||||||
bit 7, a
|
bit BIT_MUTE_AUDIO, a
|
||||||
jr nz, .nextChannel
|
jr nz, .nextChannel
|
||||||
set 7, a
|
set BIT_MUTE_AUDIO, a
|
||||||
ld [wMuteAudioAndPauseMusic], a
|
ld [wMuteAudioAndPauseMusic], a
|
||||||
xor a ; disable all channels' output
|
xor a ; disable all channels' output
|
||||||
ldh [rNR51], a
|
ldh [rNR51], a
|
||||||
|
@ -163,8 +163,8 @@ Audio2_PlayNextNote:
|
||||||
ld a, c
|
ld a, c
|
||||||
cp CHAN5
|
cp CHAN5
|
||||||
jr nz, .beginChecks
|
jr nz, .beginChecks
|
||||||
ld a, [wLowHealthAlarm] ; low health alarm enabled?
|
ld a, [wLowHealthAlarm]
|
||||||
bit 7, a
|
bit BIT_LOW_HEALTH_ALARM, a
|
||||||
ret nz
|
ret nz
|
||||||
.beginChecks
|
.beginChecks
|
||||||
; ---
|
; ---
|
||||||
|
@ -208,7 +208,7 @@ Audio2_sound_ret:
|
||||||
.dontDisable
|
.dontDisable
|
||||||
jr .afterDisable
|
jr .afterDisable
|
||||||
.returnFromCall
|
.returnFromCall
|
||||||
res 1, [hl]
|
res BIT_SOUND_CALL, [hl]
|
||||||
ld d, $0
|
ld d, $0
|
||||||
ld a, c
|
ld a, c
|
||||||
add a
|
add a
|
||||||
|
@ -388,8 +388,8 @@ Audio2_toggle_perfect_pitch:
|
||||||
ld hl, wChannelFlags1
|
ld hl, wChannelFlags1
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
xor $1
|
xor 1 << BIT_PERFECT_PITCH
|
||||||
ld [hl], a ; flip bit 0 of wChannelFlags1
|
ld [hl], a
|
||||||
jp Audio2_sound_ret
|
jp Audio2_sound_ret
|
||||||
|
|
||||||
Audio2_vibrato:
|
Audio2_vibrato:
|
||||||
|
@ -978,7 +978,7 @@ Audio2_ResetCryModifiers:
|
||||||
cp CHAN5
|
cp CHAN5
|
||||||
jr nz, .skip
|
jr nz, .skip
|
||||||
ld a, [wLowHealthAlarm]
|
ld a, [wLowHealthAlarm]
|
||||||
bit 7, a
|
bit BIT_LOW_HEALTH_ALARM, a
|
||||||
jr z, .skip
|
jr z, .skip
|
||||||
xor a
|
xor a
|
||||||
ld [wFrequencyModifier], a
|
ld [wFrequencyModifier], a
|
||||||
|
|
|
@ -15,9 +15,9 @@ Audio3_UpdateMusic::
|
||||||
ld a, [wMuteAudioAndPauseMusic]
|
ld a, [wMuteAudioAndPauseMusic]
|
||||||
and a
|
and a
|
||||||
jr z, .applyAffects
|
jr z, .applyAffects
|
||||||
bit 7, a
|
bit BIT_MUTE_AUDIO, a
|
||||||
jr nz, .nextChannel
|
jr nz, .nextChannel
|
||||||
set 7, a
|
set BIT_MUTE_AUDIO, a
|
||||||
ld [wMuteAudioAndPauseMusic], a
|
ld [wMuteAudioAndPauseMusic], a
|
||||||
xor a ; disable all channels' output
|
xor a ; disable all channels' output
|
||||||
ldh [rNR51], a
|
ldh [rNR51], a
|
||||||
|
@ -197,7 +197,7 @@ Audio3_sound_ret:
|
||||||
.dontDisable
|
.dontDisable
|
||||||
jr .afterDisable
|
jr .afterDisable
|
||||||
.returnFromCall
|
.returnFromCall
|
||||||
res 1, [hl]
|
res BIT_SOUND_CALL, [hl]
|
||||||
ld d, $0
|
ld d, $0
|
||||||
ld a, c
|
ld a, c
|
||||||
add a
|
add a
|
||||||
|
@ -377,8 +377,8 @@ Audio3_toggle_perfect_pitch:
|
||||||
ld hl, wChannelFlags1
|
ld hl, wChannelFlags1
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
xor $1
|
xor 1 << BIT_PERFECT_PITCH
|
||||||
ld [hl], a ; flip bit 0 of wChannelFlags1
|
ld [hl], a
|
||||||
jp Audio3_sound_ret
|
jp Audio3_sound_ret
|
||||||
|
|
||||||
Audio3_vibrato:
|
Audio3_vibrato:
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
Music_DoLowHealthAlarm::
|
Music_DoLowHealthAlarm::
|
||||||
ld a, [wLowHealthAlarm]
|
ld a, [wLowHealthAlarm]
|
||||||
cp $ff
|
cp DISABLE_LOW_HEALTH_ALARM
|
||||||
jr z, .disableAlarm
|
jr z, .disableAlarm
|
||||||
|
|
||||||
bit 7, a ;alarm enabled?
|
bit BIT_LOW_HEALTH_ALARM, a
|
||||||
ret z ;nope
|
ret z
|
||||||
|
|
||||||
and $7f ;low 7 bits are the timer.
|
and LOW_HEALTH_TIMER_MASK
|
||||||
jr nz, .notToneHi ;if timer > 0, play low tone.
|
jr nz, .notToneHi ;if timer > 0, play low tone.
|
||||||
|
|
||||||
call .playToneHi
|
call .playToneHi
|
||||||
|
@ -19,15 +19,15 @@ Music_DoLowHealthAlarm::
|
||||||
call .playToneLo ;actually set the sound registers.
|
call .playToneLo ;actually set the sound registers.
|
||||||
|
|
||||||
.noTone
|
.noTone
|
||||||
ld a, $86
|
ld a, CRY_SFX_END
|
||||||
ld [wChannelSoundIDs + CHAN5], a ;disable sound channel?
|
ld [wChannelSoundIDs + CHAN5], a ;disable sound channel?
|
||||||
ld a, [wLowHealthAlarm]
|
ld a, [wLowHealthAlarm]
|
||||||
and $7f ;decrement alarm timer.
|
and LOW_HEALTH_TIMER_MASK
|
||||||
dec a
|
dec a
|
||||||
|
|
||||||
.resetTimer
|
.resetTimer
|
||||||
; reset the timer and enable flag.
|
; reset the timer and enable flag.
|
||||||
set 7, a
|
set BIT_LOW_HEALTH_ALARM, a
|
||||||
ld [wLowHealthAlarm], a
|
ld [wLowHealthAlarm], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
@ -66,3 +66,11 @@ DEF HW_CH4_DISABLE_MASK EQU (~HW_CH4_ENABLE_MASK & $ff)
|
||||||
|
|
||||||
; wChannelFlags2 constant (only has one flag)
|
; wChannelFlags2 constant (only has one flag)
|
||||||
DEF BIT_EXECUTE_MUSIC EQU 0 ; if in execute music
|
DEF BIT_EXECUTE_MUSIC EQU 0 ; if in execute music
|
||||||
|
|
||||||
|
; wMuteAudioAndPauseMusic
|
||||||
|
DEF BIT_MUTE_AUDIO EQU 7
|
||||||
|
|
||||||
|
; wLowHealthAlarm
|
||||||
|
DEF BIT_LOW_HEALTH_ALARM EQU 7
|
||||||
|
DEF LOW_HEALTH_TIMER_MASK EQU %01111111
|
||||||
|
DEF DISABLE_LOW_HEALTH_ALARM EQU $ff
|
||||||
|
|
|
@ -72,6 +72,10 @@ DEF MAX_STAT_VALUE EQU 999
|
||||||
DEF ATKDEFDV_TRAINER EQU $98
|
DEF ATKDEFDV_TRAINER EQU $98
|
||||||
DEF SPDSPCDV_TRAINER EQU $88
|
DEF SPDSPCDV_TRAINER EQU $88
|
||||||
|
|
||||||
|
; wDamageMultipliers
|
||||||
|
DEF BIT_STAB_DAMAGE EQU 7
|
||||||
|
DEF EFFECTIVENESS_MASK EQU %01111111
|
||||||
|
|
||||||
; wPlayerBattleStatus1 or wEnemyBattleStatus1 bit flags
|
; wPlayerBattleStatus1 or wEnemyBattleStatus1 bit flags
|
||||||
const_def
|
const_def
|
||||||
const STORING_ENERGY ; 0 ; Bide
|
const STORING_ENERGY ; 0 ; Bide
|
||||||
|
|
|
@ -29,6 +29,12 @@ DEF TRANSFERBOTTOM EQU 2
|
||||||
DEF REDRAW_COL EQU 1
|
DEF REDRAW_COL EQU 1
|
||||||
DEF REDRAW_ROW EQU 2
|
DEF REDRAW_ROW EQU 2
|
||||||
|
|
||||||
|
; hUILayoutFlags
|
||||||
|
const_def
|
||||||
|
const BIT_PARTY_MENU_HP_BAR ; 0
|
||||||
|
const BIT_DOUBLE_SPACED_MENU ; 1
|
||||||
|
const BIT_SINGLE_SPACED_LINES ; 2
|
||||||
|
|
||||||
; tile list ids
|
; tile list ids
|
||||||
; TileIDListPointerTable indexes (see data/tilemaps.asm)
|
; TileIDListPointerTable indexes (see data/tilemaps.asm)
|
||||||
const_def
|
const_def
|
||||||
|
|
|
@ -40,9 +40,16 @@ DEF SPRITESTATEDATA2_LENGTH EQU const_value
|
||||||
|
|
||||||
DEF NUM_SPRITESTATEDATA_STRUCTS EQU 16
|
DEF NUM_SPRITESTATEDATA_STRUCTS EQU 16
|
||||||
|
|
||||||
|
const_def 6
|
||||||
|
const BIT_TRAINER ; 6
|
||||||
|
const BIT_ITEM ; 7
|
||||||
|
|
||||||
; different kinds of people events
|
; different kinds of people events
|
||||||
DEF ITEM EQU $80
|
DEF TRAINER EQU 1 << BIT_TRAINER
|
||||||
DEF TRAINER EQU $40
|
DEF ITEM EQU 1 << BIT_ITEM
|
||||||
|
|
||||||
|
; movement status
|
||||||
|
DEF BIT_FACE_PLAYER EQU 7
|
||||||
|
|
||||||
DEF WALK EQU $FE
|
DEF WALK EQU $FE
|
||||||
DEF STAY EQU $FF
|
DEF STAY EQU $FF
|
||||||
|
|
|
@ -44,6 +44,9 @@ DEF PC_ITEM_CAPACITY EQU 50
|
||||||
const NO_YES_MENU ; 7
|
const NO_YES_MENU ; 7
|
||||||
DEF NUM_TWO_OPTION_MENUS EQU const_value
|
DEF NUM_TWO_OPTION_MENUS EQU const_value
|
||||||
|
|
||||||
|
; wTwoOptionMenuID
|
||||||
|
DEF BIT_SECOND_MENU_OPTION_DEFAULT EQU 7
|
||||||
|
|
||||||
; menu exit method constants for list menus and the buy/sell/quit menu
|
; menu exit method constants for list menus and the buy/sell/quit menu
|
||||||
DEF CHOSE_MENU_ITEM EQU 1 ; pressed A
|
DEF CHOSE_MENU_ITEM EQU 1 ; pressed A
|
||||||
DEF CANCELLED_MENU EQU 2 ; pressed B
|
DEF CANCELLED_MENU EQU 2 ; pressed B
|
||||||
|
|
|
@ -1,14 +1,20 @@
|
||||||
; OAM flags used by this game
|
; Pseudo-OAM flags used by game logic
|
||||||
DEF OAMFLAG_ENDOFDATA EQU %00000001 ; pseudo OAM flag, only used by game logic
|
const_def
|
||||||
DEF OAMFLAG_CANBEMASKED EQU %00000010 ; pseudo OAM flag, only used by game logic
|
const BIT_END_OF_OAM_DATA ; 0
|
||||||
|
const BIT_SPRITE_UNDER_GRASS ; 1
|
||||||
|
|
||||||
|
; Used in SpriteFacingAndAnimationTable (see data/sprites/facings.asm)
|
||||||
|
DEF FACING_END EQU 1 << BIT_END_OF_OAM_DATA
|
||||||
|
DEF UNDER_GRASS EQU 1 << BIT_SPRITE_UNDER_GRASS
|
||||||
|
|
||||||
; OAM attribute flags
|
; OAM attribute flags
|
||||||
DEF OAM_PALETTE EQU %111
|
DEF OAM_PALETTE EQU %111
|
||||||
DEF OAM_TILE_BANK EQU 3
|
const_def 3
|
||||||
DEF OAM_OBP_NUM EQU 4 ; Non CGB Mode Only
|
const OAM_TILE_BANK ; 3
|
||||||
DEF OAM_X_FLIP EQU 5
|
const OAM_OBP_NUM ; 4 ; Non CGB Mode Only
|
||||||
DEF OAM_Y_FLIP EQU 6
|
const OAM_X_FLIP ; 5
|
||||||
DEF OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
|
const OAM_Y_FLIP ; 6
|
||||||
|
const OAM_PRIORITY ; 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
|
||||||
|
|
||||||
; OAM attribute masks
|
; OAM attribute masks
|
||||||
DEF OAM_OBP1 EQU 1 << OAM_OBP_NUM ; OBJ palette 1
|
DEF OAM_OBP1 EQU 1 << OAM_OBP_NUM ; OBJ palette 1
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
; wSlotMachineFlags
|
||||||
|
const_def 6
|
||||||
|
const BIT_SLOTS_CAN_WIN ; 6
|
||||||
|
const BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR ; 7
|
||||||
|
|
||||||
; wMiscFlags
|
; wMiscFlags
|
||||||
const_def
|
const_def
|
||||||
const BIT_SEEN_BY_TRAINER ; 0
|
const BIT_SEEN_BY_TRAINER ; 0
|
||||||
|
@ -9,6 +14,15 @@
|
||||||
const BIT_TRIED_PUSH_BOULDER ; 6
|
const BIT_TRIED_PUSH_BOULDER ; 6
|
||||||
const BIT_PUSHED_BOULDER ; 7
|
const BIT_PUSHED_BOULDER ; 7
|
||||||
|
|
||||||
|
; wAutoTextBoxDrawingControl
|
||||||
|
DEF BIT_NO_AUTO_TEXT_BOX EQU 0
|
||||||
|
|
||||||
|
; wTextPredefFlag
|
||||||
|
DEF BIT_TEXT_PREDEF EQU 0
|
||||||
|
|
||||||
|
; wFontLoaded
|
||||||
|
DEF BIT_FONT_LOADED EQU 0
|
||||||
|
|
||||||
; wOptions
|
; wOptions
|
||||||
DEF TEXT_DELAY_MASK EQU %111
|
DEF TEXT_DELAY_MASK EQU %111
|
||||||
const_def 6
|
const_def 6
|
||||||
|
@ -24,6 +38,12 @@ DEF TEXT_DELAY_SLOW EQU %101 ; 5
|
||||||
const BIT_FAST_TEXT_DELAY ; 0
|
const BIT_FAST_TEXT_DELAY ; 0
|
||||||
const BIT_TEXT_DELAY ; 1
|
const BIT_TEXT_DELAY ; 1
|
||||||
|
|
||||||
|
; wCurMapTileset
|
||||||
|
DEF BIT_NO_PREVIOUS_MAP EQU 7
|
||||||
|
|
||||||
|
; wCurrentBoxNum
|
||||||
|
DEF BIT_HAS_CHANGED_BOXES EQU 7
|
||||||
|
|
||||||
; wObtainedBadges, wBeatGymFlags
|
; wObtainedBadges, wBeatGymFlags
|
||||||
const_def
|
const_def
|
||||||
const BIT_BOULDERBADGE ; 0
|
const BIT_BOULDERBADGE ; 0
|
||||||
|
@ -117,3 +137,13 @@ DEF NUM_BADGES EQU const_value
|
||||||
const_skip 3 ; 3-5 ; unused
|
const_skip 3 ; 3-5 ; unused
|
||||||
const BIT_LEDGE_OR_FISHING ; 6
|
const BIT_LEDGE_OR_FISHING ; 6
|
||||||
const BIT_SPINNING ; 7
|
const BIT_SPINNING ; 7
|
||||||
|
|
||||||
|
; hFindPathFlags
|
||||||
|
const_def
|
||||||
|
const BIT_PATH_FOUND_Y ; 0
|
||||||
|
const BIT_PATH_FOUND_X ; 1
|
||||||
|
|
||||||
|
; hNPCPlayerRelativePosFlags
|
||||||
|
const_def
|
||||||
|
const BIT_PLAYER_LOWER_Y ; 0
|
||||||
|
const BIT_PLAYER_LOWER_X ; 1
|
||||||
|
|
|
@ -48,12 +48,12 @@ SpriteFacingAndAnimationTable:
|
||||||
; y, x, attributes
|
; y, x, attributes
|
||||||
db 0, 0, $00 ; top left
|
db 0, 0, $00 ; top left
|
||||||
db 0, 8, $00 ; top right
|
db 0, 8, $00 ; top right
|
||||||
db 8, 0, OAMFLAG_CANBEMASKED ; bottom left
|
db 8, 0, UNDER_GRASS ; bottom left
|
||||||
db 8, 8, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
|
db 8, 8, UNDER_GRASS | FACING_END ; bottom right
|
||||||
|
|
||||||
.FlippedOAM:
|
.FlippedOAM:
|
||||||
; y, x, attributes
|
; y, x, attributes
|
||||||
db 0, 8, OAM_HFLIP ; top left
|
db 0, 8, OAM_HFLIP ; top left
|
||||||
db 0, 0, OAM_HFLIP ; top right
|
db 0, 0, OAM_HFLIP ; top right
|
||||||
db 8, 8, OAM_HFLIP | OAMFLAG_CANBEMASKED ; bottom left
|
db 8, 8, OAM_HFLIP | UNDER_GRASS ; bottom left
|
||||||
db 8, 0, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
|
db 8, 0, OAM_HFLIP | UNDER_GRASS | FACING_END ; bottom right
|
||||||
|
|
|
@ -114,13 +114,13 @@ DrawFrameBlock:
|
||||||
ld [de], a ; store tile ID
|
ld [de], a ; store tile ID
|
||||||
inc de
|
inc de
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
bit 5, a ; is horizontal flip enabled?
|
bit OAM_X_FLIP, a
|
||||||
jr nz, .disableHorizontalFlip
|
jr nz, .disableHorizontalFlip
|
||||||
.enableHorizontalFlip
|
.enableHorizontalFlip
|
||||||
set 5, a
|
set OAM_X_FLIP, a
|
||||||
jr .storeFlags2
|
jr .storeFlags2
|
||||||
.disableHorizontalFlip
|
.disableHorizontalFlip
|
||||||
res 5, a
|
res OAM_X_FLIP, a
|
||||||
.storeFlags2
|
.storeFlags2
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
|
|
|
@ -64,6 +64,12 @@ BattleTransition:
|
||||||
ld l, a
|
ld l, a
|
||||||
jp hl
|
jp hl
|
||||||
|
|
||||||
|
const_def
|
||||||
|
const BIT_TRAINER_BATTLE_TRANSITION ; 0
|
||||||
|
const BIT_STRONGER_BATTLE_TRANSITION ; 1
|
||||||
|
const BIT_DUNGEON_BATTLE_TRANSITION ; 2
|
||||||
|
DEF NUM_BATTLE_TRANSITION_BITS EQU const_value
|
||||||
|
|
||||||
; the three GetBattleTransitionID functions set the first
|
; the three GetBattleTransitionID functions set the first
|
||||||
; three bits of c, which determines what transition animation
|
; three bits of c, which determines what transition animation
|
||||||
; to play at the beginning of a battle
|
; to play at the beginning of a battle
|
||||||
|
@ -71,6 +77,7 @@ BattleTransition:
|
||||||
; bit 1: set if enemy is at least 3 levels higher than player
|
; bit 1: set if enemy is at least 3 levels higher than player
|
||||||
; bit 2: set if dungeon map
|
; bit 2: set if dungeon map
|
||||||
BattleTransitions:
|
BattleTransitions:
|
||||||
|
table_width 2, BattleTransitions
|
||||||
dw BattleTransition_DoubleCircle ; %000
|
dw BattleTransition_DoubleCircle ; %000
|
||||||
dw BattleTransition_Spiral ; %001
|
dw BattleTransition_Spiral ; %001
|
||||||
dw BattleTransition_Circle ; %010
|
dw BattleTransition_Circle ; %010
|
||||||
|
@ -79,15 +86,16 @@ BattleTransitions:
|
||||||
dw BattleTransition_Shrink ; %101
|
dw BattleTransition_Shrink ; %101
|
||||||
dw BattleTransition_VerticalStripes ; %110
|
dw BattleTransition_VerticalStripes ; %110
|
||||||
dw BattleTransition_Split ; %111
|
dw BattleTransition_Split ; %111
|
||||||
|
assert_table_length 1 << NUM_BATTLE_TRANSITION_BITS
|
||||||
|
|
||||||
GetBattleTransitionID_WildOrTrainer:
|
GetBattleTransitionID_WildOrTrainer:
|
||||||
ld a, [wCurOpponent]
|
ld a, [wCurOpponent]
|
||||||
cp OPP_ID_OFFSET
|
cp OPP_ID_OFFSET
|
||||||
jr nc, .trainer
|
jr nc, .trainer
|
||||||
res 0, c
|
res BIT_TRAINER_BATTLE_TRANSITION, c
|
||||||
ret
|
ret
|
||||||
.trainer
|
.trainer
|
||||||
set 0, c
|
set BIT_TRAINER_BATTLE_TRANSITION, c
|
||||||
ret
|
ret
|
||||||
|
|
||||||
GetBattleTransitionID_CompareLevels:
|
GetBattleTransitionID_CompareLevels:
|
||||||
|
@ -108,12 +116,12 @@ GetBattleTransitionID_CompareLevels:
|
||||||
ld a, [wCurEnemyLevel]
|
ld a, [wCurEnemyLevel]
|
||||||
sub e
|
sub e
|
||||||
jr nc, .highLevelEnemy
|
jr nc, .highLevelEnemy
|
||||||
res 1, c
|
res BIT_STRONGER_BATTLE_TRANSITION, c
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ld [wBattleTransitionSpiralDirection], a
|
ld [wBattleTransitionSpiralDirection], a
|
||||||
ret
|
ret
|
||||||
.highLevelEnemy
|
.highLevelEnemy
|
||||||
set 1, c
|
set BIT_STRONGER_BATTLE_TRANSITION, c
|
||||||
xor a
|
xor a
|
||||||
ld [wBattleTransitionSpiralDirection], a
|
ld [wBattleTransitionSpiralDirection], a
|
||||||
ret
|
ret
|
||||||
|
@ -129,7 +137,7 @@ GetBattleTransitionID_IsDungeonMap:
|
||||||
cp e
|
cp e
|
||||||
jr nz, .loop1
|
jr nz, .loop1
|
||||||
.match
|
.match
|
||||||
set 2, c
|
set BIT_DUNGEON_BATTLE_TRANSITION, c
|
||||||
ret
|
ret
|
||||||
.noMatch1
|
.noMatch1
|
||||||
ld hl, DungeonMaps2
|
ld hl, DungeonMaps2
|
||||||
|
@ -145,7 +153,7 @@ GetBattleTransitionID_IsDungeonMap:
|
||||||
cp d
|
cp d
|
||||||
jr nc, .match
|
jr nc, .match
|
||||||
.noMatch2
|
.noMatch2
|
||||||
res 2, c
|
res BIT_DUNGEON_BATTLE_TRANSITION, c
|
||||||
ret
|
ret
|
||||||
|
|
||||||
INCLUDE "data/maps/dungeon_maps.asm"
|
INCLUDE "data/maps/dungeon_maps.asm"
|
||||||
|
|
|
@ -1007,12 +1007,12 @@ RemoveFaintedPlayerMon:
|
||||||
ld b, FLAG_RESET
|
ld b, FLAG_RESET
|
||||||
predef FlagActionPredef ; clear gain exp flag for fainted mon
|
predef FlagActionPredef ; clear gain exp flag for fainted mon
|
||||||
ld hl, wEnemyBattleStatus1
|
ld hl, wEnemyBattleStatus1
|
||||||
res 2, [hl] ; reset "attacking multiple times" flag
|
res ATTACKING_MULTIPLE_TIMES, [hl]
|
||||||
ld a, [wLowHealthAlarm]
|
ld a, [wLowHealthAlarm]
|
||||||
bit 7, a ; skip sound flag (red bar (?))
|
bit BIT_LOW_HEALTH_ALARM, a
|
||||||
jr z, .skipWaitForSound
|
jr z, .skipWaitForSound
|
||||||
ld a, $ff
|
ld a, DISABLE_LOW_HEALTH_ALARM
|
||||||
ld [wLowHealthAlarm], a ;disable low health alarm
|
ld [wLowHealthAlarm], a
|
||||||
call WaitForSoundToFinish
|
call WaitForSoundToFinish
|
||||||
.skipWaitForSound
|
.skipWaitForSound
|
||||||
; a is 0, so this zeroes the enemy's accumulated damage.
|
; a is 0, so this zeroes the enemy's accumulated damage.
|
||||||
|
@ -1305,7 +1305,7 @@ EnemySendOutFirstMon:
|
||||||
dec a
|
dec a
|
||||||
ld [wAICount], a
|
ld [wAICount], a
|
||||||
ld hl, wPlayerBattleStatus1
|
ld hl, wPlayerBattleStatus1
|
||||||
res 5, [hl]
|
res USING_TRAPPING_MOVE, [hl]
|
||||||
hlcoord 18, 0
|
hlcoord 18, 0
|
||||||
ld a, 8
|
ld a, 8
|
||||||
call SlideTrainerPicOffScreen
|
call SlideTrainerPicOffScreen
|
||||||
|
@ -1860,15 +1860,15 @@ DrawPlayerHUDAndHPBar:
|
||||||
jr z, .setLowHealthAlarm
|
jr z, .setLowHealthAlarm
|
||||||
.fainted
|
.fainted
|
||||||
ld hl, wLowHealthAlarm
|
ld hl, wLowHealthAlarm
|
||||||
bit 7, [hl] ;low health alarm enabled?
|
bit BIT_LOW_HEALTH_ALARM, [hl]
|
||||||
ld [hl], $0
|
ld [hl], 0
|
||||||
ret z
|
ret z
|
||||||
xor a
|
xor a
|
||||||
ld [wChannelSoundIDs + CHAN5], a
|
ld [wChannelSoundIDs + CHAN5], a
|
||||||
ret
|
ret
|
||||||
.setLowHealthAlarm
|
.setLowHealthAlarm
|
||||||
ld hl, wLowHealthAlarm
|
ld hl, wLowHealthAlarm
|
||||||
set 7, [hl] ;enable low health alarm
|
set BIT_LOW_HEALTH_ALARM, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
DrawEnemyHUDAndHPBar:
|
DrawEnemyHUDAndHPBar:
|
||||||
|
@ -2121,7 +2121,7 @@ DisplayBattleMenu::
|
||||||
ld a, D_LEFT | A_BUTTON
|
ld a, D_LEFT | A_BUTTON
|
||||||
ld [hli], a ; wMenuWatchedKeys
|
ld [hli], a ; wMenuWatchedKeys
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
bit 5, a ; check if left was pressed
|
bit BIT_D_LEFT, a
|
||||||
jr nz, .leftColumn ; if left was pressed, jump
|
jr nz, .leftColumn ; if left was pressed, jump
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
add $2 ; if we're in the right column, the actual id is +2
|
add $2 ; if we're in the right column, the actual id is +2
|
||||||
|
@ -2473,11 +2473,11 @@ MoveSelectionMenu:
|
||||||
.writemoves
|
.writemoves
|
||||||
ld de, wMovesString
|
ld de, wMovesString
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
set 2, a
|
set BIT_SINGLE_SPACED_LINES, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
res 2, a
|
res BIT_SINGLE_SPACED_LINES, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -2604,10 +2604,10 @@ SelectMenuItem:
|
||||||
ld [hl], "▷"
|
ld [hl], "▷"
|
||||||
.select
|
.select
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
set 1, [hl]
|
set BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
res 1, [hl]
|
res BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
bit BIT_D_UP, a
|
bit BIT_D_UP, a
|
||||||
jp nz, SelectMenuItem_CursorUp
|
jp nz, SelectMenuItem_CursorUp
|
||||||
bit BIT_D_DOWN, a
|
bit BIT_D_DOWN, a
|
||||||
|
@ -2652,7 +2652,7 @@ SelectMenuItem:
|
||||||
cp c
|
cp c
|
||||||
jr z, .disabled
|
jr z, .disabled
|
||||||
ld a, [wPlayerBattleStatus3]
|
ld a, [wPlayerBattleStatus3]
|
||||||
bit 3, a ; transformed
|
bit TRANSFORMED, a
|
||||||
jr nz, .transformedMoveSelected
|
jr nz, .transformedMoveSelected
|
||||||
.transformedMoveSelected ; pointless
|
.transformedMoveSelected ; pointless
|
||||||
; Allow moves copied by Transform to be used.
|
; Allow moves copied by Transform to be used.
|
||||||
|
@ -3850,7 +3850,7 @@ PrintMoveFailureText:
|
||||||
.playersTurn
|
.playersTurn
|
||||||
ld hl, DoesntAffectMonText
|
ld hl, DoesntAffectMonText
|
||||||
ld a, [wDamageMultipliers]
|
ld a, [wDamageMultipliers]
|
||||||
and $7f
|
and EFFECTIVENESS_MASK
|
||||||
jr z, .gotTextToPrint
|
jr z, .gotTextToPrint
|
||||||
ld hl, AttackMissedText
|
ld hl, AttackMissedText
|
||||||
ld a, [wCriticalHitOrOHKO]
|
ld a, [wCriticalHitOrOHKO]
|
||||||
|
@ -5248,7 +5248,7 @@ AdjustDamageForMoveType:
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wDamage + 1], a
|
ld [wDamage + 1], a
|
||||||
ld hl, wDamageMultipliers
|
ld hl, wDamageMultipliers
|
||||||
set 7, [hl]
|
set BIT_STAB_DAMAGE, [hl]
|
||||||
.skipSameTypeAttackBonus
|
.skipSameTypeAttackBonus
|
||||||
ld a, [wMoveType]
|
ld a, [wMoveType]
|
||||||
ld b, a
|
ld b, a
|
||||||
|
@ -5271,7 +5271,7 @@ AdjustDamageForMoveType:
|
||||||
push bc
|
push bc
|
||||||
inc hl
|
inc hl
|
||||||
ld a, [wDamageMultipliers]
|
ld a, [wDamageMultipliers]
|
||||||
and $80
|
and 1 << BIT_STAB_DAMAGE
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [hl] ; a = damage multiplier
|
ld a, [hl] ; a = damage multiplier
|
||||||
ldh [hMultiplier], a
|
ldh [hMultiplier], a
|
||||||
|
|
|
@ -194,7 +194,7 @@ ExplodeEffect:
|
||||||
FreezeBurnParalyzeEffect:
|
FreezeBurnParalyzeEffect:
|
||||||
xor a
|
xor a
|
||||||
ld [wAnimationType], a
|
ld [wAnimationType], a
|
||||||
call CheckTargetSubstitute ; test bit 4 of d063/d068 flags [target has substitute flag]
|
call CheckTargetSubstitute
|
||||||
ret nz ; return if they have a substitute, can't effect them
|
ret nz ; return if they have a substitute, can't effect them
|
||||||
ldh a, [hWhoseTurn]
|
ldh a, [hWhoseTurn]
|
||||||
and a
|
and a
|
||||||
|
|
|
@ -224,7 +224,7 @@ GainExperience:
|
||||||
call CopyData
|
call CopyData
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [wPlayerBattleStatus3]
|
ld a, [wPlayerBattleStatus3]
|
||||||
bit 3, a ; is the mon transformed?
|
bit TRANSFORMED, a
|
||||||
jr nz, .recalcStatChanges
|
jr nz, .recalcStatChanges
|
||||||
; the mon is not transformed, so update the unmodified stats
|
; the mon is not transformed, so update the unmodified stats
|
||||||
ld de, wPlayerMonUnmodifiedLevel
|
ld de, wPlayerMonUnmodifiedLevel
|
||||||
|
|
|
@ -632,27 +632,27 @@ AICureStatus:
|
||||||
ld [hl], a ; clear status in enemy team roster
|
ld [hl], a ; clear status in enemy team roster
|
||||||
ld [wEnemyMonStatus], a ; clear status of active enemy
|
ld [wEnemyMonStatus], a ; clear status of active enemy
|
||||||
ld hl, wEnemyBattleStatus3
|
ld hl, wEnemyBattleStatus3
|
||||||
res 0, [hl]
|
res BADLY_POISONED, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
AIUseXAccuracy: ; unused
|
AIUseXAccuracy: ; unused
|
||||||
call AIPlayRestoringSFX
|
call AIPlayRestoringSFX
|
||||||
ld hl, wEnemyBattleStatus2
|
ld hl, wEnemyBattleStatus2
|
||||||
set 0, [hl]
|
set USING_X_ACCURACY, [hl]
|
||||||
ld a, X_ACCURACY
|
ld a, X_ACCURACY
|
||||||
jp AIPrintItemUse
|
jp AIPrintItemUse
|
||||||
|
|
||||||
AIUseGuardSpec:
|
AIUseGuardSpec:
|
||||||
call AIPlayRestoringSFX
|
call AIPlayRestoringSFX
|
||||||
ld hl, wEnemyBattleStatus2
|
ld hl, wEnemyBattleStatus2
|
||||||
set 1, [hl]
|
set PROTECTED_BY_MIST, [hl]
|
||||||
ld a, GUARD_SPEC
|
ld a, GUARD_SPEC
|
||||||
jp AIPrintItemUse
|
jp AIPrintItemUse
|
||||||
|
|
||||||
AIUseDireHit: ; unused
|
AIUseDireHit: ; unused
|
||||||
call AIPlayRestoringSFX
|
call AIPlayRestoringSFX
|
||||||
ld hl, wEnemyBattleStatus2
|
ld hl, wEnemyBattleStatus2
|
||||||
set 2, [hl]
|
set GETTING_PUMPED, [hl]
|
||||||
ld a, DIRE_HIT
|
ld a, DIRE_HIT
|
||||||
jp AIPrintItemUse
|
jp AIPrintItemUse
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ OpenPokemonCenterPC:
|
||||||
cp SPRITE_FACING_UP
|
cp SPRITE_FACING_UP
|
||||||
ret nz
|
ret nz
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
ld a, TRUE
|
ld a, 1 << BIT_NO_AUTO_TEXT_BOX
|
||||||
ld [wAutoTextBoxDrawingControl], a
|
ld [wAutoTextBoxDrawingControl], a
|
||||||
tx_pre_jump PokemonCenterPCText
|
tx_pre_jump PokemonCenterPCText
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
ApplyOutOfBattlePoisonDamage:
|
ApplyOutOfBattlePoisonDamage:
|
||||||
ld a, [wStatusFlags5]
|
ld a, [wStatusFlags5]
|
||||||
assert BIT_SCRIPTED_MOVEMENT_STATE == 7
|
assert BIT_SCRIPTED_MOVEMENT_STATE == 7
|
||||||
add a ; overflows bit 7 into carry flag
|
add a ; overflows scripted movement state bit into carry flag
|
||||||
jp c, .noBlackOut ; no black out if joypad states are being simulated
|
jp c, .noBlackOut ; no black out if joypad states are being simulated
|
||||||
ld a, [wPartyCount]
|
ld a, [wPartyCount]
|
||||||
and a
|
and a
|
||||||
|
|
|
@ -214,7 +214,7 @@ UpdateHPBar_PrintHPNumber:
|
||||||
ld [wHPBarTempHP], a
|
ld [wHPBarTempHP], a
|
||||||
push hl
|
push hl
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
bit 0, a
|
bit BIT_PARTY_MENU_HP_BAR, a
|
||||||
jr z, .hpBelowBar
|
jr z, .hpBelowBar
|
||||||
ld de, $9
|
ld de, $9
|
||||||
jr .next
|
jr .next
|
||||||
|
|
|
@ -124,7 +124,7 @@ PrepareOAMData::
|
||||||
inc hl
|
inc hl
|
||||||
inc e
|
inc e
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
bit 1, a ; is the tile allowed to set the sprite priority bit?
|
bit BIT_SPRITE_UNDER_GRASS, a
|
||||||
jr z, .skipPriority
|
jr z, .skipPriority
|
||||||
ldh a, [hSpritePriority]
|
ldh a, [hSpritePriority]
|
||||||
or [hl]
|
or [hl]
|
||||||
|
@ -132,7 +132,7 @@ PrepareOAMData::
|
||||||
inc hl
|
inc hl
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc e
|
inc e
|
||||||
bit 0, a ; OAMFLAG_ENDOFDATA
|
bit BIT_END_OF_OAM_DATA, a
|
||||||
jr z, .tileLoop
|
jr z, .tileLoop
|
||||||
|
|
||||||
ld a, e
|
ld a, e
|
||||||
|
|
|
@ -691,7 +691,7 @@ ItemUseSurfboard:
|
||||||
ldh [hSpriteIndex], a
|
ldh [hSpriteIndex], a
|
||||||
ld d, 16 ; talking range in pixels (normal range)
|
ld d, 16 ; talking range in pixels (normal range)
|
||||||
call IsSpriteInFrontOfPlayer2
|
call IsSpriteInFrontOfPlayer2
|
||||||
res 7, [hl]
|
res BIT_FACE_PLAYER, [hl]
|
||||||
ldh a, [hSpriteIndex]
|
ldh a, [hSpriteIndex]
|
||||||
and a ; is there a sprite in the way?
|
and a ; is there a sprite in the way?
|
||||||
jr nz, .cannotStopSurfing
|
jr nz, .cannotStopSurfing
|
||||||
|
@ -1052,13 +1052,13 @@ ItemUseMedicine:
|
||||||
ld a, SFX_HEAL_HP
|
ld a, SFX_HEAL_HP
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
set 0, a
|
set BIT_PARTY_MENU_HP_BAR, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
ld a, $02
|
ld a, $02
|
||||||
ld [wHPBarType], a
|
ld [wHPBarType], a
|
||||||
predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled
|
predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
res 0, a
|
res BIT_PARTY_MENU_HP_BAR, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
pop af
|
pop af
|
||||||
ld b, a ; store heal amount (1/5 of max HP)
|
ld b, a ; store heal amount (1/5 of max HP)
|
||||||
|
@ -1202,13 +1202,13 @@ ItemUseMedicine:
|
||||||
ld a, SFX_HEAL_HP
|
ld a, SFX_HEAL_HP
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
set 0, a
|
set BIT_PARTY_MENU_HP_BAR, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
ld a, $02
|
ld a, $02
|
||||||
ld [wHPBarType], a
|
ld [wHPBarType], a
|
||||||
predef UpdateHPBar2 ; animate the HP bar lengthening
|
predef UpdateHPBar2 ; animate the HP bar lengthening
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
res 0, a
|
res BIT_PARTY_MENU_HP_BAR, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
ld a, REVIVE_MSG
|
ld a, REVIVE_MSG
|
||||||
ld [wPartyMenuTypeOrMessageID], a
|
ld [wPartyMenuTypeOrMessageID], a
|
||||||
|
|
|
@ -75,9 +75,9 @@ DisplayTownMap:
|
||||||
jr z, .inputLoop
|
jr z, .inputLoop
|
||||||
ld a, SFX_TINK
|
ld a, SFX_TINK
|
||||||
call PlaySound
|
call PlaySound
|
||||||
bit 6, b
|
bit BIT_D_UP, b
|
||||||
jr nz, .pressedUp
|
jr nz, .pressedUp
|
||||||
bit 7, b
|
bit BIT_D_DOWN, b
|
||||||
jr nz, .pressedDown
|
jr nz, .pressedDown
|
||||||
xor a
|
xor a
|
||||||
ld [wTownMapSpriteBlinkingEnabled], a
|
ld [wTownMapSpriteBlinkingEnabled], a
|
||||||
|
@ -196,13 +196,13 @@ LoadTownMap_Fly::
|
||||||
pop hl
|
pop hl
|
||||||
and A_BUTTON | B_BUTTON | D_UP | D_DOWN
|
and A_BUTTON | B_BUTTON | D_UP | D_DOWN
|
||||||
jr z, .inputLoop
|
jr z, .inputLoop
|
||||||
bit 0, b
|
bit BIT_A_BUTTON, b
|
||||||
jr nz, .pressedA
|
jr nz, .pressedA
|
||||||
ld a, SFX_TINK
|
ld a, SFX_TINK
|
||||||
call PlaySound
|
call PlaySound
|
||||||
bit 6, b
|
bit BIT_D_UP, b
|
||||||
jr nz, .pressedUp
|
jr nz, .pressedUp
|
||||||
bit 7, b
|
bit BIT_D_DOWN, b
|
||||||
jr nz, .pressedDown
|
jr nz, .pressedDown
|
||||||
jr .pressedB
|
jr .pressedB
|
||||||
.pressedA
|
.pressedA
|
||||||
|
|
|
@ -282,7 +282,7 @@ CableClub_DoBattleOrTradeAgain:
|
||||||
call ClearScreen
|
call ClearScreen
|
||||||
call Delay3
|
call Delay3
|
||||||
ld hl, wOptions
|
ld hl, wOptions
|
||||||
res 7, [hl]
|
res BIT_BATTLE_ANIMATION, [hl]
|
||||||
predef InitOpponent
|
predef InitOpponent
|
||||||
predef HealParty
|
predef HealParty
|
||||||
jp ReturnToCableClubRoom
|
jp ReturnToCableClubRoom
|
||||||
|
@ -342,10 +342,10 @@ TradeCenter_SelectMon:
|
||||||
ld [wTopMenuItemX], a
|
ld [wTopMenuItemX], a
|
||||||
.enemyMonMenu_HandleInput
|
.enemyMonMenu_HandleInput
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
set 1, [hl]
|
set BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
res 1, [hl]
|
res BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
and a
|
and a
|
||||||
jp z, .getNewInput
|
jp z, .getNewInput
|
||||||
bit BIT_A_BUTTON, a
|
bit BIT_A_BUTTON, a
|
||||||
|
@ -407,10 +407,10 @@ TradeCenter_SelectMon:
|
||||||
call ClearScreenArea
|
call ClearScreenArea
|
||||||
.playerMonMenu_HandleInput
|
.playerMonMenu_HandleInput
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
set 1, [hl]
|
set BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
res 1, [hl]
|
res BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
and a ; was anything pressed?
|
and a ; was anything pressed?
|
||||||
jr nz, .playerMonMenu_SomethingPressed
|
jr nz, .playerMonMenu_SomethingPressed
|
||||||
jp .getNewInput
|
jp .getNewInput
|
||||||
|
@ -489,7 +489,7 @@ TradeCenter_SelectMon:
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ld [wTopMenuItemX], a
|
ld [wTopMenuItemX], a
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
bit 4, a ; Right pressed?
|
bit BIT_D_RIGHT, a
|
||||||
jr nz, .selectTradeMenuItem
|
jr nz, .selectTradeMenuItem
|
||||||
bit BIT_B_BUTTON, a
|
bit BIT_B_BUTTON, a
|
||||||
jr z, .displayPlayerMonStats
|
jr z, .displayPlayerMonStats
|
||||||
|
@ -585,7 +585,7 @@ ReturnToCableClubRoom:
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
push hl
|
push hl
|
||||||
res 0, [hl]
|
res BIT_FONT_LOADED, [hl]
|
||||||
xor a
|
xor a
|
||||||
ld [wStatusFlags3], a ; clears BIT_INIT_TRADE_CENTER_FACING
|
ld [wStatusFlags3], a ; clears BIT_INIT_TRADE_CENTER_FACING
|
||||||
dec a
|
dec a
|
||||||
|
|
|
@ -3,7 +3,7 @@ DisplayTextIDInit::
|
||||||
xor a
|
xor a
|
||||||
ld [wListMenuID], a
|
ld [wListMenuID], a
|
||||||
ld a, [wAutoTextBoxDrawingControl]
|
ld a, [wAutoTextBoxDrawingControl]
|
||||||
bit 0, a
|
bit BIT_NO_AUTO_TEXT_BOX, a
|
||||||
jr nz, .skipDrawingTextBoxBorder
|
jr nz, .skipDrawingTextBoxBorder
|
||||||
ldh a, [hTextID]
|
ldh a, [hTextID]
|
||||||
and a
|
and a
|
||||||
|
@ -31,7 +31,7 @@ DisplayTextIDInit::
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
.skipDrawingTextBoxBorder
|
.skipDrawingTextBoxBorder
|
||||||
ld hl, wFontLoaded
|
ld hl, wFontLoaded
|
||||||
set 0, [hl]
|
set BIT_FONT_LOADED, [hl]
|
||||||
ld hl, wMiscFlags
|
ld hl, wMiscFlags
|
||||||
bit BIT_NO_SPRITE_UPDATES, [hl]
|
bit BIT_NO_SPRITE_UPDATES, [hl]
|
||||||
res BIT_NO_SPRITE_UPDATES, [hl]
|
res BIT_NO_SPRITE_UPDATES, [hl]
|
||||||
|
|
|
@ -44,7 +44,7 @@ PKMNLeaguePC:
|
||||||
pop af
|
pop af
|
||||||
ld [wUpdateSpritesEnabled], a
|
ld [wUpdateSpritesEnabled], a
|
||||||
pop hl
|
pop hl
|
||||||
res 6, [hl]
|
res BIT_NO_TEXT_DELAY, [hl]
|
||||||
call GBPalWhiteOutWithDelay3
|
call GBPalWhiteOutWithDelay3
|
||||||
call ClearScreen
|
call ClearScreen
|
||||||
call RunDefaultPaletteCommand
|
call RunDefaultPaletteCommand
|
||||||
|
@ -57,7 +57,7 @@ LeaguePCShowTeam:
|
||||||
call LeaguePCShowMon
|
call LeaguePCShowMon
|
||||||
call WaitForTextScrollButtonPress
|
call WaitForTextScrollButtonPress
|
||||||
ldh a, [hJoyHeld]
|
ldh a, [hJoyHeld]
|
||||||
bit 1, a
|
bit BIT_B_BUTTON, a
|
||||||
jr nz, .exit
|
jr nz, .exit
|
||||||
ld hl, wHallOfFame + HOF_MON
|
ld hl, wHallOfFame + HOF_MON
|
||||||
ld de, wHallOfFame
|
ld de, wHallOfFame
|
||||||
|
|
|
@ -70,12 +70,12 @@ RedrawPartyMenu_::
|
||||||
push hl
|
push hl
|
||||||
ld bc, SCREEN_WIDTH + 1 ; down 1 row and right 1 column
|
ld bc, SCREEN_WIDTH + 1 ; down 1 row and right 1 column
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
set 0, a
|
set BIT_PARTY_MENU_HP_BAR, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
add hl, bc
|
add hl, bc
|
||||||
predef DrawHP2 ; draw HP bar and prints current / max HP
|
predef DrawHP2 ; draw HP bar and prints current / max HP
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
res 0, a
|
res BIT_PARTY_MENU_HP_BAR, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
call SetPartyMenuHPBarColor ; color the HP bar (on SGB)
|
call SetPartyMenuHPBarColor ; color the HP bar (on SGB)
|
||||||
pop hl
|
pop hl
|
||||||
|
|
|
@ -50,7 +50,7 @@ PlayerPCMenu:
|
||||||
ld hl, WhatDoYouWantText
|
ld hl, WhatDoYouWantText
|
||||||
call PrintText
|
call PrintText
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
bit 1, a
|
bit BIT_B_BUTTON, a
|
||||||
jp nz, ExitPlayerPC
|
jp nz, ExitPlayerPC
|
||||||
call PlaceUnfilledArrowMenuCursor
|
call PlaceUnfilledArrowMenuCursor
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
|
|
|
@ -66,7 +66,7 @@ LoadSAV0:
|
||||||
ld bc, wMainDataEnd - wMainDataStart
|
ld bc, wMainDataEnd - wMainDataStart
|
||||||
call CopyData
|
call CopyData
|
||||||
ld hl, wCurMapTileset
|
ld hl, wCurMapTileset
|
||||||
set 7, [hl]
|
set BIT_NO_PREVIOUS_MAP, [hl]
|
||||||
ld hl, sSpriteData
|
ld hl, sSpriteData
|
||||||
ld de, wSpriteDataStart
|
ld de, wSpriteDataStart
|
||||||
ld bc, wSpriteDataEnd - wSpriteDataStart
|
ld bc, wSpriteDataEnd - wSpriteDataStart
|
||||||
|
@ -349,15 +349,15 @@ ChangeBox::
|
||||||
and a
|
and a
|
||||||
ret nz ; return if No was chosen
|
ret nz ; return if No was chosen
|
||||||
ld hl, wCurrentBoxNum
|
ld hl, wCurrentBoxNum
|
||||||
bit 7, [hl] ; is it the first time player is changing the box?
|
bit BIT_HAS_CHANGED_BOXES, [hl] ; is it the first time player is changing the box?
|
||||||
call z, EmptyAllSRAMBoxes ; if so, empty all boxes in SRAM
|
call z, EmptyAllSRAMBoxes ; if so, empty all boxes in SRAM
|
||||||
call DisplayChangeBoxMenu
|
call DisplayChangeBoxMenu
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
set 1, [hl]
|
set BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
res 1, [hl]
|
res BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
bit BIT_B_BUTTON, a
|
bit BIT_B_BUTTON, a
|
||||||
ret nz
|
ret nz
|
||||||
call GetBoxSRAMLocation
|
call GetBoxSRAMLocation
|
||||||
|
@ -366,7 +366,7 @@ ChangeBox::
|
||||||
ld hl, wBoxDataStart
|
ld hl, wBoxDataStart
|
||||||
call CopyBoxToOrFromSRAM ; copy old box from WRAM to SRAM
|
call CopyBoxToOrFromSRAM ; copy old box from WRAM to SRAM
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
set 7, a
|
set BIT_HAS_CHANGED_BOXES, a
|
||||||
ld [wCurrentBoxNum], a
|
ld [wCurrentBoxNum], a
|
||||||
call GetBoxSRAMLocation
|
call GetBoxSRAMLocation
|
||||||
ld de, wBoxDataStart
|
ld de, wBoxDataStart
|
||||||
|
@ -448,12 +448,12 @@ DisplayChangeBoxMenu:
|
||||||
ld c, 7
|
ld c, 7
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
set 2, [hl]
|
set BIT_SINGLE_SPACED_LINES, [hl]
|
||||||
ld de, BoxNames
|
ld de, BoxNames
|
||||||
hlcoord 13, 1
|
hlcoord 13, 1
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
res 2, [hl]
|
res BIT_SINGLE_SPACED_LINES, [hl]
|
||||||
ld a, [wCurrentBoxNum]
|
ld a, [wCurrentBoxNum]
|
||||||
and $7f
|
and $7f
|
||||||
cp 9
|
cp 9
|
||||||
|
|
|
@ -227,8 +227,8 @@ DisplayTwoOptionMenu:
|
||||||
ld [wMenuWatchMovingOutOfBounds], a
|
ld [wMenuWatchMovingOutOfBounds], a
|
||||||
push hl
|
push hl
|
||||||
ld hl, wTwoOptionMenuID
|
ld hl, wTwoOptionMenuID
|
||||||
bit 7, [hl] ; select second menu item by default?
|
bit BIT_SECOND_MENU_OPTION_DEFAULT, [hl]
|
||||||
res 7, [hl]
|
res BIT_SECOND_MENU_OPTION_DEFAULT, [hl]
|
||||||
jr z, .storeCurrentMenuItem
|
jr z, .storeCurrentMenuItem
|
||||||
inc a
|
inc a
|
||||||
.storeCurrentMenuItem
|
.storeCurrentMenuItem
|
||||||
|
|
|
@ -162,7 +162,7 @@ LoadMapSpriteTilePatterns:
|
||||||
pop de
|
pop de
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wFontLoaded]
|
ld a, [wFontLoaded]
|
||||||
bit 0, a ; reloading upper half of tile patterns after displaying text?
|
bit BIT_FONT_LOADED, a ; reloading upper half of tile patterns after displaying text?
|
||||||
jr nz, .skipFirstLoad ; if so, skip loading data into the lower half
|
jr nz, .skipFirstLoad ; if so, skip loading data into the lower half
|
||||||
ld a, b
|
ld a, b
|
||||||
ld b, 0
|
ld b, 0
|
||||||
|
@ -183,7 +183,7 @@ LoadMapSpriteTilePatterns:
|
||||||
inc d
|
inc d
|
||||||
.noCarry3
|
.noCarry3
|
||||||
ld a, [wFontLoaded]
|
ld a, [wFontLoaded]
|
||||||
bit 0, a ; reloading upper half of tile patterns after displaying text?
|
bit BIT_FONT_LOADED, a ; reloading upper half of tile patterns after displaying text?
|
||||||
jr nz, .loadWhileLCDOn
|
jr nz, .loadWhileLCDOn
|
||||||
pop af
|
pop af
|
||||||
pop hl
|
pop hl
|
||||||
|
@ -268,7 +268,7 @@ InitOutsideMapSprites:
|
||||||
call nc, GetSplitMapSpriteSetID ; if so, choose the appropriate one
|
call nc, GetSplitMapSpriteSetID ; if so, choose the appropriate one
|
||||||
ld b, a ; b = spriteSetID
|
ld b, a ; b = spriteSetID
|
||||||
ld a, [wFontLoaded]
|
ld a, [wFontLoaded]
|
||||||
bit 0, a ; reloading upper half of tile patterns after displaying text?
|
bit BIT_FONT_LOADED, a ; reloading upper half of tile patterns after displaying text?
|
||||||
jr nz, .loadSpriteSet ; if so, forcibly reload the sprite set
|
jr nz, .loadSpriteSet ; if so, forcibly reload the sprite set
|
||||||
ld a, [wSpriteSetID]
|
ld a, [wSpriteSetID]
|
||||||
cp b ; has the sprite set ID changed?
|
cp b ; has the sprite set ID changed?
|
||||||
|
|
|
@ -57,7 +57,7 @@ UpdatePlayerSprite:
|
||||||
.next
|
.next
|
||||||
ld [wSpritePlayerStateData1FacingDirection], a
|
ld [wSpritePlayerStateData1FacingDirection], a
|
||||||
ld a, [wFontLoaded]
|
ld a, [wFontLoaded]
|
||||||
bit 0, a
|
bit BIT_FONT_LOADED, a
|
||||||
jr nz, .notMoving
|
jr nz, .notMoving
|
||||||
.moving
|
.moving
|
||||||
ld a, [wMovementFlags]
|
ld a, [wMovementFlags]
|
||||||
|
@ -135,11 +135,11 @@ UpdateNPCSprite:
|
||||||
ld l, a
|
ld l, a
|
||||||
inc l
|
inc l
|
||||||
ld a, [hl] ; x#SPRITESTATEDATA1_MOVEMENTSTATUS
|
ld a, [hl] ; x#SPRITESTATEDATA1_MOVEMENTSTATUS
|
||||||
bit 7, a ; is the face player flag set?
|
bit BIT_FACE_PLAYER, a
|
||||||
jp nz, MakeNPCFacePlayer
|
jp nz, MakeNPCFacePlayer
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wFontLoaded]
|
ld a, [wFontLoaded]
|
||||||
bit 0, a
|
bit BIT_FONT_LOADED, a
|
||||||
jp nz, notYetMoving
|
jp nz, notYetMoving
|
||||||
ld a, b
|
ld a, b
|
||||||
cp $2
|
cp $2
|
||||||
|
@ -412,7 +412,7 @@ MakeNPCFacePlayer:
|
||||||
ld a, [wStatusFlags3]
|
ld a, [wStatusFlags3]
|
||||||
bit BIT_NO_NPC_FACE_PLAYER, a
|
bit BIT_NO_NPC_FACE_PLAYER, a
|
||||||
jr nz, notYetMoving
|
jr nz, notYetMoving
|
||||||
res 7, [hl]
|
res BIT_FACE_PLAYER, [hl]
|
||||||
ld a, [wPlayerDirection]
|
ld a, [wPlayerDirection]
|
||||||
bit PLAYER_DIR_BIT_UP, a
|
bit PLAYER_DIR_BIT_UP, a
|
||||||
jr z, .notFacingDown
|
jr z, .notFacingDown
|
||||||
|
|
|
@ -16,7 +16,7 @@ FindPathToPlayer:
|
||||||
and a
|
and a
|
||||||
jr nz, .stillHasYProgress
|
jr nz, .stillHasYProgress
|
||||||
ldh a, [hFindPathFlags]
|
ldh a, [hFindPathFlags]
|
||||||
set 0, a ; current end of path matches the player's Y coordinate
|
set BIT_PATH_FOUND_Y, a
|
||||||
ldh [hFindPathFlags], a
|
ldh [hFindPathFlags], a
|
||||||
.stillHasYProgress
|
.stillHasYProgress
|
||||||
ldh a, [hFindPathXProgress]
|
ldh a, [hFindPathXProgress]
|
||||||
|
@ -27,11 +27,11 @@ FindPathToPlayer:
|
||||||
and a
|
and a
|
||||||
jr nz, .stillHasXProgress
|
jr nz, .stillHasXProgress
|
||||||
ldh a, [hFindPathFlags]
|
ldh a, [hFindPathFlags]
|
||||||
set 1, a ; current end of path matches the player's X coordinate
|
set BIT_PATH_FOUND_X, a
|
||||||
ldh [hFindPathFlags], a
|
ldh [hFindPathFlags], a
|
||||||
.stillHasXProgress
|
.stillHasXProgress
|
||||||
ldh a, [hFindPathFlags]
|
ldh a, [hFindPathFlags]
|
||||||
cp $3 ; has the end of the path reached the player's position?
|
cp (1 << BIT_PATH_FOUND_X) | (1 << BIT_PATH_FOUND_Y)
|
||||||
jr z, .done
|
jr z, .done
|
||||||
; Compare whether the X distance between the player and the current of the path
|
; Compare whether the X distance between the player and the current of the path
|
||||||
; is greater or if the Y distance is. Then, try to reduce whichever is greater.
|
; is greater or if the Y distance is. Then, try to reduce whichever is greater.
|
||||||
|
@ -40,7 +40,7 @@ FindPathToPlayer:
|
||||||
jr c, .yDistanceGreater
|
jr c, .yDistanceGreater
|
||||||
; x distance is greater
|
; x distance is greater
|
||||||
ldh a, [hNPCPlayerRelativePosFlags]
|
ldh a, [hNPCPlayerRelativePosFlags]
|
||||||
bit 1, a
|
bit BIT_PLAYER_LOWER_X, a
|
||||||
jr nz, .playerIsLeftOfNPC
|
jr nz, .playerIsLeftOfNPC
|
||||||
ld d, NPC_MOVEMENT_RIGHT
|
ld d, NPC_MOVEMENT_RIGHT
|
||||||
jr .next1
|
jr .next1
|
||||||
|
@ -53,7 +53,7 @@ FindPathToPlayer:
|
||||||
jr .storeDirection
|
jr .storeDirection
|
||||||
.yDistanceGreater
|
.yDistanceGreater
|
||||||
ldh a, [hNPCPlayerRelativePosFlags]
|
ldh a, [hNPCPlayerRelativePosFlags]
|
||||||
bit 0, a
|
bit BIT_PLAYER_LOWER_Y, a
|
||||||
jr nz, .playerIsAboveNPC
|
jr nz, .playerIsAboveNPC
|
||||||
ld d, NPC_MOVEMENT_DOWN
|
ld d, NPC_MOVEMENT_DOWN
|
||||||
jr .next2
|
jr .next2
|
||||||
|
@ -97,15 +97,15 @@ CalcPositionOfPlayerRelativeToNPC:
|
||||||
.NPCNorthOfPlayer
|
.NPCNorthOfPlayer
|
||||||
push hl
|
push hl
|
||||||
ld hl, hNPCPlayerRelativePosFlags
|
ld hl, hNPCPlayerRelativePosFlags
|
||||||
bit 0, [hl]
|
bit BIT_PLAYER_LOWER_Y, [hl]
|
||||||
set 0, [hl]
|
set BIT_PLAYER_LOWER_Y, [hl]
|
||||||
pop hl
|
pop hl
|
||||||
jr .divideYDistance
|
jr .divideYDistance
|
||||||
.NPCSouthOfOrAlignedWithPlayer
|
.NPCSouthOfOrAlignedWithPlayer
|
||||||
push hl
|
push hl
|
||||||
ld hl, hNPCPlayerRelativePosFlags
|
ld hl, hNPCPlayerRelativePosFlags
|
||||||
bit 0, [hl]
|
bit BIT_PLAYER_LOWER_Y, [hl]
|
||||||
res 0, [hl]
|
res BIT_PLAYER_LOWER_Y, [hl]
|
||||||
pop hl
|
pop hl
|
||||||
.divideYDistance
|
.divideYDistance
|
||||||
push hl
|
push hl
|
||||||
|
@ -125,15 +125,15 @@ CalcPositionOfPlayerRelativeToNPC:
|
||||||
.NPCWestOfPlayer
|
.NPCWestOfPlayer
|
||||||
push hl
|
push hl
|
||||||
ld hl, hNPCPlayerRelativePosFlags
|
ld hl, hNPCPlayerRelativePosFlags
|
||||||
bit 1, [hl]
|
bit BIT_PLAYER_LOWER_X, [hl]
|
||||||
set 1, [hl]
|
set BIT_PLAYER_LOWER_X, [hl]
|
||||||
pop hl
|
pop hl
|
||||||
jr .divideXDistance
|
jr .divideXDistance
|
||||||
.NPCEastOfOrAlignedWithPlayer
|
.NPCEastOfOrAlignedWithPlayer
|
||||||
push hl
|
push hl
|
||||||
ld hl, hNPCPlayerRelativePosFlags
|
ld hl, hNPCPlayerRelativePosFlags
|
||||||
bit 1, [hl]
|
bit BIT_PLAYER_LOWER_X, [hl]
|
||||||
res 1, [hl]
|
res BIT_PLAYER_LOWER_X, [hl]
|
||||||
pop hl
|
pop hl
|
||||||
.divideXDistance
|
.divideXDistance
|
||||||
ldh [hDividend2], a
|
ldh [hDividend2], a
|
||||||
|
|
|
@ -18,7 +18,7 @@ TryPushingBoulder::
|
||||||
swap a
|
swap a
|
||||||
ld e, a
|
ld e, a
|
||||||
add hl, de
|
add hl, de
|
||||||
res 7, [hl]
|
res BIT_FACE_PLAYER, [hl]
|
||||||
call GetSpriteMovementByte2Pointer
|
call GetSpriteMovementByte2Pointer
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
cp BOULDER_MOVEMENT_BYTE_2
|
cp BOULDER_MOVEMENT_BYTE_2
|
||||||
|
|
|
@ -52,7 +52,7 @@ LoadSpecialWarpData:
|
||||||
bit BIT_DEBUG_MODE, a
|
bit BIT_DEBUG_MODE, a
|
||||||
; warp to wLastMap (PALLET_TOWN) for StartNewGameDebug
|
; warp to wLastMap (PALLET_TOWN) for StartNewGameDebug
|
||||||
jr nz, .notNewGameWarp
|
jr nz, .notNewGameWarp
|
||||||
bit 2, a
|
bit BIT_FLY_OR_DUNGEON_WARP, a
|
||||||
jr nz, .notNewGameWarp
|
jr nz, .notNewGameWarp
|
||||||
ld hl, NewGameWarp
|
ld hl, NewGameWarp
|
||||||
.copyWarpData
|
.copyWarpData
|
||||||
|
|
|
@ -127,11 +127,11 @@ TryingToLearn:
|
||||||
hlcoord 6, 8
|
hlcoord 6, 8
|
||||||
ld de, wMovesString
|
ld de, wMovesString
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
set 2, a
|
set BIT_SINGLE_SPACED_LINES, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
res 2, a
|
res BIT_SINGLE_SPACED_LINES, a
|
||||||
ldh [hUILayoutFlags], a
|
ldh [hUILayoutFlags], a
|
||||||
ld hl, wTopMenuItemY
|
ld hl, wTopMenuItemY
|
||||||
ld a, 8
|
ld a, 8
|
||||||
|
@ -147,10 +147,10 @@ TryingToLearn:
|
||||||
ld [hli], a ; wMenuWatchedKeys
|
ld [hli], a ; wMenuWatchedKeys
|
||||||
ld [hl], 0 ; wLastMenuItem
|
ld [hl], 0 ; wLastMenuItem
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
set 1, [hl]
|
set BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, hUILayoutFlags
|
ld hl, hUILayoutFlags
|
||||||
res 1, [hl]
|
res BIT_DOUBLE_SPACED_MENU, [hl]
|
||||||
push af
|
push af
|
||||||
call LoadScreenTilesFromBuffer1
|
call LoadScreenTilesFromBuffer1
|
||||||
pop af
|
pop af
|
||||||
|
|
|
@ -41,7 +41,7 @@ DrawHP_:
|
||||||
call DrawHPBar
|
call DrawHPBar
|
||||||
pop hl
|
pop hl
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
bit 0, a
|
bit BIT_PARTY_MENU_HP_BAR, a
|
||||||
jr z, .printFractionBelowBar
|
jr z, .printFractionBelowBar
|
||||||
ld bc, $9 ; right of bar
|
ld bc, $9 ; right of bar
|
||||||
jr .printFraction
|
jr .printFraction
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
PromptUserToPlaySlots:
|
PromptUserToPlaySlots:
|
||||||
call SaveScreenTilesToBuffer2
|
call SaveScreenTilesToBuffer2
|
||||||
ld a, BANK(DisplayTextIDInit) ; TRUE
|
ld a, BANK(DisplayTextIDInit)
|
||||||
ld [wAutoTextBoxDrawingControl], a
|
assert BANK(DisplayTextIDInit) == 1 << BIT_NO_AUTO_TEXT_BOX
|
||||||
ld b, a
|
ld [wAutoTextBoxDrawingControl], a ; 1 << BIT_NO_AUTO_TEXT_BOX
|
||||||
|
ld b, a ; BANK(DisplayTextIDInit)
|
||||||
ld hl, DisplayTextIDInit
|
ld hl, DisplayTextIDInit
|
||||||
call Bankswitch
|
call Bankswitch
|
||||||
ld hl, PlaySlotMachineText
|
ld hl, PlaySlotMachineText
|
||||||
|
@ -173,7 +174,7 @@ OneMoreGoSlotMachineText:
|
||||||
|
|
||||||
SlotMachine_SetFlags:
|
SlotMachine_SetFlags:
|
||||||
ld hl, wSlotMachineFlags
|
ld hl, wSlotMachineFlags
|
||||||
bit 7, [hl]
|
bit BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR, [hl]
|
||||||
ret nz
|
ret nz
|
||||||
ld a, [wSlotMachineAllowMatchesCounter]
|
ld a, [wSlotMachineAllowMatchesCounter]
|
||||||
and a
|
and a
|
||||||
|
@ -191,14 +192,14 @@ SlotMachine_SetFlags:
|
||||||
ld [hl], 0
|
ld [hl], 0
|
||||||
ret
|
ret
|
||||||
.allowMatches
|
.allowMatches
|
||||||
set 6, [hl]
|
set BIT_SLOTS_CAN_WIN, [hl]
|
||||||
ret
|
ret
|
||||||
.setAllowMatchesCounter
|
.setAllowMatchesCounter
|
||||||
ld a, 60
|
ld a, 60
|
||||||
ld [wSlotMachineAllowMatchesCounter], a
|
ld [wSlotMachineAllowMatchesCounter], a
|
||||||
ret
|
ret
|
||||||
.allowSevenAndBarMatches
|
.allowSevenAndBarMatches
|
||||||
set 7, [hl]
|
set BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
SlotMachine_SpinWheels:
|
SlotMachine_SpinWheels:
|
||||||
|
@ -289,7 +290,7 @@ SlotMachine_StopWheel1Early:
|
||||||
call SlotMachine_GetWheel1Tiles
|
call SlotMachine_GetWheel1Tiles
|
||||||
ld hl, wSlotMachineWheel1BottomTile
|
ld hl, wSlotMachineWheel1BottomTile
|
||||||
ld a, [wSlotMachineFlags]
|
ld a, [wSlotMachineFlags]
|
||||||
and $80
|
and 1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR
|
||||||
jr nz, .sevenAndBarMode
|
jr nz, .sevenAndBarMode
|
||||||
; Stop early if the middle symbol is not a cherry.
|
; Stop early if the middle symbol is not a cherry.
|
||||||
inc hl
|
inc hl
|
||||||
|
@ -317,7 +318,7 @@ SlotMachine_StopWheel1Early:
|
||||||
SlotMachine_StopWheel2Early:
|
SlotMachine_StopWheel2Early:
|
||||||
call SlotMachine_GetWheel2Tiles
|
call SlotMachine_GetWheel2Tiles
|
||||||
ld a, [wSlotMachineFlags]
|
ld a, [wSlotMachineFlags]
|
||||||
and $80
|
and 1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR
|
||||||
jr nz, .sevenAndBarMode
|
jr nz, .sevenAndBarMode
|
||||||
; Stop early if any symbols are lined up in the first two wheels.
|
; Stop early if any symbols are lined up in the first two wheels.
|
||||||
call SlotMachine_FindWheel1Wheel2Matches
|
call SlotMachine_FindWheel1Wheel2Matches
|
||||||
|
@ -401,7 +402,7 @@ SlotMachine_CheckForMatches:
|
||||||
call SlotMachine_CheckForMatch
|
call SlotMachine_CheckForMatch
|
||||||
jr z, .foundMatch
|
jr z, .foundMatch
|
||||||
ld a, [wSlotMachineFlags]
|
ld a, [wSlotMachineFlags]
|
||||||
and $c0
|
and (1 << BIT_SLOTS_CAN_WIN) | (1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR)
|
||||||
jr z, .noMatch
|
jr z, .noMatch
|
||||||
ld hl, wSlotMachineRerollCounter
|
ld hl, wSlotMachineRerollCounter
|
||||||
dec [hl]
|
dec [hl]
|
||||||
|
@ -421,9 +422,9 @@ SlotMachine_CheckForMatches:
|
||||||
jp SlotMachine_CheckForMatches
|
jp SlotMachine_CheckForMatches
|
||||||
.foundMatch
|
.foundMatch
|
||||||
ld a, [wSlotMachineFlags]
|
ld a, [wSlotMachineFlags]
|
||||||
and $c0
|
and (1 << BIT_SLOTS_CAN_WIN) | (1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR)
|
||||||
jr z, .rollWheel3DownByOneSymbol ; roll wheel if player isn't allowed to win
|
jr z, .rollWheel3DownByOneSymbol ; roll wheel if player isn't allowed to win
|
||||||
and $80
|
and 1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR
|
||||||
jr nz, .acceptMatch
|
jr nz, .acceptMatch
|
||||||
; if 7/bar matches aren't enabled and the match was a 7/bar symbol, roll wheel
|
; if 7/bar matches aren't enabled and the match was a 7/bar symbol, roll wheel
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
|
@ -599,7 +600,7 @@ SlotReward300Func:
|
||||||
call PlaySound
|
call PlaySound
|
||||||
call Random
|
call Random
|
||||||
cp $80
|
cp $80
|
||||||
ld a, $0
|
ld a, 0
|
||||||
jr c, .skip
|
jr c, .skip
|
||||||
ld [wSlotMachineFlags], a
|
ld [wSlotMachineFlags], a
|
||||||
.skip
|
.skip
|
||||||
|
@ -654,7 +655,7 @@ SlotMachine_PrintPayoutCoins:
|
||||||
jp PrintNumber
|
jp PrintNumber
|
||||||
|
|
||||||
SlotMachine_PayCoinsToPlayer:
|
SlotMachine_PayCoinsToPlayer:
|
||||||
ld a, $1
|
ld a, TRUE
|
||||||
ld [wMuteAudioAndPauseMusic], a
|
ld [wMuteAudioAndPauseMusic], a
|
||||||
call WaitForSoundToFinish
|
call WaitForSoundToFinish
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,7 @@ SetSpriteMovementBytesToFF::
|
||||||
|
|
||||||
; returns the sprite movement byte 1 pointer for sprite [hSpriteIndex] in hl
|
; returns the sprite movement byte 1 pointer for sprite [hSpriteIndex] in hl
|
||||||
GetSpriteMovementByte1Pointer::
|
GetSpriteMovementByte1Pointer::
|
||||||
ld h, $C2
|
ld h, HIGH(wSpriteStateData2)
|
||||||
ldh a, [hSpriteIndex]
|
ldh a, [hSpriteIndex]
|
||||||
swap a
|
swap a
|
||||||
add 6
|
add 6
|
||||||
|
|
|
@ -121,7 +121,7 @@ OverworldLoopLessDelay::
|
||||||
ld a, [wCurMap]
|
ld a, [wCurMap]
|
||||||
call SwitchToMapRomBank ; switch to the ROM bank of the current map
|
call SwitchToMapRomBank ; switch to the ROM bank of the current map
|
||||||
ld hl, wCurMapTileset
|
ld hl, wCurMapTileset
|
||||||
set 7, [hl]
|
set BIT_NO_PREVIOUS_MAP, [hl]
|
||||||
.changeMap
|
.changeMap
|
||||||
jp EnterMap
|
jp EnterMap
|
||||||
.checkForOpponent
|
.checkForOpponent
|
||||||
|
@ -879,10 +879,10 @@ LoadTilesetTilePatternData::
|
||||||
ld a, [wTilesetBank]
|
ld a, [wTilesetBank]
|
||||||
jp FarCopyData2
|
jp FarCopyData2
|
||||||
|
|
||||||
; this loads the current maps complete tile map (which references blocks, not individual tiles) to C6E8
|
; this loads the current map's complete tile map (which references blocks, not individual tiles) to wOverworldMap
|
||||||
; it can also load partial tile maps of connected maps into a border of length 3 around the current map
|
; it can also load partial tile maps of connected maps into a border of length 3 around the current map
|
||||||
LoadTileBlockMap::
|
LoadTileBlockMap::
|
||||||
; fill C6E8-CBFB with the background tile
|
; fill wOverworldMap-wOverworldMapEnd with the background tile
|
||||||
ld hl, wOverworldMap
|
ld hl, wOverworldMap
|
||||||
ld a, [wMapBackgroundTile]
|
ld a, [wMapBackgroundTile]
|
||||||
ld d, a
|
ld d, a
|
||||||
|
@ -1210,7 +1210,7 @@ IsSpriteInFrontOfPlayer2::
|
||||||
and $f0
|
and $f0
|
||||||
inc a
|
inc a
|
||||||
ld l, a ; hl = x#SPRITESTATEDATA1_MOVEMENTSTATUS
|
ld l, a ; hl = x#SPRITESTATEDATA1_MOVEMENTSTATUS
|
||||||
set 7, [hl] ; set flag to make the sprite face the player
|
set BIT_FACE_PLAYER, [hl]
|
||||||
ld a, e
|
ld a, e
|
||||||
ldh [hTextID], a
|
ldh [hTextID], a
|
||||||
ret
|
ret
|
||||||
|
@ -1303,7 +1303,7 @@ CheckForTilePairCollisions::
|
||||||
ld a, [wTileInFrontOfPlayer]
|
ld a, [wTileInFrontOfPlayer]
|
||||||
ld c, a
|
ld c, a
|
||||||
.tilePairCollisionLoop
|
.tilePairCollisionLoop
|
||||||
ld a, [wCurMapTileset] ; tileset number
|
ld a, [wCurMapTileset]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp $ff
|
cp $ff
|
||||||
|
@ -1943,7 +1943,7 @@ CollisionCheckOnWater::
|
||||||
call PlayDefaultMusic
|
call PlayDefaultMusic
|
||||||
jr .noCollision
|
jr .noCollision
|
||||||
.checkIfVermilionDockTileset
|
.checkIfVermilionDockTileset
|
||||||
ld a, [wCurMapTileset] ; tileset
|
ld a, [wCurMapTileset]
|
||||||
cp SHIP_PORT ; Vermilion Dock tileset
|
cp SHIP_PORT ; Vermilion Dock tileset
|
||||||
jr nz, .noCollision ; keep surfing if it's not the boarding platform tile
|
jr nz, .noCollision ; keep surfing if it's not the boarding platform tile
|
||||||
jr .stopSurfing ; if it is the boarding platform tile, stop surfing
|
jr .stopSurfing ; if it is the boarding platform tile, stop surfing
|
||||||
|
@ -2015,10 +2015,10 @@ LoadMapHeader::
|
||||||
call SwitchToMapRomBank
|
call SwitchToMapRomBank
|
||||||
ld a, [wCurMapTileset]
|
ld a, [wCurMapTileset]
|
||||||
ld b, a
|
ld b, a
|
||||||
res 7, a
|
res BIT_NO_PREVIOUS_MAP, a
|
||||||
ld [wCurMapTileset], a
|
ld [wCurMapTileset], a
|
||||||
ldh [hPreviousTileset], a
|
ldh [hPreviousTileset], a
|
||||||
bit 7, b
|
bit BIT_NO_PREVIOUS_MAP, b
|
||||||
ret nz
|
ret nz
|
||||||
ld hl, MapHeaderPointers
|
ld hl, MapHeaderPointers
|
||||||
ld a, [wCurMap]
|
ld a, [wCurMap]
|
||||||
|
@ -2203,9 +2203,9 @@ LoadMapHeader::
|
||||||
ld [hl], a ; store text ID in byte 1 of sprite entry
|
ld [hl], a ; store text ID in byte 1 of sprite entry
|
||||||
pop hl
|
pop hl
|
||||||
ldh a, [hLoadSpriteTemp1]
|
ldh a, [hLoadSpriteTemp1]
|
||||||
bit 6, a
|
bit BIT_TRAINER, a
|
||||||
jr nz, .trainerSprite
|
jr nz, .trainerSprite
|
||||||
bit 7, a
|
bit BIT_ITEM, a
|
||||||
jr nz, .itemBallSprite
|
jr nz, .itemBallSprite
|
||||||
jr .regularSprite
|
jr .regularSprite
|
||||||
.trainerSprite
|
.trainerSprite
|
||||||
|
|
|
@ -3,7 +3,7 @@ PrintPredefTextID::
|
||||||
ld hl, TextPredefs
|
ld hl, TextPredefs
|
||||||
call SetMapTextPointer
|
call SetMapTextPointer
|
||||||
ld hl, wTextPredefFlag
|
ld hl, wTextPredefFlag
|
||||||
set 0, [hl]
|
set BIT_TEXT_PREDEF, [hl]
|
||||||
call DisplayTextID
|
call DisplayTextID
|
||||||
|
|
||||||
RestoreMapTextPointer::
|
RestoreMapTextPointer::
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
; their meaning at the beginning of the functions's execution.
|
; their meaning at the beginning of the functions's execution.
|
||||||
PrintBCDNumber::
|
PrintBCDNumber::
|
||||||
ld b, c ; save flags in b
|
ld b, c ; save flags in b
|
||||||
res 7, c
|
res BIT_LEADING_ZEROES, c
|
||||||
res 6, c
|
res BIT_LEFT_ALIGN, c
|
||||||
res 5, c ; c now holds the length
|
res BIT_MONEY_SIGN, c ; c now holds the length
|
||||||
bit 5, b
|
bit BIT_MONEY_SIGN, b
|
||||||
jr z, .loop
|
jr z, .loop
|
||||||
bit 7, b
|
bit BIT_LEADING_ZEROES, b
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
ld [hl], "¥"
|
ld [hl], "¥"
|
||||||
inc hl
|
inc hl
|
||||||
|
@ -31,14 +31,14 @@ PrintBCDNumber::
|
||||||
inc de
|
inc de
|
||||||
dec c
|
dec c
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
bit 7, b ; were any non-zero digits printed?
|
bit BIT_LEADING_ZEROES, b
|
||||||
jr z, .done ; if so, we are done
|
jr z, .done ; if so, we are done
|
||||||
.numberEqualsZero ; if every digit of the BCD number is zero
|
.numberEqualsZero ; if every digit of the BCD number is zero
|
||||||
bit 6, b ; left or right alignment?
|
bit BIT_LEFT_ALIGN, b
|
||||||
jr nz, .skipRightAlignmentAdjustment
|
jr nz, .skipRightAlignmentAdjustment
|
||||||
dec hl ; if the string is right-aligned, it needs to be moved back one space
|
dec hl ; if the string is right-aligned, it needs to be moved back one space
|
||||||
.skipRightAlignmentAdjustment
|
.skipRightAlignmentAdjustment
|
||||||
bit 5, b
|
bit BIT_MONEY_SIGN, b
|
||||||
jr z, .skipCurrencySymbol
|
jr z, .skipCurrencySymbol
|
||||||
ld [hl], "¥"
|
ld [hl], "¥"
|
||||||
inc hl
|
inc hl
|
||||||
|
@ -54,24 +54,24 @@ PrintBCDDigit::
|
||||||
and a
|
and a
|
||||||
jr z, .zeroDigit
|
jr z, .zeroDigit
|
||||||
.nonzeroDigit
|
.nonzeroDigit
|
||||||
bit 7, b ; have any non-space characters been printed?
|
bit BIT_LEADING_ZEROES, b
|
||||||
jr z, .outputDigit
|
jr z, .outputDigit
|
||||||
; if bit 7 is set, then no numbers have been printed yet
|
; if bit 7 is set, then no numbers have been printed yet
|
||||||
bit 5, b ; print the currency symbol?
|
bit BIT_MONEY_SIGN, b
|
||||||
jr z, .skipCurrencySymbol
|
jr z, .skipCurrencySymbol
|
||||||
ld [hl], "¥"
|
ld [hl], "¥"
|
||||||
inc hl
|
inc hl
|
||||||
res 5, b
|
res BIT_MONEY_SIGN, b
|
||||||
.skipCurrencySymbol
|
.skipCurrencySymbol
|
||||||
res 7, b ; unset 7 to indicate that a nonzero digit has been reached
|
res BIT_LEADING_ZEROES, b
|
||||||
.outputDigit
|
.outputDigit
|
||||||
add "0"
|
add "0"
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
jp PrintLetterDelay
|
jp PrintLetterDelay
|
||||||
.zeroDigit
|
.zeroDigit
|
||||||
bit 7, b ; either printing leading zeroes or already reached a nonzero digit?
|
bit BIT_LEADING_ZEROES, b
|
||||||
jr z, .outputDigit ; if so, print a zero digit
|
jr z, .outputDigit ; if so, print a zero digit
|
||||||
bit 6, b ; left or right alignment?
|
bit BIT_LEFT_ALIGN, b
|
||||||
ret nz
|
ret nz
|
||||||
inc hl ; if right-aligned, "print" a space by advancing the pointer
|
inc hl ; if right-aligned, "print" a space by advancing the pointer
|
||||||
ret
|
ret
|
||||||
|
|
|
@ -4,7 +4,7 @@ ReloadMapSpriteTilePatterns::
|
||||||
ld hl, wFontLoaded
|
ld hl, wFontLoaded
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
res 0, [hl]
|
res BIT_FONT_LOADED, [hl]
|
||||||
push hl
|
push hl
|
||||||
xor a
|
xor a
|
||||||
ld [wSpriteSetID], a
|
ld [wSpriteSetID], a
|
||||||
|
|
|
@ -63,7 +63,7 @@ PlaceNextChar::
|
||||||
jr nz, .NotNext
|
jr nz, .NotNext
|
||||||
ld bc, 2 * SCREEN_WIDTH
|
ld bc, 2 * SCREEN_WIDTH
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
bit 2, a
|
bit BIT_SINGLE_SPACED_LINES, a
|
||||||
jr z, .ok
|
jr z, .ok
|
||||||
ld bc, SCREEN_WIDTH
|
ld bc, SCREEN_WIDTH
|
||||||
.ok
|
.ok
|
||||||
|
|
|
@ -6,8 +6,8 @@ DisplayTextID::
|
||||||
push af
|
push af
|
||||||
farcall DisplayTextIDInit ; initialization
|
farcall DisplayTextIDInit ; initialization
|
||||||
ld hl, wTextPredefFlag
|
ld hl, wTextPredefFlag
|
||||||
bit 0, [hl]
|
bit BIT_TEXT_PREDEF, [hl]
|
||||||
res 0, [hl]
|
res BIT_TEXT_PREDEF, [hl]
|
||||||
jr nz, .skipSwitchToMapBank
|
jr nz, .skipSwitchToMapBank
|
||||||
ld a, [wCurMap]
|
ld a, [wCurMap]
|
||||||
call SwitchToMapRomBank
|
call SwitchToMapRomBank
|
||||||
|
@ -128,7 +128,7 @@ CloseTextDisplay::
|
||||||
ld [MBC1RomBank], a
|
ld [MBC1RomBank], a
|
||||||
call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns)
|
call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns)
|
||||||
ld hl, wFontLoaded
|
ld hl, wFontLoaded
|
||||||
res 0, [hl]
|
res BIT_FONT_LOADED, [hl]
|
||||||
ld a, [wStatusFlags6]
|
ld a, [wStatusFlags6]
|
||||||
bit BIT_FLY_WARP, a
|
bit BIT_FLY_WARP, a
|
||||||
call z, LoadPlayerSpriteGraphics
|
call z, LoadPlayerSpriteGraphics
|
||||||
|
|
|
@ -137,12 +137,12 @@ PlaceMenuCursor::
|
||||||
jr z, .checkForArrow1
|
jr z, .checkForArrow1
|
||||||
push af
|
push af
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
bit 1, a ; is the menu double spaced?
|
bit BIT_DOUBLE_SPACED_MENU, a
|
||||||
jr z, .doubleSpaced1
|
jr z, .doubleSpaced1
|
||||||
ld bc, 20
|
ld bc, SCREEN_WIDTH
|
||||||
jr .getOldMenuItemScreenPosition
|
jr .getOldMenuItemScreenPosition
|
||||||
.doubleSpaced1
|
.doubleSpaced1
|
||||||
ld bc, 40
|
ld bc, SCREEN_WIDTH * 2
|
||||||
.getOldMenuItemScreenPosition
|
.getOldMenuItemScreenPosition
|
||||||
pop af
|
pop af
|
||||||
.oldMenuItemLoop
|
.oldMenuItemLoop
|
||||||
|
@ -163,12 +163,12 @@ PlaceMenuCursor::
|
||||||
jr z, .checkForArrow2
|
jr z, .checkForArrow2
|
||||||
push af
|
push af
|
||||||
ldh a, [hUILayoutFlags]
|
ldh a, [hUILayoutFlags]
|
||||||
bit 1, a ; is the menu double spaced?
|
bit BIT_DOUBLE_SPACED_MENU, a
|
||||||
jr z, .doubleSpaced2
|
jr z, .doubleSpaced2
|
||||||
ld bc, 20
|
ld bc, SCREEN_WIDTH
|
||||||
jr .getCurrentMenuItemScreenPosition
|
jr .getCurrentMenuItemScreenPosition
|
||||||
.doubleSpaced2
|
.doubleSpaced2
|
||||||
ld bc, 40
|
ld bc, SCREEN_WIDTH * 2
|
||||||
.getCurrentMenuItemScreenPosition
|
.getCurrentMenuItemScreenPosition
|
||||||
pop af
|
pop af
|
||||||
.currentMenuItemLoop
|
.currentMenuItemLoop
|
||||||
|
@ -272,7 +272,7 @@ EnableAutoTextBoxDrawing::
|
||||||
jr AutoTextBoxDrawingCommon
|
jr AutoTextBoxDrawingCommon
|
||||||
|
|
||||||
DisableAutoTextBoxDrawing::
|
DisableAutoTextBoxDrawing::
|
||||||
ld a, TRUE
|
ld a, 1 << BIT_NO_AUTO_TEXT_BOX
|
||||||
|
|
||||||
AutoTextBoxDrawingCommon::
|
AutoTextBoxDrawingCommon::
|
||||||
ld [wAutoTextBoxDrawingControl], a
|
ld [wAutoTextBoxDrawingControl], a
|
||||||
|
|
|
@ -388,6 +388,7 @@ hClearLetterPrintingDelayFlags:: db
|
||||||
|
|
||||||
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
|
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
|
||||||
; bit 1: menu is double spaced
|
; bit 1: menu is double spaced
|
||||||
|
; bit 2: text is single spaced
|
||||||
hUILayoutFlags:: db
|
hUILayoutFlags:: db
|
||||||
|
|
||||||
hFieldMoveMonMenuTopMenuItemX:: db
|
hFieldMoveMonMenuTopMenuItemX:: db
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
CeruleanBadgeHouse_Script:
|
CeruleanBadgeHouse_Script:
|
||||||
ld a, TRUE
|
ld a, 1 << BIT_NO_AUTO_TEXT_BOX
|
||||||
ld [wAutoTextBoxDrawingControl], a
|
ld [wAutoTextBoxDrawingControl], a
|
||||||
dec a
|
dec a
|
||||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Museum1F_Script:
|
Museum1F_Script:
|
||||||
ld a, TRUE
|
ld a, 1 << BIT_NO_AUTO_TEXT_BOX
|
||||||
ld [wAutoTextBoxDrawingControl], a
|
ld [wAutoTextBoxDrawingControl], a
|
||||||
xor a
|
xor a
|
||||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
OaksLab_Script:
|
OaksLab_Script:
|
||||||
CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2
|
CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2
|
||||||
call nz, OaksLabLoadTextPointers2Script
|
call nz, OaksLabLoadTextPointers2Script
|
||||||
ld a, TRUE
|
ld a, 1 << BIT_NO_AUTO_TEXT_BOX
|
||||||
ld [wAutoTextBoxDrawingControl], a
|
ld [wAutoTextBoxDrawingControl], a
|
||||||
xor a
|
xor a
|
||||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
PewterMart_Script:
|
PewterMart_Script:
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
ld a, TRUE
|
ld a, 1 << BIT_NO_AUTO_TEXT_BOX
|
||||||
ld [wAutoTextBoxDrawingControl], a
|
ld [wAutoTextBoxDrawingControl], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SSAnne2FRooms_Script:
|
SSAnne2FRooms_Script:
|
||||||
ld a, TRUE
|
ld a, 1 << BIT_NO_AUTO_TEXT_BOX
|
||||||
ld [wAutoTextBoxDrawingControl], a
|
ld [wAutoTextBoxDrawingControl], a
|
||||||
xor a
|
xor a
|
||||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||||
|
|
Loading…
Reference in a new issue