diff options
author | Rangi <35663410+Rangi42@users.noreply.github.com> | 2020-07-16 17:00:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 17:00:57 -0400 |
commit | d44c7c305c3f94b59e3e2c008408779836a0020a (patch) | |
tree | 2cdc51be4a22992701038b959d6c964e9ee8fc58 | |
parent | b9a113a9f4712771e37313a4c8a76f7ef23cebb2 (diff) | |
parent | 7306c1dc2dca5666a5276a6758d1a64e1ddeae20 (diff) |
Merge pull request #277 from Rangi42/master
Miscellaneous constant and label updates
130 files changed, 1143 insertions, 1128 deletions
diff --git a/audio/engine_1.asm b/audio/engine_1.asm index a31572f3..f9b4166a 100644 --- a/audio/engine_1.asm +++ b/audio/engine_1.asm @@ -41,7 +41,7 @@ Audio1_ApplyMusicAffects: ld hl, wChannelNoteDelayCounters ; delay until next note add hl, bc ld a, [hl] - cp $1 ; if the delay is 1, play next note + cp 1 ; if the delay is 1, play next note jp z, Audio1_PlayNextNote dec a ; otherwise, decrease the delay timer ld [hl], a @@ -163,8 +163,8 @@ Audio1_PlayNextNote: Audio1_sound_ret: call Audio1_GetNextMusicByte ld d, a - cp $ff ; is this command a sound_ret? - jp nz, Audio1_sound_call ; no + cp sound_ret_cmd + jp nz, Audio1_sound_call ld b, 0 ld hl, wChannelFlags1 add hl, bc @@ -251,8 +251,8 @@ Audio1_sound_ret: ret Audio1_sound_call: - cp $fd ; is this command a sound_call? - jp nz, Audio1_sound_loop ; no + cp sound_call_cmd + jp nz, Audio1_sound_loop call Audio1_GetNextMusicByte push af call Audio1_GetNextMusicByte @@ -288,8 +288,8 @@ Audio1_sound_call: jp Audio1_sound_ret Audio1_sound_loop: - cp $fe ; is this command a sound_loop? - jp nz, Audio1_note_type ; no + cp sound_loop_cmd + jp nz, Audio1_note_type call Audio1_GetNextMusicByte ld e, a and a @@ -327,8 +327,8 @@ Audio1_sound_loop: Audio1_note_type: and $f0 - cp $d0 ; is this command a note_type? - jp nz, Audio1_toggle_perfect_pitch ; no + cp note_type_cmd + jp nz, Audio1_toggle_perfect_pitch ld a, d and $f ld b, $0 @@ -371,8 +371,8 @@ Audio1_note_type: Audio1_toggle_perfect_pitch: ld a, d - cp $e8 ; is this command a toggle_perfect_pitch? - jr nz, Audio1_vibrato ; no + cp toggle_perfect_pitch_cmd + jr nz, Audio1_vibrato ld b, 0 ld hl, wChannelFlags1 add hl, bc @@ -382,8 +382,8 @@ Audio1_toggle_perfect_pitch: jp Audio1_sound_ret Audio1_vibrato: - cp $ea ; is this command a vibrato? - jr nz, Audio1_pitch_slide ; no + cp vibrato_cmd + jr nz, Audio1_pitch_slide call Audio1_GetNextMusicByte ld b, 0 ld hl, wChannelVibratoDelayCounters @@ -430,8 +430,8 @@ Audio1_vibrato: jp Audio1_sound_ret Audio1_pitch_slide: - cp $eb ; is this command a pitch_slide? - jr nz, Audio1_duty_cycle ; no + cp pitch_slide_cmd + jr nz, Audio1_duty_cycle call Audio1_GetNextMusicByte ld b, 0 ld hl, wChannelPitchSlideLengthModifiers @@ -461,8 +461,8 @@ Audio1_pitch_slide: jp Audio1_note_length Audio1_duty_cycle: - cp $ec ; is this command a duty_cycle? - jr nz, Audio1_tempo ; no + cp duty_cycle_cmd + jr nz, Audio1_tempo call Audio1_GetNextMusicByte rrca rrca @@ -474,8 +474,8 @@ Audio1_duty_cycle: jp Audio1_sound_ret Audio1_tempo: - cp $ed ; is this command a tempo? - jr nz, Audio1_stereo_panning ; no + cp tempo_cmd + jr nz, Audio1_stereo_panning ld a, c cp Ch5 jr nc, .sfxChannel @@ -503,16 +503,16 @@ Audio1_tempo: jp Audio1_sound_ret Audio1_stereo_panning: - cp $ee ; is this command a stereo_panning? - jr nz, Audio1_unknownmusic0xef ; no + cp stereo_panning_cmd + jr nz, Audio1_unknownmusic0xef call Audio1_GetNextMusicByte ld [wStereoPanning], a ; store panning jp Audio1_sound_ret ; this appears to never be used Audio1_unknownmusic0xef: - cp $ef ; is this command an unknownmusic0xef? - jr nz, Audio1_duty_cycle_pattern ; no + cp unknownmusic0xef_cmd + jr nz, Audio1_duty_cycle_pattern call Audio1_GetNextMusicByte push bc call Audio1_PlaySound @@ -528,8 +528,8 @@ Audio1_unknownmusic0xef: jp Audio1_sound_ret Audio1_duty_cycle_pattern: - cp $fc ; is this command a duty_cycle_pattern? - jr nz, Audio1_volume ; no + cp duty_cycle_pattern_cmd + jr nz, Audio1_volume call Audio1_GetNextMusicByte ld b, 0 ld hl, wChannelDutyCyclePatterns @@ -545,15 +545,15 @@ Audio1_duty_cycle_pattern: jp Audio1_sound_ret Audio1_volume: - cp $f0 ; is this command a volume? - jr nz, Audio1_execute_music ; no + cp volume_cmd + jr nz, Audio1_execute_music call Audio1_GetNextMusicByte ldh [rNR50], a ; store volume jp Audio1_sound_ret Audio1_execute_music: - cp $f8 ; is this command an execute_music? - jr nz, Audio1_octave ; no + cp execute_music_cmd + jr nz, Audio1_octave ld b, $0 ld hl, wChannelFlags2 add hl, bc @@ -562,8 +562,8 @@ Audio1_execute_music: Audio1_octave: and $f0 - cp $e0 ; is this command an octave? - jr nz, Audio1_sfx_note ; no + cp octave_cmd + jr nz, Audio1_sfx_note ld hl, wChannelOctaves ld b, 0 add hl, bc @@ -574,7 +574,7 @@ Audio1_octave: ; sfx_note is either square_note or noise_note depending on the channel Audio1_sfx_note: - cp $20 ; is this command a sfx_note? + cp sfx_note_cmd jr nz, Audio1_pitch_sweep ld a, c cp Ch4 ; is this a noise or sfx channel? @@ -630,8 +630,8 @@ Audio1_pitch_sweep: cp Ch5 jr c, Audio1_note ; if not a sfx ld a, d - cp $10 ; is this command a pitch_sweep? - jr nz, Audio1_note ; no + cp pitch_sweep_cmd + jr nz, Audio1_note ld b, $0 ld hl, wChannelFlags2 add hl, bc @@ -647,12 +647,12 @@ Audio1_note: jr nz, Audio1_note_length ; if not noise channel ld a, d and $f0 - cp $b0 ; is this command a drum_note? + cp drum_note_cmd jr z, .drum_note - jr nc, Audio1_note_length ; no + jr nc, Audio1_note_length ; this executes when on the noise channel and - ; the command id is less than $b0 + ; the command id is less than drum_note_cmd ($b0) ; in this case, the upper nybble is used as the noise instrument ($1-$a) ; and the lower nybble is the length minus 1 (0-15) ; however, this doesn't work for instrument #2 because the command id @@ -748,7 +748,7 @@ Audio1_note_length: Audio1_note_pitch: pop af and $f0 - cp $c0 ; compare to rest + cp rest_cmd jr nz, .notRest ld a, c cp Ch5 @@ -1330,7 +1330,7 @@ Audio1_CalculateFrequency: Audio1_PlaySound:: ld [wSoundID], a - cp $ff + cp SFX_STOP_ALL_MUSIC jp z, .stopAllAudio cp MAX_SFX_ID_1 jp z, .playSfx diff --git a/audio/engine_2.asm b/audio/engine_2.asm index 4954f8bc..51a5d7c4 100644 --- a/audio/engine_2.asm +++ b/audio/engine_2.asm @@ -43,7 +43,7 @@ Audio2_ApplyMusicAffects: ld hl, wChannelNoteDelayCounters ; delay until next note add hl, bc ld a, [hl] - cp $1 ; if the delay is 1, play next note + cp 1 ; if the delay is 1, play next note jp z, Audio2_PlayNextNote dec a ; otherwise, decrease the delay timer ld [hl], a @@ -174,8 +174,8 @@ Audio2_PlayNextNote: Audio2_sound_ret: call Audio2_GetNextMusicByte ld d, a - cp $ff ; is this command a sound_ret? - jp nz, Audio2_sound_call ; no + cp sound_ret_cmd + jp nz, Audio2_sound_call ld b, 0 ld hl, wChannelFlags1 add hl, bc @@ -262,8 +262,8 @@ Audio2_sound_ret: ret Audio2_sound_call: - cp $fd ; is this command a sound_call? - jp nz, Audio2_sound_loop ; no + cp sound_call_cmd + jp nz, Audio2_sound_loop call Audio2_GetNextMusicByte push af call Audio2_GetNextMusicByte @@ -299,8 +299,8 @@ Audio2_sound_call: jp Audio2_sound_ret Audio2_sound_loop: - cp $fe ; is this command a sound_loop? - jp nz, Audio2_note_type ; no + cp sound_loop_cmd + jp nz, Audio2_note_type call Audio2_GetNextMusicByte ld e, a and a @@ -338,8 +338,8 @@ Audio2_sound_loop: Audio2_note_type: and $f0 - cp $d0 ; is this command a note_type? - jp nz, Audio2_toggle_perfect_pitch ; no + cp note_type_cmd + jp nz, Audio2_toggle_perfect_pitch ld a, d and $f ld b, $0 @@ -382,8 +382,8 @@ Audio2_note_type: Audio2_toggle_perfect_pitch: ld a, d - cp $e8 ; is this command a toggle_perfect_pitch? - jr nz, Audio2_vibrato ; no + cp toggle_perfect_pitch_cmd + jr nz, Audio2_vibrato ld b, 0 ld hl, wChannelFlags1 add hl, bc @@ -393,8 +393,8 @@ Audio2_toggle_perfect_pitch: jp Audio2_sound_ret Audio2_vibrato: - cp $ea ; is this command a vibrato? - jr nz, Audio2_pitch_slide ; no + cp vibrato_cmd + jr nz, Audio2_pitch_slide call Audio2_GetNextMusicByte ld b, 0 ld hl, wChannelVibratoDelayCounters @@ -441,8 +441,8 @@ Audio2_vibrato: jp Audio2_sound_ret Audio2_pitch_slide: - cp $eb ; is this command a pitch_slide? - jr nz, Audio2_duty_cycle ; no + cp pitch_slide_cmd + jr nz, Audio2_duty_cycle call Audio2_GetNextMusicByte ld b, 0 ld hl, wChannelPitchSlideLengthModifiers @@ -472,8 +472,8 @@ Audio2_pitch_slide: jp Audio2_note_length Audio2_duty_cycle: - cp $ec ; is this command a duty_cycle? - jr nz, Audio2_tempo ; no + cp duty_cycle_cmd + jr nz, Audio2_tempo call Audio2_GetNextMusicByte rrca rrca @@ -485,8 +485,8 @@ Audio2_duty_cycle: jp Audio2_sound_ret Audio2_tempo: - cp $ed ; is this command a tempo? - jr nz, Audio2_stereo_panning ; no + cp tempo_cmd + jr nz, Audio2_stereo_panning ld a, c cp Ch5 jr nc, .sfxChannel @@ -514,16 +514,16 @@ Audio2_tempo: jp Audio2_sound_ret Audio2_stereo_panning: - cp $ee ; is this command a stereo_panning? - jr nz, Audio2_unknownmusic0xef ; no + cp stereo_panning_cmd + jr nz, Audio2_unknownmusic0xef call Audio2_GetNextMusicByte ld [wStereoPanning], a ; store panning jp Audio2_sound_ret ; this appears to never be used Audio2_unknownmusic0xef: - cp $ef ; is this command an unknownmusic0xef? - jr nz, Audio2_duty_cycle_pattern ; no + cp unknownmusic0xef_cmd + jr nz, Audio2_duty_cycle_pattern call Audio2_GetNextMusicByte push bc call Audio2_PlaySound @@ -539,8 +539,8 @@ Audio2_unknownmusic0xef: jp Audio2_sound_ret Audio2_duty_cycle_pattern: - cp $fc ; is this command a duty_cycle_pattern? - jr nz, Audio2_volume ; no + cp duty_cycle_pattern_cmd + jr nz, Audio2_volume call Audio2_GetNextMusicByte ld b, 0 ld hl, wChannelDutyCyclePatterns @@ -556,15 +556,15 @@ Audio2_duty_cycle_pattern: jp Audio2_sound_ret Audio2_volume: - cp $f0 ; is this command a volume? - jr nz, Audio2_execute_music ; no + cp volume_cmd + jr nz, Audio2_execute_music call Audio2_GetNextMusicByte ldh [rNR50], a ; store volume jp Audio2_sound_ret Audio2_execute_music: - cp $f8 ; is this command an execute_music? - jr nz, Audio2_octave ; no + cp execute_music_cmd + jr nz, Audio2_octave ld b, $0 ld hl, wChannelFlags2 add hl, bc @@ -573,8 +573,8 @@ Audio2_execute_music: Audio2_octave: and $f0 - cp $e0 ; is this command an octave? - jr nz, Audio2_sfx_note ; no + cp octave_cmd + jr nz, Audio2_sfx_note ld hl, wChannelOctaves ld b, 0 add hl, bc @@ -585,7 +585,7 @@ Audio2_octave: ; sfx_note is either square_note or noise_note depending on the channel Audio2_sfx_note: - cp $20 ; is this command a sfx_note? + cp sfx_note_cmd jr nz, Audio2_pitch_sweep ld a, c cp Ch4 ; is this a noise or sfx channel? @@ -641,8 +641,8 @@ Audio2_pitch_sweep: cp Ch5 jr c, Audio2_note ; if not a sfx ld a, d - cp $10 ; is this command a pitch_sweep? - jr nz, Audio2_note ; no + cp pitch_sweep_cmd + jr nz, Audio2_note ld b, $0 ld hl, wChannelFlags2 add hl, bc @@ -658,12 +658,12 @@ Audio2_note: jr nz, Audio2_note_length ; if not noise channel ld a, d and $f0 - cp $b0 ; is this command a drum_note? + cp drum_note_cmd jr z, .drum_note - jr nc, Audio2_note_length ; no + jr nc, Audio2_note_length ; this executes when on the noise channel and - ; the command id is less than $b0 + ; the command id is less than drum_note_cmd ($b0) ; in this case, the upper nybble is used as the noise instrument ($1-$a) ; and the lower nybble is the length minus 1 (0-15) ; however, this doesn't work for instrument #2 because the command id @@ -759,7 +759,7 @@ Audio2_note_length: Audio2_note_pitch: pop af and $f0 - cp $c0 ; compare to rest + cp rest_cmd jr nz, .notRest ld a, c cp Ch5 @@ -1393,7 +1393,7 @@ Audio2_CalculateFrequency: Audio2_PlaySound:: ld [wSoundID], a - cp $ff + cp SFX_STOP_ALL_MUSIC jp z, .stopAllAudio cp MAX_SFX_ID_2 jp z, .playSfx diff --git a/audio/engine_3.asm b/audio/engine_3.asm index f86658a2..57618486 100644 --- a/audio/engine_3.asm +++ b/audio/engine_3.asm @@ -41,7 +41,7 @@ Audio3_ApplyMusicAffects: ld hl, wChannelNoteDelayCounters ; delay until next note add hl, bc ld a, [hl] - cp $1 ; if the delay is 1, play next note + cp 1 ; if the delay is 1, play next note jp z, Audio3_PlayNextNote dec a ; otherwise, decrease the delay timer ld [hl], a @@ -163,8 +163,8 @@ Audio3_PlayNextNote: Audio3_sound_ret: call Audio3_GetNextMusicByte ld d, a - cp $ff ; is this command a sound_ret? - jp nz, Audio3_sound_call ; no + cp sound_ret_cmd + jp nz, Audio3_sound_call ld b, 0 ld hl, wChannelFlags1 add hl, bc @@ -251,8 +251,8 @@ Audio3_sound_ret: ret Audio3_sound_call: - cp $fd ; is this command a sound_call? - jp nz, Audio3_sound_loop ; no + cp sound_call_cmd + jp nz, Audio3_sound_loop call Audio3_GetNextMusicByte push af call Audio3_GetNextMusicByte @@ -288,8 +288,8 @@ Audio3_sound_call: jp Audio3_sound_ret Audio3_sound_loop: - cp $fe ; is this command a sound_loop? - jp nz, Audio3_note_type ; no + cp sound_loop_cmd + jp nz, Audio3_note_type call Audio3_GetNextMusicByte ld e, a and a @@ -327,8 +327,8 @@ Audio3_sound_loop: Audio3_note_type: and $f0 - cp $d0 ; is this command a note_type? - jp nz, Audio3_toggle_perfect_pitch ; no + cp note_type_cmd + jp nz, Audio3_toggle_perfect_pitch ld a, d and $f ld b, $0 @@ -371,8 +371,8 @@ Audio3_note_type: Audio3_toggle_perfect_pitch: ld a, d - cp $e8 ; is this command a toggle_perfect_pitch? - jr nz, Audio3_vibrato ; no + cp toggle_perfect_pitch_cmd + jr nz, Audio3_vibrato ld b, 0 ld hl, wChannelFlags1 add hl, bc @@ -382,8 +382,8 @@ Audio3_toggle_perfect_pitch: jp Audio3_sound_ret Audio3_vibrato: - cp $ea ; is this command a vibrato? - jr nz, Audio3_pitch_slide ; no + cp vibrato_cmd + jr nz, Audio3_pitch_slide call Audio3_GetNextMusicByte ld b, 0 ld hl, wChannelVibratoDelayCounters @@ -430,8 +430,8 @@ Audio3_vibrato: jp Audio3_sound_ret Audio3_pitch_slide: - cp $eb ; is this command a pitch_slide? - jr nz, Audio3_duty_cycle ; no + cp pitch_slide_cmd + jr nz, Audio3_duty_cycle call Audio3_GetNextMusicByte ld b, 0 ld hl, wChannelPitchSlideLengthModifiers @@ -461,8 +461,8 @@ Audio3_pitch_slide: jp Audio3_note_length Audio3_duty_cycle: - cp $ec ; is this command a duty_cycle? - jr nz, Audio3_tempo ; no + cp duty_cycle_cmd + jr nz, Audio3_tempo call Audio3_GetNextMusicByte rrca rrca @@ -474,8 +474,8 @@ Audio3_duty_cycle: jp Audio3_sound_ret Audio3_tempo: - cp $ed ; is this command a tempo? - jr nz, Audio3_stereo_panning ; no + cp tempo_cmd + jr nz, Audio3_stereo_panning ld a, c cp Ch5 jr nc, .sfxChannel @@ -503,16 +503,16 @@ Audio3_tempo: jp Audio3_sound_ret Audio3_stereo_panning: - cp $ee ; is this command a stereo_panning? - jr nz, Audio3_unknownmusic0xef ; no + cp stereo_panning_cmd + jr nz, Audio3_unknownmusic0xef call Audio3_GetNextMusicByte ld [wStereoPanning], a ; store panning jp Audio3_sound_ret ; this appears to never be used Audio3_unknownmusic0xef: - cp $ef ; is this command an unknownmusic0xef? - jr nz, Audio3_duty_cycle_pattern ; no + cp unknownmusic0xef_cmd + jr nz, Audio3_duty_cycle_pattern call Audio3_GetNextMusicByte push bc call Audio3_PlaySound @@ -528,8 +528,8 @@ Audio3_unknownmusic0xef: jp Audio3_sound_ret Audio3_duty_cycle_pattern: - cp $fc ; is this command a duty_cycle_pattern? - jr nz, Audio3_volume ; no + cp duty_cycle_pattern_cmd + jr nz, Audio3_volume call Audio3_GetNextMusicByte ld b, 0 ld hl, wChannelDutyCyclePatterns @@ -545,15 +545,15 @@ Audio3_duty_cycle_pattern: jp Audio3_sound_ret Audio3_volume: - cp $f0 ; is this command a volume? - jr nz, Audio3_execute_music ; no + cp volume_cmd + jr nz, Audio3_execute_music call Audio3_GetNextMusicByte ldh [rNR50], a ; store volume jp Audio3_sound_ret Audio3_execute_music: - cp $f8 ; is this command an execute_music? - jr nz, Audio3_octave ; no + cp execute_music_cmd + jr nz, Audio3_octave ld b, $0 ld hl, wChannelFlags2 add hl, bc @@ -562,8 +562,8 @@ Audio3_execute_music: Audio3_octave: and $f0 - cp $e0 ; is this command an octave? - jr nz, Audio3_sfx_note ; no + cp octave_cmd + jr nz, Audio3_sfx_note ld hl, wChannelOctaves ld b, 0 add hl, bc @@ -574,7 +574,7 @@ Audio3_octave: ; sfx_note is either square_note or noise_note depending on the channel Audio3_sfx_note: - cp $20 ; is this command a sfx_note? + cp sfx_note_cmd jr nz, Audio3_pitch_sweep ld a, c cp Ch4 ; is this a noise or sfx channel? @@ -630,8 +630,8 @@ Audio3_pitch_sweep: cp Ch5 jr c, Audio3_note ; if not a sfx ld a, d - cp $10 ; is this command a pitch_sweep? - jr nz, Audio3_note ; no + cp pitch_sweep_cmd + jr nz, Audio3_note ld b, $0 ld hl, wChannelFlags2 add hl, bc @@ -647,12 +647,12 @@ Audio3_note: jr nz, Audio3_note_length ; if not noise channel ld a, d and $f0 - cp $b0 ; is this command a drum_note? + cp drum_note_cmd jr z, .drum_note - jr nc, Audio3_note_length ; no + jr nc, Audio3_note_length ; this executes when on the noise channel and - ; the command id is less than $b0 + ; the command id is less than drum_note_cmd ($b0) ; in this case, the upper nybble is used as the noise instrument ($1-$a) ; and the lower nybble is the length minus 1 (0-15) ; however, this doesn't work for instrument #2 because the command id @@ -748,7 +748,7 @@ Audio3_note_length: Audio3_note_pitch: pop af and $f0 - cp $c0 ; compare to rest + cp rest_cmd jr nz, .notRest ld a, c cp Ch5 @@ -1330,7 +1330,7 @@ Audio3_CalculateFrequency: Audio3_PlaySound:: ld [wSoundID], a - cp $ff + cp SFX_STOP_ALL_MUSIC jp z, .stopAllAudio cp MAX_SFX_ID_3 jp z, .playSfx diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index 6ae2215f..4a113ca0 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -39,6 +39,10 @@ SLP EQU %111 ; sleep counter MAX_STAT_VALUE EQU 999 +; trainer dvs +ATKDEFDV_TRAINER EQU $98 +SPDSPCDV_TRAINER EQU $88 + ; volatile statuses 1 const_def const STORING_ENERGY ; 0 ; Bide diff --git a/constants/input_constants.asm b/constants/input_constants.asm index 1f10cc46..e5bc2a7b 100644 --- a/constants/input_constants.asm +++ b/constants/input_constants.asm @@ -8,6 +8,7 @@ const BIT_D_UP const BIT_D_DOWN +NO_INPUT EQU 0 A_BUTTON EQU 1 << BIT_A_BUTTON B_BUTTON EQU 1 << BIT_B_BUTTON SELECT EQU 1 << BIT_SELECT diff --git a/constants/script_constants.asm b/constants/script_constants.asm index 9b2ab740..018fb7f2 100644 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -12,6 +12,19 @@ SLOTSFISH EQU $0E0C SLOTSBIRD EQU $1210 SLOTSMOUSE EQU $1614 +; in game trades + const_def + const TRADE_FOR_TERRY + const TRADE_FOR_MARCEL + const TRADE_FOR_CHIKUCHIKU + const TRADE_FOR_SAILOR + const TRADE_FOR_DUX + const TRADE_FOR_MARC + const TRADE_FOR_LOLA + const TRADE_FOR_DORIS + const TRADE_FOR_CRINKLES + const TRADE_FOR_SPOT + ; in game trade dialog sets const_def const TRADE_DIALOGSET_CASUAL @@ -30,3 +43,9 @@ SLOTSMOUSE EQU $1614 const BIT_VOLCANOBADGE ; 6 const BIT_EARTHBADGE ; 7 NUM_BADGES EQU const_value + +; OaksAideScript results +OAKS_AIDE_BAG_FULL EQU $00 +OAKS_AIDE_GOT_ITEM EQU $01 +OAKS_AIDE_NOT_ENOUGH_MONS EQU $80 +OAKS_AIDE_REFUSED EQU $ff diff --git a/constants/sprite_data_constants.asm b/constants/sprite_data_constants.asm index 1639b8fa..e1104262 100644 --- a/constants/sprite_data_constants.asm +++ b/constants/sprite_data_constants.asm @@ -11,6 +11,8 @@ const NPC_MOVEMENT_LEFT ; $80 const NPC_MOVEMENT_RIGHT ; $C0 +NPC_CHANGE_FACING EQU $E0 + ; player direction constants const_def const PLAYER_DIR_BIT_RIGHT ; 0 diff --git a/engine/battle/core.asm b/engine/battle/core.asm index c1eecc73..b5c37f1e 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6104,8 +6104,8 @@ LoadEnemyMonData: ld a, [wIsInBattle] cp $2 ; is it a trainer battle? ; fixed DVs for trainer mon - ld a, $98 - ld b, $88 + ld a, ATKDEFDV_TRAINER + ld b, SPDSPCDV_TRAINER jr z, .storeDVs ; random DVs for wild mon call BattleRandom diff --git a/engine/events/hidden_objects/pokecenter_pc.asm b/engine/events/hidden_objects/pokecenter_pc.asm index 9ae7d41c..f20f40ed 100644 --- a/engine/events/hidden_objects/pokecenter_pc.asm +++ b/engine/events/hidden_objects/pokecenter_pc.asm @@ -3,7 +3,7 @@ OpenPokemonCenterPC: cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing - ld a, $1 + ld a, TRUE ld [wAutoTextBoxDrawingControl], a tx_pre_jump PokemonCenterPCText diff --git a/engine/events/oaks_aide.asm b/engine/events/oaks_aide.asm index dd4e5fd7..f1801f5c 100755 --- a/engine/events/oaks_aide.asm +++ b/engine/events/oaks_aide.asm @@ -25,22 +25,22 @@ OaksAideScript: jr nc, .bagFull ld hl, OaksAideGotItemText call PrintText - ld a, $1 + ld a, OAKS_AIDE_GOT_ITEM jr .done .bagFull ld hl, OaksAideNoRoomText call PrintText - xor a + xor a ; OAKS_AIDE_BAG_FULL jr .done .notEnoughOwnedMons ld hl, OaksAideUhOhText call PrintText - ld a, $80 + ld a, OAKS_AIDE_NOT_ENOUGH_MONS jr .done .choseNo ld hl, OaksAideComeBackText call PrintText - ld a, $ff + ld a, OAKS_AIDE_REFUSED .done ldh [hOaksAideResult], a ret diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 3da894f6..3ecd99b1 100755 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -222,9 +222,9 @@ LinkMenu: ld a, START_TRANSFER_INTERNAL_CLOCK ldh [rSC], a .skipStartingTransfer - ld b, $7f - ld c, $7f - ld d, $ec + ld b, " " + ld c, " " + ld d, "▷" ld a, [wLinkMenuSelectionSendBuffer] and (B_BUTTON << 2) ; was B button pressed? jr nz, .updateCursorPosition @@ -670,7 +670,7 @@ SetCursorPositionsFromOptions: ld e, a ld d, 0 add hl, de - ld [hl], $ec ; unfilled right arrow menu cursor + ld [hl], "▷" ret ; table that indicates how the 3 text speed options affect frame delays diff --git a/engine/overworld/auto_movement.asm b/engine/overworld/auto_movement.asm index 9a717641..31f7d7b9 100755 --- a/engine/overworld/auto_movement.asm +++ b/engine/overworld/auto_movement.asm @@ -128,21 +128,21 @@ PalletMovementScript_WalkToLab: ret RLEList_ProfOakWalkToLab: - db NPC_MOVEMENT_DOWN, $05 - db NPC_MOVEMENT_LEFT, $01 - db NPC_MOVEMENT_DOWN, $05 - db NPC_MOVEMENT_RIGHT, $03 - db NPC_MOVEMENT_UP, $01 - db $E0, $01 ; stand still - db $FF + db NPC_MOVEMENT_DOWN, 5 + db NPC_MOVEMENT_LEFT, 1 + db NPC_MOVEMENT_DOWN, 5 + db NPC_MOVEMENT_RIGHT, 3 + db NPC_MOVEMENT_UP, 1 + db NPC_CHANGE_FACING, 1 + db -1 ; end RLEList_PlayerWalkToLab: - db D_UP, $02 - db D_RIGHT, $03 - db D_DOWN, $05 - db D_LEFT, $01 - db D_DOWN, $06 - db $FF + db D_UP, 2 + db D_RIGHT, 3 + db D_DOWN, 5 + db D_LEFT, 1 + db D_DOWN, 6 + db -1 ; end PalletMovementScript_Done: ld a, [wSimulatedJoypadStatesIndex] @@ -190,18 +190,18 @@ PewterMovementScript_WalkToMuseum: ret RLEList_PewterMuseumPlayer: - db 0, $01 - db D_UP, $03 - db D_LEFT, $0D - db D_UP, $06 - db $FF + db NO_INPUT, 1 + db D_UP, 3 + db D_LEFT, 13 + db D_UP, 6 + db -1 ; end RLEList_PewterMuseumGuy: - db NPC_MOVEMENT_UP, $06 - db NPC_MOVEMENT_LEFT, $0D - db NPC_MOVEMENT_UP, $03 - db NPC_MOVEMENT_LEFT, $01 - db $FF + db NPC_MOVEMENT_UP, 6 + db NPC_MOVEMENT_LEFT, 13 + db NPC_MOVEMENT_UP, 3 + db NPC_MOVEMENT_LEFT, 1 + db -1 ; end PewterMovementScript_Done: ld a, [wSimulatedJoypadStatesIndex] @@ -249,22 +249,22 @@ PewterMovementScript_WalkToGym: ret RLEList_PewterGymPlayer: - db 0, $01 - db D_RIGHT, $02 - db D_DOWN, $05 - db D_LEFT, $0B - db D_UP, $05 - db D_LEFT, $0F - db $FF + db NO_INPUT, 1 + db D_RIGHT, 2 + db D_DOWN, 5 + db D_LEFT, 11 + db D_UP, 5 + db D_LEFT, 15 + db -1 ; end RLEList_PewterGymGuy: - db NPC_MOVEMENT_DOWN, $02 - db NPC_MOVEMENT_LEFT, $0F - db NPC_MOVEMENT_UP, $05 - db NPC_MOVEMENT_LEFT, $0B - db NPC_MOVEMENT_DOWN, $05 - db NPC_MOVEMENT_RIGHT, $03 - db $FF + db NPC_MOVEMENT_DOWN, 2 + db NPC_MOVEMENT_LEFT, 15 + db NPC_MOVEMENT_UP, 5 + db NPC_MOVEMENT_LEFT, 11 + db NPC_MOVEMENT_DOWN, 5 + db NPC_MOVEMENT_RIGHT, 3 + db -1 ; end FreezeEnemyTrainerSprite:: ld a, [wCurMap] @@ -275,7 +275,7 @@ FreezeEnemyTrainerSprite:: ld b, a .loop ld a, [hli] - cp $ff + cp -1 jr z, .notRival cp b ret z ; the rival leaves after battling, so don't freeze him @@ -289,4 +289,4 @@ RivalIDs: db OPP_SONY1 db OPP_SONY2 db OPP_SONY3 - db $ff + db -1 ; end diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 58481613..61bcf02f 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -169,7 +169,7 @@ UpdateNPCSprite: pop hl ld de, wNPCMovementDirections call LoadDEPlusA ; a = [wNPCMovementDirections + movement byte 1] - cp $e0 + cp NPC_CHANGE_FACING jp z, ChangeFacingDirection cp STAY jr nz, .next diff --git a/engine/pokemon/add_mon.asm b/engine/pokemon/add_mon.asm index 0c72ff5b..d7e7eab1 100644 --- a/engine/pokemon/add_mon.asm +++ b/engine/pokemon/add_mon.asm @@ -75,8 +75,8 @@ _AddPartyMon:: push hl ld a, [wMonDataLocation] and $f - ld a, $98 ; set enemy trainer mon IVs to fixed average values - ld b, $88 + ld a, ATKDEFDV_TRAINER ; set enemy trainer mon IVs to fixed average values + ld b, SPDSPCDV_TRAINER jr nz, .next4 ; If the mon is being added to the player's party, update the pokedex. diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index 9af17a81..fe137632 100755 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -1,6 +1,6 @@ PromptUserToPlaySlots: call SaveScreenTilesToBuffer2 - ld a, BANK(DisplayTextIDInit) + ld a, BANK(DisplayTextIDInit) ; TRUE ld [wAutoTextBoxDrawingControl], a ld b, a ld hl, DisplayTextIDInit diff --git a/home/list_menu.asm b/home/list_menu.asm index ec775331..f8ddeeef 100644 --- a/home/list_menu.asm +++ b/home/list_menu.asm @@ -504,7 +504,7 @@ PrintListMenuEntries:: cp c ; is it this item? jr nz, .nextListEntry dec hl - ld a, $ec ; unfilled right arrow menu cursor to indicate an item being swapped + ld a, "▷" ld [hli], a .nextListEntry ld bc, 2 * SCREEN_WIDTH ; 2 rows diff --git a/home/pathfinding.asm b/home/pathfinding.asm index aca5a763..53f98847 100644 --- a/home/pathfinding.asm +++ b/home/pathfinding.asm @@ -25,7 +25,7 @@ MoveSprite_:: ld [hli], a inc de inc c - cp $FF ; have we reached the end of the movement data? + cp -1 ; have we reached the end of the movement data? jr nz, .loop ld a, c diff --git a/home/window.asm b/home/window.asm index e83f9585..f86e39c6 100644 --- a/home/window.asm +++ b/home/window.asm @@ -201,7 +201,7 @@ PlaceUnfilledArrowMenuCursor:: ld l, a ld a, [wMenuCursorLocation + 1] ld h, a - ld [hl], $ec ; outline of right arrow + ld [hl], "▷" ld a, b ret @@ -272,7 +272,7 @@ EnableAutoTextBoxDrawing:: jr AutoTextBoxDrawingCommon DisableAutoTextBoxDrawing:: - ld a, $01 + ld a, TRUE AutoTextBoxDrawingCommon:: ld [wAutoTextBoxDrawingControl], a diff --git a/macros/coords.asm b/macros/coords.asm index 7cbbca3d..6b16e7f7 100644 --- a/macros/coords.asm +++ b/macros/coords.asm @@ -83,3 +83,8 @@ lda_coord: MACRO ld a, [(\2) * SCREEN_WIDTH + (\1) + wTileMap] ENDC ENDM + +dbmapcoord: MACRO +; x, y + db \2, \1 +ENDM diff --git a/macros/scripts/audio.asm b/macros/scripts/audio.asm index 4f4d084c..b12a2adc 100755 --- a/macros/scripts/audio.asm +++ b/macros/scripts/audio.asm @@ -15,14 +15,17 @@ audio_header: MACRO ENDC ENDM + const_def $10 + ; arguments: length [0, 7], pitch change [-7, 7] ; length: length of time between pitch shifts ; sometimes used with a value >7 in which case the MSB is ignored ; pitch change: positive value means increase in pitch, negative value means decrease in pitch ; small magnitude means quick change, large magnitude means slow change ; in signed magnitude representation, so a value of 8 is the same as (negative) 0 + const pitch_sweep_cmd ; $10 pitch_sweep: MACRO - db $10 + db pitch_sweep_cmd IF \2 < 0 db (\1 << 4) | (%1000 | (\2 * -1)) ELSE @@ -30,12 +33,17 @@ pitch_sweep: MACRO ENDC ENDM + const_next $20 + + const sfx_note_cmd ; $20 + ; arguments: length [0, 15], volume [0, 15], fade [-7, 7], frequency ; fade: positive value means decrease in volume, negative value means increase in volume ; small magnitude means quick change, large magnitude means slow change ; in signed magnitude representation, so a value of 8 is the same as (negative) 0 +square_note_cmd EQU sfx_note_cmd ; $20 square_note: MACRO - db $20 | \1 + db square_note_cmd | \1 IF \3 < 0 db (\2 << 4) | (%1000 | (\3 * -1)) ELSE @@ -48,8 +56,9 @@ ENDM ; fade: positive value means decrease in volume, negative value means increase in volume ; small magnitude means quick change, large magnitude means slow change ; in signed magnitude representation, so a value of 8 is the same as (negative) 0 +noise_note_cmd EQU sfx_note_cmd ; $20 noise_note: MACRO - db $20 | \1 + db noise_note_cmd | \1 IF \3 < 0 db (\2 << 4) | (%1000 | (\3 * -1)) ELSE @@ -63,9 +72,12 @@ note: MACRO db (\1 << 4) | (\2 - 1) ENDM + const_next $b0 + ; arguments: instrument [1, 19], length [1, 16] + const drum_note_cmd ; $b0 drum_note: MACRO - db $B0 | (\2 - 1) + db drum_note_cmd | (\2 - 1) db \1 ENDM @@ -77,17 +89,23 @@ drum_note_short: MACRO db (\1 << 4) | (\2 - 1) ENDM + const_next $c0 + ; arguments: length [1, 16] + const rest_cmd ; $c0 rest: MACRO - db $C0 | (\1 - 1) + db rest_cmd | (\1 - 1) ENDM + const_next $d0 + ; arguments: speed [0, 15], volume [0, 15], fade [-7, 7] ; fade: positive value means decrease in volume, negative value means increase in volume ; small magnitude means quick change, large magnitude means slow change ; in signed magnitude representation, so a value of 8 is the same as (negative) 0 + const note_type_cmd ; $d0 note_type: MACRO - db $D0 | \1 + db note_type_cmd | \1 IF \3 < 0 db (\2 << 4) | (%1000 | (\3 * -1)) ELSE @@ -96,40 +114,52 @@ note_type: MACRO ENDM ; arguments: speed [0, 15] +drum_speed_cmd EQU note_type_cmd ; $d0 drum_speed: MACRO - db $D0 | \1 + db drum_speed_cmd | \1 ENDM + const_next $e0 + ; arguments: octave [1, 8] + const octave_cmd ; $e0 octave: MACRO - db $E8 - \1 + db octave_cmd | (8 - \1) ENDM + const_next $e8 + ; when enabled, effective frequency used is incremented by 1 + const toggle_perfect_pitch_cmd ; $e8 toggle_perfect_pitch: MACRO - db $E8 + db toggle_perfect_pitch_cmd ENDM + const_skip ; $e9 + ; arguments: delay [0, 255], depth [0, 15], rate [0, 15] ; delay: time delay until vibrato effect begins ; depth: amplitude of vibrato wave ; rate: frequency of vibrato wave + const vibrato_cmd ; $ea vibrato: MACRO - db $EA + db vibrato_cmd db \1 db (\2 << 4) | \3 ENDM ; arguments: length [1, 256], octave [1, 8], pitch + const pitch_slide_cmd ; $eb pitch_slide: MACRO - db $EB + db pitch_slide_cmd db \1 - 1 db ((8 - \2) << 4) | \3 ENDM ; arguments: duty cycle [0, 3] (12.5%, 25%, 50%, 75%) + const duty_cycle_cmd ; $ec duty_cycle: MACRO - db $EC + db duty_cycle_cmd db \1 ENDM @@ -139,47 +169,65 @@ ENDM ; ideally should be set to $100 or less to guarantee no overflow ; if larger than $100, large note speed or note length values might cause overflow ; stored in big endian + const tempo_cmd ; $ed tempo: MACRO - db $ED + db tempo_cmd db HIGH(\1), LOW(\1) ENDM ; arguments: left output enable mask, right output enable mask + const stereo_panning_cmd ; $ee stereo_panning: MACRO - db $EE + db stereo_panning_cmd db (\1 << 4) | \2 ENDM + const unknownmusic0xef_cmd ; $ef +unknownmusic0xef: MACRO + db unknownmusic0xef_cmd + db \1 +ENDM + ; arguments: left master volume [0, 7], right master volume [0, 7] + const volume_cmd ; $f0 volume: MACRO - db $F0 + db volume_cmd db (\1 << 4) | \2 ENDM + const_next $f8 + ; when enabled, the sfx data is interpreted as music data + const execute_music_cmd ; $f8 execute_music: MACRO - db $F8 + db execute_music_cmd ENDM + const_next $fc + ; arguments: duty cycle 1, duty cycle 2, duty cycle 3, duty cycle 4 + const duty_cycle_pattern_cmd ; $fc duty_cycle_pattern: MACRO - db $FC + db duty_cycle_pattern_cmd db \1 << 6 | \2 << 4 | \3 << 2 | \4 ENDM ; arguments: address + const sound_call_cmd ; $fd sound_call: MACRO - db $FD + db sound_call_cmd dw \1 ENDM ; arguments: count, address + const sound_loop_cmd ; $fe sound_loop: MACRO - db $FE + db sound_loop_cmd db \1 dw \2 ENDM + const sound_ret_cmd ; $ff sound_ret: MACRO - db $FF + db sound_ret_cmd ENDM diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm index f2009209..8722b4d0 100644 --- a/macros/scripts/maps.asm +++ b/macros/scripts/maps.asm @@ -67,6 +67,14 @@ trainer: MACRO dw \3, \5, \4, \4 ENDM +;\1 x position +;\2 y position +;\3 movement data +map_coord_movement: MACRO + dbmapcoord \1, \2 + dw \3 +ENDM + ;\1 map name ;\2 map id diff --git a/scripts/AgathasRoom.asm b/scripts/AgathasRoom.asm index c8df935e..b0c53571 100755 --- a/scripts/AgathasRoom.asm +++ b/scripts/AgathasRoom.asm @@ -87,11 +87,11 @@ AgathaScript0: ret AgathaEntranceCoords: - db $0A,$04 - db $0A,$05 - db $0B,$04 - db $0B,$05 - db $FF + dbmapcoord 4, 10 + dbmapcoord 5, 10 + dbmapcoord 4, 11 + dbmapcoord 5, 11 + db -1 ; end AgathaScript3: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/BillsHouse.asm b/scripts/BillsHouse.asm index 3edfdf5b..75594801 100755 --- a/scripts/BillsHouse.asm +++ b/scripts/BillsHouse.asm @@ -33,7 +33,7 @@ MovementData_1e79c: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP - db $FF + db -1 ; end ; make Bill walk around the player MovementData_1e7a0: @@ -42,7 +42,7 @@ MovementData_1e7a0: db NPC_MOVEMENT_UP db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_UP - db $FF + db -1 ; end BillsHouseScript2: ld a, [wd730] @@ -93,7 +93,7 @@ MovementData_1e807: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end BillsHouseScript4: ld a, [wd730] diff --git a/scripts/BluesHouse.asm b/scripts/BluesHouse.asm index 241d6f5a..1ab0fd06 100755 --- a/scripts/BluesHouse.asm +++ b/scripts/BluesHouse.asm @@ -10,9 +10,7 @@ BluesHouse_ScriptPointers: BluesHouseScript0: SetEvent EVENT_ENTERED_BLUES_HOUSE - - ; trigger the next script - ld a, 1 + ld a, $1 ld [wBluesHouseCurScript], a ret @@ -20,40 +18,40 @@ BluesHouseScript1: ret BluesHouse_TextPointers: - dw BluesHouseText1 - dw BluesHouseText2 - dw BluesHouseText3 + dw BluesHouseDaisySittingText + dw BluesHouseDaisyWalkingText + dw BluesHouseTownMapText -BluesHouseText1: +BluesHouseDaisySittingText: text_asm CheckEvent EVENT_GOT_TOWN_MAP - jr nz, .GotMap + jr nz, .got_town_map CheckEvent EVENT_GOT_POKEDEX - jr nz, .GiveMap + jr nz, .give_town_map ld hl, DaisyInitialText call PrintText jr .done -.GiveMap +.give_town_map ld hl, DaisyOfferMapText call PrintText lb bc, TOWN_MAP, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld a, HS_TOWN_MAP ld [wMissableObjectIndex], a - predef HideObject ; hide table map object + predef HideObject ld hl, GotMapText call PrintText SetEvent EVENT_GOT_TOWN_MAP jr .done -.GotMap +.got_town_map ld hl, DaisyUseMapText call PrintText jr .done -.BagFull +.bag_full ld hl, DaisyBagFullText call PrintText .done @@ -80,10 +78,10 @@ DaisyUseMapText: text_far _DaisyUseMapText text_end -BluesHouseText2: ; Daisy, walking around - text_far _BluesHouseText2 +BluesHouseDaisyWalkingText: + text_far _BluesHouseDaisyWalkingText text_end -BluesHouseText3: ; map on table - text_far _BluesHouseText3 +BluesHouseTownMapText: + text_far _BluesHouseTownMapText text_end diff --git a/scripts/BrunosRoom.asm b/scripts/BrunosRoom.asm index 194bc201..578cbb98 100755 --- a/scripts/BrunosRoom.asm +++ b/scripts/BrunosRoom.asm @@ -87,11 +87,11 @@ BrunoScript0: ret BrunoEntranceCoords: - db $0A,$04 - db $0A,$05 - db $0B,$04 - db $0B,$05 - db $FF + dbmapcoord 4, 10 + dbmapcoord 5, 10 + dbmapcoord 4, 11 + dbmapcoord 5, 11 + db -1 ; end BrunoScript3: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/CeladonDiner.asm b/scripts/CeladonDiner.asm index e5a2d8b2..e95035f0 100755 --- a/scripts/CeladonDiner.asm +++ b/scripts/CeladonDiner.asm @@ -28,24 +28,24 @@ CeladonDinerText4: CeladonDinerText5: text_asm CheckEvent EVENT_GOT_COIN_CASE - jr nz, .asm_eb14d + jr nz, .got_item ld hl, CeladonDinerText_491a7 call PrintText lb bc, COIN_CASE, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full SetEvent EVENT_GOT_COIN_CASE ld hl, ReceivedCoinCaseText call PrintText - jr .asm_68b61 -.BagFull + jr .done +.bag_full ld hl, CoinCaseNoRoomText call PrintText - jr .asm_68b61 -.asm_eb14d + jr .done +.got_item ld hl, CeladonDinerText_491b7 call PrintText -.asm_68b61 +.done jp TextScriptEnd CeladonDinerText_491a7: diff --git a/scripts/CeladonMansion1F.asm b/scripts/CeladonMansion1F.asm index 2a386aad..fa901ff9 100755 --- a/scripts/CeladonMansion1F.asm +++ b/scripts/CeladonMansion1F.asm @@ -8,7 +8,7 @@ CeladonMansion1F_TextPointers: dw CeladonMansion1Text4 dw CeladonMansion1Text5 -CeladonMansion1_486a1: +CeladonMansion1_PlayCryScript: call PlayCry jp TextScriptEnd @@ -16,7 +16,7 @@ CeladonMansion1Text1: text_far _CeladonMansion1Text1 text_asm ld a, MEOWTH - jp CeladonMansion1_486a1 + jp CeladonMansion1_PlayCryScript CeladonMansion1Text2: text_far _CeladonMansion1Text2 @@ -26,13 +26,13 @@ CeladonMansion1Text3: text_far _CeladonMansion1Text3 text_asm ld a, CLEFAIRY - jp CeladonMansion1_486a1 + jp CeladonMansion1_PlayCryScript CeladonMansion1Text4: text_far _CeladonMansion1Text4 text_asm ld a, NIDORAN_F - jp CeladonMansion1_486a1 + jp CeladonMansion1_PlayCryScript CeladonMansion1Text5: text_far _CeladonMansion1Text5 diff --git a/scripts/CeladonMansion3F.asm b/scripts/CeladonMansion3F.asm index b2d40b44..f8972793 100755 --- a/scripts/CeladonMansion3F.asm +++ b/scripts/CeladonMansion3F.asm @@ -25,32 +25,30 @@ WriterText: DirectorText: text_asm - - ; check pokédex ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits ld a, [wNumSetBits] - cp 150 - jr nc, .CompletedDex - ld hl, .GameDesigner + cp NUM_POKEMON - 1 ; discount Mew + jr nc, .completed_dex + ld hl, .GameDesignerText jr .done -.CompletedDex +.completed_dex ld hl, .CompletedDexText .done call PrintText jp TextScriptEnd -.GameDesigner +.GameDesignerText: text_far _GameDesignerText text_end -.CompletedDexText +.CompletedDexText: text_far _CompletedDexText text_promptbutton text_asm callfar DisplayDiploma - ld a, $1 + ld a, TRUE ld [wDoNotWaitForButtonPressAfterDisplayingText], a jp TextScriptEnd diff --git a/scripts/CeladonMansionRoofHouse.asm b/scripts/CeladonMansionRoofHouse.asm index 28cec151..bd564dcc 100755 --- a/scripts/CeladonMansionRoofHouse.asm +++ b/scripts/CeladonMansionRoofHouse.asm @@ -13,9 +13,9 @@ CeladonMansion5Text2: text_asm lb bc, EEVEE, 25 call GivePokemon - jr nc, .asm_24365 + jr nc, .party_full ld a, HS_CELADON_MANSION_EEVEE_GIFT ld [wMissableObjectIndex], a predef HideObject -.asm_24365 +.party_full jp TextScriptEnd diff --git a/scripts/CeladonMart3F.asm b/scripts/CeladonMart3F.asm index e3e929da..55081982 100755 --- a/scripts/CeladonMart3F.asm +++ b/scripts/CeladonMart3F.asm @@ -23,21 +23,21 @@ CeladonMart3F_TextPointers: CeladonMart3Text1: text_asm CheckEvent EVENT_GOT_TM18 - jr nz, .asm_a5463 + jr nz, .got_item ld hl, TM18PreReceiveText call PrintText lb bc, TM_COUNTER, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full SetEvent EVENT_GOT_TM18 ld hl, ReceivedTM18Text - jr .asm_81359 -.BagFull + jr .done +.bag_full ld hl, TM18NoRoomText - jr .asm_81359 -.asm_a5463 + jr .done +.got_item ld hl, TM18ExplanationText -.asm_81359 +.done call PrintText jp TextScriptEnd diff --git a/scripts/CeladonMartElevator.asm b/scripts/CeladonMartElevator.asm index e58c88f0..b657b3f9 100755 --- a/scripts/CeladonMartElevator.asm +++ b/scripts/CeladonMartElevator.asm @@ -40,23 +40,22 @@ CeladonMartElevatorScript_48631: jp CopyData CeladonMartElevatorFloors: - db 5 ; number of elements in list + db 5 ; # db FLOOR_1F db FLOOR_2F db FLOOR_3F db FLOOR_4F db FLOOR_5F - db $FF + db -1 ; end -CeladonMartElevatorWarpMaps: -; first byte is warp number -; second byte is map number ; These specify where the player goes after getting out of the elevator. - db $05, CELADON_MART_1F - db $02, CELADON_MART_2F - db $02, CELADON_MART_3F - db $02, CELADON_MART_4F - db $02, CELADON_MART_5F +CeladonMartElevatorWarpMaps: + ; warp number, map id + db 5, CELADON_MART_1F + db 2, CELADON_MART_2F + db 2, CELADON_MART_3F + db 2, CELADON_MART_4F + db 2, CELADON_MART_5F CeladonMartElevatorWarpMapsEnd: CeladonMartElevatorScript_48654: diff --git a/scripts/CeladonMartRoof.asm b/scripts/CeladonMartRoof.asm index b1f6a8a3..0f71aa51 100755 --- a/scripts/CeladonMartRoof.asm +++ b/scripts/CeladonMartRoof.asm @@ -38,7 +38,7 @@ CeladonMartRoofDrinkList: db FRESH_WATER db SODA_POP db LEMONADE - db $00 + db 0 ; end CeladonMartRoofScript_GiveDrinkToGirl: ld hl, wd730 diff --git a/scripts/CeruleanBadgeHouse.asm b/scripts/CeruleanBadgeHouse.asm index e1e4ab44..5e35b079 100755 --- a/scripts/CeruleanBadgeHouse.asm +++ b/scripts/CeruleanBadgeHouse.asm @@ -1,5 +1,5 @@ CeruleanBadgeHouse_Script: - ld a, $1 + ld a, TRUE ld [wAutoTextBoxDrawingControl], a dec a ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -34,7 +34,7 @@ CeruleanHouse2Text1: jr c, .asm_74e60 ld hl, TextPointers_74e86 ld a, [wcf91] - sub $15 + sub BOULDERBADGE add a ld d, $0 ld e, a @@ -52,7 +52,16 @@ CeruleanHouse2Text1: jp TextScriptEnd BadgeItemList: - db $8,BOULDERBADGE,CASCADEBADGE,THUNDERBADGE,RAINBOWBADGE,SOULBADGE,MARSHBADGE,VOLCANOBADGE,EARTHBADGE,$FF + db 8 ; # + db BOULDERBADGE + db CASCADEBADGE + db THUNDERBADGE + db RAINBOWBADGE + db SOULBADGE + db MARSHBADGE + db VOLCANOBADGE + db EARTHBADGE + db -1 ; end CeruleanHouse2Text_74e77: text_far _CeruleanHouse2Text_74e77 diff --git a/scripts/CeruleanCity.asm b/scripts/CeruleanCity.asm index 209e29cc..4d960537 100755 --- a/scripts/CeruleanCity.asm +++ b/scripts/CeruleanCity.asm @@ -101,20 +101,20 @@ ENDC ret CeruleanCityCoords1: - db $07,$1e - db $09,$1e - db $ff + dbmapcoord 30, 7 + dbmapcoord 30, 9 + db -1 ; end CeruleanCityCoords2: - db $06,$14 - db $06,$15 - db $ff + dbmapcoord 20, 6 + dbmapcoord 21, 6 + db -1 ; end CeruleanCityMovement1: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end CeruleanCityScript_1955d: ld a, 1 @@ -205,7 +205,7 @@ CeruleanCityMovement3: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end CeruleanCityMovement4: db NPC_MOVEMENT_RIGHT @@ -215,7 +215,7 @@ CeruleanCityMovement4: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end CeruleanCityScript3: ld a, [wd730] diff --git a/scripts/CeruleanTradeHouse.asm b/scripts/CeruleanTradeHouse.asm index ba88f1b5..66952cd4 100755 --- a/scripts/CeruleanTradeHouse.asm +++ b/scripts/CeruleanTradeHouse.asm @@ -11,7 +11,7 @@ CeruleanHouse1Text1: CeruleanHouse1Text2: text_asm - ld a, $6 + ld a, TRADE_FOR_LOLA ld [wWhichTrade], a predef DoInGameTradeDialogue jp TextScriptEnd diff --git a/scripts/CeruleanTrashedHouse.asm b/scripts/CeruleanTrashedHouse.asm index 0d1e6ac3..d11c7721 100755 --- a/scripts/CeruleanTrashedHouse.asm +++ b/scripts/CeruleanTrashedHouse.asm @@ -9,17 +9,17 @@ CeruleanTrashedHouse_TextPointers: CeruleanHouseTrashedText1: text_asm - ld b, $e4 + ld b, TM_DIG predef GetQuantityOfItemInBag and b - jr z, .asm_f8734 + jr z, .no_dig_tm ld hl, CeruleanHouseTrashedText_1d6b0 call PrintText - jr .asm_8dfe9 -.asm_f8734 + jr .done +.no_dig_tm ld hl, CeruleanHouseTrashedText_1d6ab call PrintText -.asm_8dfe9 +.done jp TextScriptEnd CeruleanHouseTrashedText_1d6ab: diff --git a/scripts/ChampionsRoom.asm b/scripts/ChampionsRoom.asm index e57048c5..d151bb4d 100755 --- a/scripts/ChampionsRoom.asm +++ b/scripts/ChampionsRoom.asm @@ -40,10 +40,10 @@ GaryScript1: ret GaryEntrance_RLEMovement: - db D_UP,1 - db D_RIGHT,1 - db D_UP,3 - db $ff + db D_UP, 1 + db D_RIGHT, 1 + db D_UP, 3 + db -1 ; end GaryScript2: ld a, [wSimulatedJoypadStatesIndex] @@ -132,7 +132,7 @@ OakEntranceAfterVictoryMovement: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP - db $FF + db -1 ; end GaryScript5: ld a, [wd730] @@ -190,7 +190,7 @@ GaryScript7: OakExitGaryRoomMovement: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP - db $FF + db -1 ; end GaryScript8: ld a, [wd730] @@ -217,9 +217,9 @@ GaryScript9: ret WalkToHallOfFame_RLEMovment: - db D_UP,4 - db D_LEFT,1 - db $ff + db D_UP, 4 + db D_LEFT, 1 + db -1 ; end GaryScript10: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/CinnabarGym.asm b/scripts/CinnabarGym.asm index 552f2e6e..f890a07b 100755 --- a/scripts/CinnabarGym.asm +++ b/scripts/CinnabarGym.asm @@ -71,11 +71,11 @@ CinnabarGymScript0: MovementData_757d7: db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_UP - db $FF + db -1 ; end MovementData_757da: db NPC_MOVEMENT_LEFT - db $FF + db -1 ; end CinnabarGymScript1: ld a, [wd730] diff --git a/scripts/CinnabarLabFossilRoom.asm b/scripts/CinnabarLabFossilRoom.asm index 4bdb8a36..2c388119 100755 --- a/scripts/CinnabarLabFossilRoom.asm +++ b/scripts/CinnabarLabFossilRoom.asm @@ -44,7 +44,7 @@ FossilsList: db DOME_FOSSIL db HELIX_FOSSIL db OLD_AMBER - db $00 + db 0 ; end Lab4Text1: text_asm @@ -100,7 +100,7 @@ Lab4Text_75dd5: Lab4Text2: text_asm - ld a, $3 + ld a, TRADE_FOR_SAILOR ld [wWhichTrade], a predef DoInGameTradeDialogue jp TextScriptEnd diff --git a/scripts/CinnabarLabMetronomeRoom.asm b/scripts/CinnabarLabMetronomeRoom.asm index 976a2176..b43f98e2 100755 --- a/scripts/CinnabarLabMetronomeRoom.asm +++ b/scripts/CinnabarLabMetronomeRoom.asm @@ -11,24 +11,24 @@ CinnabarLabMetronomeRoom_TextPointers: Lab3Text1: text_asm CheckEvent EVENT_GOT_TM35 - jr nz, .asm_e551a + jr nz, .got_item ld hl, TM35PreReceiveText call PrintText lb bc, TM_METRONOME, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedTM35Text call PrintText SetEvent EVENT_GOT_TM35 - jr .asm_eb896 -.BagFull + jr .done +.bag_full ld hl, TM35NoRoomText call PrintText - jr .asm_eb896 -.asm_e551a + jr .done +.got_item ld hl, TM35ExplanationText call PrintText -.asm_eb896 +.done jp TextScriptEnd TM35PreReceiveText: diff --git a/scripts/CinnabarLabTradeRoom.asm b/scripts/CinnabarLabTradeRoom.asm index d313c128..1f8710be 100755 --- a/scripts/CinnabarLabTradeRoom.asm +++ b/scripts/CinnabarLabTradeRoom.asm @@ -12,13 +12,13 @@ Lab2Text1: Lab2Text2: text_asm - ld a, $7 + ld a, TRADE_FOR_DORIS ld [wWhichTrade], a jr Lab2DoTrade Lab2Text3: text_asm - ld a, $8 + ld a, TRADE_FOR_CRINKLES ld [wWhichTrade], a Lab2DoTrade: predef DoInGameTradeDialogue diff --git a/scripts/CopycatsHouse2F.asm b/scripts/CopycatsHouse2F.asm index c27043e6..ef0742ab 100755 --- a/scripts/CopycatsHouse2F.asm +++ b/scripts/CopycatsHouse2F.asm @@ -13,34 +13,34 @@ CopycatsHouse2F_TextPointers: CopycatsHouse2FText1: text_asm CheckEvent EVENT_GOT_TM31 - jr nz, .asm_7ccf3 - ld a, $1 + jr nz, .got_item + ld a, TRUE ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, CopycatsHouse2FText_5ccd4 call PrintText ld b, POKE_DOLL call IsItemInBag - jr z, .asm_62ecd + jr z, .done ld hl, TM31PreReceiveText call PrintText lb bc, TM_MIMIC, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedTM31Text call PrintText ld a, POKE_DOLL ldh [hItemToRemoveID], a farcall RemoveItemByID SetEvent EVENT_GOT_TM31 - jr .asm_62ecd -.BagFull + jr .done +.bag_full ld hl, TM31NoRoomText call PrintText - jr .asm_62ecd -.asm_7ccf3 + jr .done +.got_item ld hl, TM31ExplanationText2 call PrintText -.asm_62ecd +.done jp TextScriptEnd CopycatsHouse2FText_5ccd4: diff --git a/scripts/DiglettsCave.asm b/scripts/DiglettsCave.asm index 6746743f..f9f2e590 100755 --- a/scripts/DiglettsCave.asm +++ b/scripts/DiglettsCave.asm @@ -2,4 +2,5 @@ DiglettsCave_Script: jp EnableAutoTextBoxDrawing DiglettsCave_TextPointers: - text_end + + text_end ; unused diff --git a/scripts/FuchsiaGoodRodHouse.asm b/scripts/FuchsiaGoodRodHouse.asm index 848f744c..28f6d056 100755 --- a/scripts/FuchsiaGoodRodHouse.asm +++ b/scripts/FuchsiaGoodRodHouse.asm @@ -7,39 +7,30 @@ FuchsiaGoodRodHouse_TextPointers: FuchsiaHouse3Text1: text_asm ld a, [wd728] - bit 4, a - jr nz, .after - + bit 4, a ; got good rod? + jr nz, .got_item ld hl, FuchsiaHouse3Text_561bd call PrintText - call YesNoChoice ld a, [wCurrentMenuItem] and a jr nz, .refused - lb bc, GOOD_ROD, 1 call GiveItem - jr nc, .full - + jr nc, .bag_full ld hl, wd728 - set 4, [hl] - + set 4, [hl] ; got good rod ld hl, FuchsiaHouse3Text_561c2 - jr .talk - -.full + jr .done +.bag_full ld hl, FuchsiaHouse3Text_5621c - jr .talk - + jr .done .refused ld hl, FuchsiaHouse3Text_56212 - jr .talk - -.after + jr .done +.got_item ld hl, FuchsiaHouse3Text_56217 - -.talk +.done call PrintText jp TextScriptEnd diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm index ded5854f..c933fd63 100755 --- a/scripts/GameCorner.asm +++ b/scripts/GameCorner.asm @@ -90,7 +90,7 @@ MovementData_48c5a: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT - db $FF + db -1 ; end MovementData_48c63: db NPC_MOVEMENT_RIGHT @@ -98,7 +98,7 @@ MovementData_48c63: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT - db $FF + db -1 ; end CeladonGameCornerScript2: ld a, [wd730] diff --git a/scripts/HallOfFame.asm b/scripts/HallOfFame.asm index 35ad9fd8..fd13719b 100755 --- a/scripts/HallOfFame.asm +++ b/scripts/HallOfFame.asm @@ -69,8 +69,8 @@ HallofFameRoomScript0: ret RLEMovement5a528: - db D_UP,$5 - db $ff + db D_UP, 5 + db -1 ; end HallofFameRoomScript1: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/LancesRoom.asm b/scripts/LancesRoom.asm index e1b9a1f2..5c7301ef 100755 --- a/scripts/LancesRoom.asm +++ b/scripts/LancesRoom.asm @@ -78,12 +78,12 @@ LanceScript0: jp LanceShowOrHideEntranceBlocks LanceTriggerMovementCoords: - db $01,$05 - db $02,$06 - db $0B,$05 - db $0B,$06 - db $10,$18 - db $FF + dbmapcoord 5, 1 + dbmapcoord 6, 2 + dbmapcoord 5, 11 + dbmapcoord 6, 11 + dbmapcoord 24, 16 + db -1 ; end LanceScript2: call EndTrainerBattle @@ -110,11 +110,11 @@ WalkToLance: ret WalkToLance_RLEList: - db D_UP, $0C - db D_LEFT, $0C - db D_DOWN, $07 - db D_LEFT, $06 - db $FF + db D_UP, 12 + db D_LEFT, 12 + db D_DOWN, 7 + db D_LEFT, 6 + db -1 ; end LanceScript3: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/LavenderCuboneHouse.asm b/scripts/LavenderCuboneHouse.asm index 45f2f8d8..69d74ede 100755 --- a/scripts/LavenderCuboneHouse.asm +++ b/scripts/LavenderCuboneHouse.asm @@ -16,14 +16,14 @@ LavenderHouse2Text1: LavenderHouse2Text2: text_asm CheckEvent EVENT_RESCUED_MR_FUJI - jr nz, .asm_65711 + jr nz, .rescued_mr_fuji ld hl, LavenderHouse2Text_1d9dc call PrintText - jr .asm_64be1 -.asm_65711 + jr .done +.rescued_mr_fuji ld hl, LavenderHouse2Text_1d9e1 call PrintText -.asm_64be1 +.done jp TextScriptEnd LavenderHouse2Text_1d9dc: diff --git a/scripts/LavenderTown.asm b/scripts/LavenderTown.asm index 7902db45..d0c66208 100755 --- a/scripts/LavenderTown.asm +++ b/scripts/LavenderTown.asm @@ -20,9 +20,9 @@ LavenderTownText1: ld a, [wCurrentMenuItem] and a ld hl, LavenderTownText_44146 - jr nz, .asm_40831 + jr nz, .got_text ld hl, LavenderTownText_44141 -.asm_40831 +.got_text call PrintText jp TextScriptEnd diff --git a/scripts/LoreleisRoom.asm b/scripts/LoreleisRoom.asm index c04da4aa..8e9730ff 100755 --- a/scripts/LoreleisRoom.asm +++ b/scripts/LoreleisRoom.asm @@ -89,11 +89,11 @@ LoreleiScript0: ret LoreleiEntranceCoords: - db $0A,$04 - db $0A,$05 - db $0B,$04 - db $0B,$05 - db $FF + dbmapcoord 4, 10 + dbmapcoord 5, 10 + dbmapcoord 4, 11 + dbmapcoord 5, 11 + db -1 ; end LoreleiScript3: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/MrFujisHouse.asm b/scripts/MrFujisHouse.asm index 88f36e4f..3ef3017a 100755 --- a/scripts/MrFujisHouse.asm +++ b/scripts/MrFujisHouse.asm @@ -13,14 +13,14 @@ MrFujisHouse_TextPointers: LavenderHouse1Text1: text_asm CheckEvent EVENT_RESCUED_MR_FUJI - jr nz, .asm_72e5d + jr nz, .rescued_mr_fuji ld hl, LavenderHouse1Text_1d8d1 call PrintText - jr .asm_6957f -.asm_72e5d + jr .done +.rescued_mr_fuji ld hl, LavenderHouse1Text_1d8d6 call PrintText -.asm_6957f +.done jp TextScriptEnd LavenderHouse1Text_1d8d1: @@ -34,14 +34,14 @@ LavenderHouse1Text_1d8d6: LavenderHouse1Text2: text_asm CheckEvent EVENT_RESCUED_MR_FUJI - jr nz, .asm_06470 + jr nz, .rescued_mr_fuji ld hl, LavenderHouse1Text_1d8f4 call PrintText - jr .asm_3d208 -.asm_06470 + jr .done +.rescued_mr_fuji ld hl, LavenderHouse1Text_1d8f9 call PrintText -.asm_3d208 +.done jp TextScriptEnd LavenderHouse1Text_1d8f4: @@ -69,24 +69,24 @@ LavenderHouse1Text4: LavenderHouse1Text5: text_asm CheckEvent EVENT_GOT_POKE_FLUTE - jr nz, .asm_15ac2 + jr nz, .got_item ld hl, LavenderHouse1Text_1d94c call PrintText lb bc, POKE_FLUTE, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedFluteText call PrintText SetEvent EVENT_GOT_POKE_FLUTE - jr .asm_da749 -.BagFull + jr .done +.bag_full ld hl, FluteNoRoomText call PrintText - jr .asm_da749 -.asm_15ac2 + jr .done +.got_item ld hl, MrFujiAfterFluteText call PrintText -.asm_da749 +.done jp TextScriptEnd LavenderHouse1Text_1d94c: diff --git a/scripts/MrPsychicsHouse.asm b/scripts/MrPsychicsHouse.asm index 1e694772..399edfbd 100755 --- a/scripts/MrPsychicsHouse.asm +++ b/scripts/MrPsychicsHouse.asm @@ -7,24 +7,24 @@ MrPsychicsHouse_TextPointers: SaffronHouse2Text1: text_asm CheckEvent EVENT_GOT_TM29 - jr nz, .asm_9e72b + jr nz, .got_item ld hl, TM29PreReceiveText call PrintText lb bc, TM_PSYCHIC_M, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedTM29Text call PrintText SetEvent EVENT_GOT_TM29 - jr .asm_fe4e1 -.BagFull + jr .done +.bag_full ld hl, TM29NoRoomText call PrintText - jr .asm_fe4e1 -.asm_9e72b + jr .done +.got_item ld hl, TM29ExplanationText call PrintText -.asm_fe4e1 +.done jp TextScriptEnd TM29PreReceiveText: diff --git a/scripts/MtMoonB2F.asm b/scripts/MtMoonB2F.asm index 9ecb8b1c..addfb2c2 100755 --- a/scripts/MtMoonB2F.asm +++ b/scripts/MtMoonB2F.asm @@ -19,23 +19,23 @@ MtMoonB2F_Script: ret CoordsData_49d37: - db $05,$0B - db $05,$0C - db $05,$0D - db $05,$0E - db $06,$0B - db $06,$0C - db $06,$0D - db $06,$0E - db $07,$0B - db $07,$0C - db $07,$0D - db $07,$0E - db $08,$0B - db $08,$0C - db $08,$0D - db $08,$0E - db $FF + dbmapcoord 11, 5 + dbmapcoord 12, 5 + dbmapcoord 13, 5 + dbmapcoord 14, 5 + dbmapcoord 11, 6 + dbmapcoord 12, 6 + dbmapcoord 13, 6 + dbmapcoord 14, 6 + dbmapcoord 11, 7 + dbmapcoord 12, 7 + dbmapcoord 13, 7 + dbmapcoord 14, 7 + dbmapcoord 11, 8 + dbmapcoord 12, 8 + dbmapcoord 13, 8 + dbmapcoord 14, 8 + db -1 ; end MtMoon3Script_49d58: xor a @@ -110,22 +110,22 @@ MtMoon3Script4: ret CoordsData_49dea: - db $07,$0C - db $06,$0B - db $05,$0C - db $FF + dbmapcoord 12, 7 + dbmapcoord 11, 6 + dbmapcoord 12, 5 + db -1 ; end CoordsData_49df1: - db $07,$0D - db $06,$0E - db $05,$0E - db $FF + dbmapcoord 13, 7 + dbmapcoord 14, 6 + dbmapcoord 14, 5 + db -1 ; end MovementData_49df8: db NPC_MOVEMENT_RIGHT - MovementData_49df9: - db NPC_MOVEMENT_UP,$FF + db NPC_MOVEMENT_UP + db -1 ; end MtMoon3Script5: ld a, [wd730] diff --git a/scripts/MtMoonPokecenter.asm b/scripts/MtMoonPokecenter.asm index 3dafd780..e4b881d1 100755 --- a/scripts/MtMoonPokecenter.asm +++ b/scripts/MtMoonPokecenter.asm @@ -11,7 +11,7 @@ MtMoonPokecenter_TextPointers: dw MtMoonTradeNurseText MtMoonHealNurseText: - db $ff + script_pokecenter_nurse MtMoonPokecenterText2: text_far _MtMoonPokecenterText1 diff --git a/scripts/Museum1F.asm b/scripts/Museum1F.asm index caec03be..b7240154 100755 --- a/scripts/Museum1F.asm +++ b/scripts/Museum1F.asm @@ -1,5 +1,5 @@ Museum1F_Script: - ld a, $1 + ld a, TRUE ld [wAutoTextBoxDrawingControl], a xor a ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -188,24 +188,24 @@ Museum1FText_5c251: Museum1FText3: text_asm CheckEvent EVENT_GOT_OLD_AMBER - jr nz, .asm_5c285 + jr nz, .got_item ld hl, Museum1FText_5c28e call PrintText lb bc, OLD_AMBER, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full SetEvent EVENT_GOT_OLD_AMBER ld a, HS_OLD_AMBER ld [wMissableObjectIndex], a predef HideObject ld hl, ReceivedOldAmberText - jr .asm_5c288 -.BagFull + jr .done +.bag_full ld hl, Museum1FText_5c29e - jr .asm_5c288 -.asm_5c285 + jr .done +.got_item ld hl, Museum1FText_5c299 -.asm_5c288 +.done call PrintText jp TextScriptEnd diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm index a2e0bfe8..dbc3b071 100755 --- a/scripts/OaksLab.asm +++ b/scripts/OaksLab.asm @@ -1,7 +1,7 @@ OaksLab_Script: CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 call nz, OaksLabScript_1d076 - ld a, $1 + ld a, TRUE ld [wAutoTextBoxDrawingControl], a xor a ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -60,7 +60,7 @@ OakEntryMovement: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP - db $FF + db -1 ; end OaksLabScript2: ld a, [wd730] @@ -101,8 +101,8 @@ OaksLabScript3: ret PlayerEntryMovementRLE: - db D_UP,$8 - db $ff + db D_UP, 8 + db -1 ; end OaksLabScript4: ld a, [wSimulatedJoypadStatesIndex] @@ -212,14 +212,14 @@ OaksLabScript8: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_UP - db $FF + db -1 ; end .MiddleBallMovement2 db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT - db $FF + db -1 ; end .Squirtle ld de, .RightBallMovement1 @@ -237,7 +237,7 @@ OaksLabScript8: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_UP - db $FF + db -1 ; end .RightBallMovement2 db NPC_MOVEMENT_DOWN @@ -245,7 +245,7 @@ OaksLabScript8: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT - db $FF + db -1 ; end .Bulbasaur ld de, .LeftBallMovement1 @@ -274,10 +274,10 @@ OaksLabScript8: .LeftBallMovement1 db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_RIGHT ; not yet terminated! + db NPC_MOVEMENT_RIGHT .LeftBallMovement2 db NPC_MOVEMENT_RIGHT - db $FF + db -1 ; end .moveBlue ld a, $1 @@ -462,13 +462,13 @@ OaksLabScript13: ret .RivalExitMovement - db $E0 ; change sprite facing direction + db NPC_CHANGE_FACING db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end OaksLabScript14: ld a, [wd730] diff --git a/scripts/PewterCity.asm b/scripts/PewterCity.asm index ec626b8a..f44d2de5 100755 --- a/scripts/PewterCity.asm +++ b/scripts/PewterCity.asm @@ -37,11 +37,11 @@ ENDC jp DisplayTextID CoordsData_19277: - db $11,$23 - db $11,$24 - db $12,$25 - db $13,$25 - db $ff + dbmapcoord 35, 17 + dbmapcoord 36, 17 + dbmapcoord 37, 18 + dbmapcoord 37, 19 + db -1 ; end PewterCityScript1: ld a, [wNPCMovementScriptPointerTableNum] @@ -85,7 +85,7 @@ MovementData_PewterMuseumGuyExit: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end PewterCityScript2: ld a, [wd730] @@ -154,7 +154,7 @@ MovementData_PewterGymGuyExit: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT - db $FF + db -1 ; end PewterCityScript5: ld a, [wd730] diff --git a/scripts/PewterMart.asm b/scripts/PewterMart.asm index b2ae5a11..2b732129 100755 --- a/scripts/PewterMart.asm +++ b/scripts/PewterMart.asm @@ -1,6 +1,6 @@ PewterMart_Script: call EnableAutoTextBoxDrawing - ld a, $1 + ld a, TRUE ld [wAutoTextBoxDrawingControl], a ret diff --git a/scripts/PewterPokecenter.asm b/scripts/PewterPokecenter.asm index 1c626541..5030244c 100755 --- a/scripts/PewterPokecenter.asm +++ b/scripts/PewterPokecenter.asm @@ -17,14 +17,16 @@ PewterPokecenterText2: PewterJigglypuffText: text_asm - ld a, $1 + ld a, TRUE ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld hl, .Text + ld hl, .JigglypuffText call PrintText + ld a, SFX_STOP_ALL_MUSIC call PlaySound ld c, 32 call DelayFrames + ld hl, JigglypuffFacingDirections ld de, wJigglypuffFacingDirections ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections @@ -37,15 +39,16 @@ PewterJigglypuffText: inc hl jr nz, .findMatchingFacingDirectionLoop dec hl + push hl ld c, BANK(Music_JigglypuffSong) ld a, MUSIC_JIGGLYPUFF_SONG call PlayMusic pop hl -.loop + +.spinMovementLoop ld a, [hl] ld [wSprite03StateData1ImageIndex], a - ; rotate the array push hl ld hl, wJigglypuffFacingDirections @@ -55,22 +58,20 @@ PewterJigglypuffText: ld a, [wJigglypuffFacingDirections - 1] ld [wJigglypuffFacingDirections + 3], a pop hl - ld c, 24 call DelayFrames - ld a, [wChannelSoundIDs] ld b, a ld a, [wChannelSoundIDs + Ch2] or b - jr nz, .loop + jr nz, .spinMovementLoop ld c, 48 call DelayFrames call PlayDefaultMusic jp TextScriptEnd -.Text +.JigglypuffText: text_far _PewterJigglypuffText text_end diff --git a/scripts/PokemonFanClub.asm b/scripts/PokemonFanClub.asm index 62a5ce84..717ba4bb 100755 --- a/scripts/PokemonFanClub.asm +++ b/scripts/PokemonFanClub.asm @@ -115,12 +115,12 @@ FanClubText5: call PrintText lb bc, BIKE_VOUCHER, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, .receivedvouchertext call PrintText SetEvent EVENT_GOT_BIKE_VOUCHER jr .done -.BagFull +.bag_full ld hl, .bagfulltext call PrintText jr .done diff --git a/scripts/PokemonMansion3F.asm b/scripts/PokemonMansion3F.asm index f8fbdf52..0f62d6e0 100755 --- a/scripts/PokemonMansion3F.asm +++ b/scripts/PokemonMansion3F.asm @@ -51,10 +51,10 @@ Mansion3Script0: ret CoordsData_52254: - db $0E,$10 - db $0E,$11 - db $0E,$13 - db $FF + dbmapcoord 16, 14 + dbmapcoord 17, 14 + dbmapcoord 19, 14 + db -1 ; end Mansion3Script_5225b: xor a diff --git a/scripts/PokemonTower2F.asm b/scripts/PokemonTower2F.asm index 5ab85c2d..b3d7a1cb 100755 --- a/scripts/PokemonTower2F.asm +++ b/scripts/PokemonTower2F.asm @@ -58,9 +58,9 @@ ENDC ret CoordsData_6055e: - db $05,$0F - db $06,$0E - db $0F ; isn't this supposed to end in $ff? + dbmapcoord 15, 5 + dbmapcoord 14, 6 + db $0F ; end? (should be $ff?) PokemonTower2Script1: ld a, [wIsInBattle] @@ -98,7 +98,7 @@ MovementData_605a9: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT - db $FF + db -1 ; end MovementData_605b2: db NPC_MOVEMENT_DOWN @@ -109,7 +109,7 @@ MovementData_605b2: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end PokemonTower2Script2: ld a, [wd730] diff --git a/scripts/PokemonTower5F.asm b/scripts/PokemonTower5F.asm index 01d71755..10189a8e 100755 --- a/scripts/PokemonTower5F.asm +++ b/scripts/PokemonTower5F.asm @@ -42,11 +42,11 @@ PokemonTower5Script0: ret CoordsData_60992: - db $08,$0A - db $08,$0B - db $09,$0A - db $09,$0B - db $FF + dbmapcoord 10, 8 + dbmapcoord 11, 8 + dbmapcoord 10, 9 + dbmapcoord 11, 9 + db -1 ; end PokemonTower5F_TextPointers: dw PokemonTower5Text1 diff --git a/scripts/PokemonTower6F.asm b/scripts/PokemonTower6F.asm index 3c9e1f1d..11091e85 100755 --- a/scripts/PokemonTower6F.asm +++ b/scripts/PokemonTower6F.asm @@ -42,7 +42,8 @@ PokemonTower6Script0: ret CoordsData_60b45: - db $10,$0A,$FF + dbmapcoord 10, 16 + db -1 ; end PokemonTower6Script4: ld a, [wIsInBattle] diff --git a/scripts/PokemonTower7F.asm b/scripts/PokemonTower7F.asm index 91022ce4..e098b95f 100755 --- a/scripts/PokemonTower7F.asm +++ b/scripts/PokemonTower7F.asm @@ -117,30 +117,18 @@ PokemonTower7Script_60db6: jr .asm_60dcb CoordsData_60de3: - db $0C,$09 - dw MovementData_60e13 - db $0B,$0A - dw MovementData_60e1b - db $0B,$0B - dw MovementData_60e22 - db $0B,$0C - dw MovementData_60e22 - db $0A,$0C - dw MovementData_60e28 - db $09,$0B - dw MovementData_60e30 - db $09,$0A - dw MovementData_60e22 - db $09,$09 - dw MovementData_60e22 - db $08,$09 - dw MovementData_60e37 - db $07,$0A - dw MovementData_60e22 - db $07,$0B - dw MovementData_60e22 - db $07,$0C - dw MovementData_60e22 + map_coord_movement 9, 12, MovementData_60e13 + map_coord_movement 10, 11, MovementData_60e1b + map_coord_movement 11, 11, MovementData_60e22 + map_coord_movement 12, 11, MovementData_60e22 + map_coord_movement 12, 10, MovementData_60e28 + map_coord_movement 11, 9, MovementData_60e30 + map_coord_movement 10, 9, MovementData_60e22 + map_coord_movement 9, 9, MovementData_60e22 + map_coord_movement 9, 8, MovementData_60e37 + map_coord_movement 10, 7, MovementData_60e22 + map_coord_movement 11, 7, MovementData_60e22 + map_coord_movement 12, 7, MovementData_60e22 MovementData_60e13: db NPC_MOVEMENT_RIGHT @@ -150,7 +138,7 @@ MovementData_60e13: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_LEFT - db $FF + db -1 ; end MovementData_60e1b: db NPC_MOVEMENT_DOWN @@ -159,7 +147,7 @@ MovementData_60e1b: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end MovementData_60e22: db NPC_MOVEMENT_DOWN @@ -167,7 +155,7 @@ MovementData_60e22: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end MovementData_60e28: db NPC_MOVEMENT_LEFT @@ -177,7 +165,7 @@ MovementData_60e28: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end MovementData_60e30: db NPC_MOVEMENT_DOWN @@ -186,7 +174,7 @@ MovementData_60e30: db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end MovementData_60e37: db NPC_MOVEMENT_RIGHT @@ -196,7 +184,7 @@ MovementData_60e37: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end PokemonTower7F_TextPointers: dw PokemonTower7Text1 diff --git a/scripts/RedsHouse1F.asm b/scripts/RedsHouse1F.asm index 9f45a760..bdeb96d7 100755 --- a/scripts/RedsHouse1F.asm +++ b/scripts/RedsHouse1F.asm @@ -2,14 +2,14 @@ RedsHouse1F_Script: jp EnableAutoTextBoxDrawing RedsHouse1F_TextPointers: - dw RedsHouse1FText1 - dw RedsHouse1FText2 + dw RedsHouse1FMomText + dw RedsHouse1FTVText -RedsHouse1FText1: ; Mom +RedsHouse1FMomText: text_asm ld a, [wd72e] - bit 3, a - jr nz, .heal ; if player has received a Pokémon from Oak, heal team + bit 3, a ; received a Pokémon from Oak? + jr nz, .heal ld hl, MomWakeUpText call PrintText jr .done @@ -49,14 +49,14 @@ MomHealText2: text_far _MomHealText2 text_end -RedsHouse1FText2: ; TV +RedsHouse1FTVText: text_asm ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP ld hl, TVWrongSideText - jr nz, .notUp + jr nz, .got_text ld hl, StandByMeText -.notUp +.got_text call PrintText jp TextScriptEnd diff --git a/scripts/RedsHouse2F.asm b/scripts/RedsHouse2F.asm index 2e3463ee..b44b9f98 100755 --- a/scripts/RedsHouse2F.asm +++ b/scripts/RedsHouse2F.asm @@ -21,4 +21,5 @@ RedsHouse2FScript1: ret RedsHouse2F_TextPointers: - text_end + + text_end ; unused diff --git a/scripts/RockTunnelPokecenter.asm b/scripts/RockTunnelPokecenter.asm index 999edf13..755bb8f8 100755 --- a/scripts/RockTunnelPokecenter.asm +++ b/scripts/RockTunnelPokecenter.asm @@ -9,7 +9,7 @@ RockTunnelPokecenter_TextPointers: dw RockTunnelTradeNurseText RockTunnelHealNurseText: - db $ff + script_pokecenter_nurse RockTunnelPokecenterText2: text_far _RockTunnelPokecenterText2 @@ -20,4 +20,4 @@ RockTunnelPokecenterText3: text_end RockTunnelTradeNurseText: - db $f6 + script_cable_club_receptionist diff --git a/scripts/RocketHideoutB2F.asm b/scripts/RocketHideoutB2F.asm index 85f26c31..d6fae24f 100755 --- a/scripts/RocketHideoutB2F.asm +++ b/scripts/RocketHideoutB2F.asm @@ -33,273 +33,227 @@ RocketHideout2Script0: ld [wCurMapScript], a ret -;format: -;db y,x -;dw pointer to movement RocketHideout2ArrowTilePlayerMovement: - db $9,$4 - dw RocketHideout2ArrowMovement1 - db $b,$4 - dw RocketHideout2ArrowMovement2 - db $f,$4 - dw RocketHideout2ArrowMovement3 - db $10,$4 - dw RocketHideout2ArrowMovement4 - db $13,$4 - dw RocketHideout2ArrowMovement1 - db $16,$4 - dw RocketHideout2ArrowMovement5 - db $e,$5 - dw RocketHideout2ArrowMovement6 - db $16,$6 - dw RocketHideout2ArrowMovement7 - db $18,$6 - dw RocketHideout2ArrowMovement8 - db $9,$8 - dw RocketHideout2ArrowMovement9 - db $c,$8 - dw RocketHideout2ArrowMovement10 - db $f,$8 - dw RocketHideout2ArrowMovement8 - db $13,$8 - dw RocketHideout2ArrowMovement9 - db $17,$8 - dw RocketHideout2ArrowMovement11 - db $e,$9 - dw RocketHideout2ArrowMovement12 - db $16,$9 - dw RocketHideout2ArrowMovement12 - db $9,$a - dw RocketHideout2ArrowMovement13 - db $a,$a - dw RocketHideout2ArrowMovement14 - db $f,$a - dw RocketHideout2ArrowMovement15 - db $11,$a - dw RocketHideout2ArrowMovement16 - db $13,$a - dw RocketHideout2ArrowMovement17 - db $19,$a - dw RocketHideout2ArrowMovement2 - db $e,$b - dw RocketHideout2ArrowMovement18 - db $10,$b - dw RocketHideout2ArrowMovement19 - db $12,$b - dw RocketHideout2ArrowMovement12 - db $9,$c - dw RocketHideout2ArrowMovement20 - db $b,$c - dw RocketHideout2ArrowMovement21 - db $d,$c - dw RocketHideout2ArrowMovement22 - db $11,$c - dw RocketHideout2ArrowMovement23 - db $a,$d - dw RocketHideout2ArrowMovement24 - db $c,$d - dw RocketHideout2ArrowMovement25 - db $10,$d - dw RocketHideout2ArrowMovement26 - db $12,$d - dw RocketHideout2ArrowMovement27 - db $13,$d - dw RocketHideout2ArrowMovement28 - db $16,$d - dw RocketHideout2ArrowMovement29 - db $17,$d - dw RocketHideout2ArrowMovement30 - db $11,$e - dw RocketHideout2ArrowMovement31 - db $10,$f - dw RocketHideout2ArrowMovement12 - db $e,$10 - dw RocketHideout2ArrowMovement32 - db $10,$10 - dw RocketHideout2ArrowMovement33 - db $12,$10 - dw RocketHideout2ArrowMovement34 - db $a,$11 - dw RocketHideout2ArrowMovement35 - db $b,$11 - dw RocketHideout2ArrowMovement36 - db $FF + map_coord_movement 4, 9, RocketHideout2ArrowMovement1 + map_coord_movement 4, 11, RocketHideout2ArrowMovement2 + map_coord_movement 4, 15, RocketHideout2ArrowMovement3 + map_coord_movement 4, 16, RocketHideout2ArrowMovement4 + map_coord_movement 4, 19, RocketHideout2ArrowMovement1 + map_coord_movement 4, 22, RocketHideout2ArrowMovement5 + map_coord_movement 5, 14, RocketHideout2ArrowMovement6 + map_coord_movement 6, 22, RocketHideout2ArrowMovement7 + map_coord_movement 6, 24, RocketHideout2ArrowMovement8 + map_coord_movement 8, 9, RocketHideout2ArrowMovement9 + map_coord_movement 8, 12, RocketHideout2ArrowMovement10 + map_coord_movement 8, 15, RocketHideout2ArrowMovement8 + map_coord_movement 8, 19, RocketHideout2ArrowMovement9 + map_coord_movement 8, 23, RocketHideout2ArrowMovement11 + map_coord_movement 9, 14, RocketHideout2ArrowMovement12 + map_coord_movement 9, 22, RocketHideout2ArrowMovement12 + map_coord_movement 10, 9, RocketHideout2ArrowMovement13 + map_coord_movement 10, 10, RocketHideout2ArrowMovement14 + map_coord_movement 10, 15, RocketHideout2ArrowMovement15 + map_coord_movement 10, 17, RocketHideout2ArrowMovement16 + map_coord_movement 10, 19, RocketHideout2ArrowMovement17 + map_coord_movement 10, 25, RocketHideout2ArrowMovement2 + map_coord_movement 11, 14, RocketHideout2ArrowMovement18 + map_coord_movement 11, 16, RocketHideout2ArrowMovement19 + map_coord_movement 11, 18, RocketHideout2ArrowMovement12 + map_coord_movement 12, 9, RocketHideout2ArrowMovement20 + map_coord_movement 12, 11, RocketHideout2ArrowMovement21 + map_coord_movement 12, 13, RocketHideout2ArrowMovement22 + map_coord_movement 12, 17, RocketHideout2ArrowMovement23 + map_coord_movement 13, 10, RocketHideout2ArrowMovement24 + map_coord_movement 13, 12, RocketHideout2ArrowMovement25 + map_coord_movement 13, 16, RocketHideout2ArrowMovement26 + map_coord_movement 13, 18, RocketHideout2ArrowMovement27 + map_coord_movement 13, 19, RocketHideout2ArrowMovement28 + map_coord_movement 13, 22, RocketHideout2ArrowMovement29 + map_coord_movement 13, 23, RocketHideout2ArrowMovement30 + map_coord_movement 14, 17, RocketHideout2ArrowMovement31 + map_coord_movement 15, 16, RocketHideout2ArrowMovement12 + map_coord_movement 16, 14, RocketHideout2ArrowMovement32 + map_coord_movement 16, 16, RocketHideout2ArrowMovement33 + map_coord_movement 16, 18, RocketHideout2ArrowMovement34 + map_coord_movement 17, 10, RocketHideout2ArrowMovement35 + map_coord_movement 17, 11, RocketHideout2ArrowMovement36 + db -1 ; end ;format: direction, count ;each list is read starting from the $FF and working backwards RocketHideout2ArrowMovement1: - db D_LEFT,$02 - db $FF + db D_LEFT, 2 + db -1 ; end RocketHideout2ArrowMovement2: - db D_RIGHT,$04 - db $FF + db D_RIGHT, 4 + db -1 ; end RocketHideout2ArrowMovement3: - db D_UP,$04 - db D_RIGHT,$04 - db $FF + db D_UP, 4 + db D_RIGHT, 4 + db -1 ; end RocketHideout2ArrowMovement4: - db D_UP,$04 - db D_RIGHT,$04 - db D_UP,$01 - db $FF + db D_UP, 4 + db D_RIGHT, 4 + db D_UP, 1 + db -1 ; end RocketHideout2ArrowMovement5: - db D_LEFT,$02 - db D_UP,$03 - db $FF + db D_LEFT, 2 + db D_UP, 3 + db -1 ; end RocketHideout2ArrowMovement6: - db D_DOWN,$02 - db D_RIGHT,$04 - db $FF + db D_DOWN, 2 + db D_RIGHT, 4 + db -1 ; end RocketHideout2ArrowMovement7: - db D_UP,$02 - db $FF + db D_UP, 2 + db -1 ; end RocketHideout2ArrowMovement8: - db D_UP,$04 - db $FF + db D_UP, 4 + db -1 ; end RocketHideout2ArrowMovement9: - db D_LEFT,$06 - db $FF + db D_LEFT, 6 + db -1 ; end RocketHideout2ArrowMovement10: - db D_UP,$01 - db $FF + db D_UP, 1 + db -1 ; end RocketHideout2ArrowMovement11: - db D_LEFT,$06 - db D_UP,$04 - db $FF + db D_LEFT, 6 + db D_UP, 4 + db -1 ; end RocketHideout2ArrowMovement12: - db D_DOWN,$02 - db $FF + db D_DOWN, 2 + db -1 ; end RocketHideout2ArrowMovement13: - db D_LEFT,$08 - db $FF + db D_LEFT, 8 + db -1 ; end RocketHideout2ArrowMovement14: - db D_LEFT,$08 - db D_UP,$01 - db $FF + db D_LEFT, 8 + db D_UP, 1 + db -1 ; end RocketHideout2ArrowMovement15: - db D_LEFT,$08 - db D_UP,$06 - db $FF + db D_LEFT, 8 + db D_UP, 6 + db -1 ; end RocketHideout2ArrowMovement16: - db D_UP,$02 - db D_RIGHT,$04 - db $FF + db D_UP, 2 + db D_RIGHT, 4 + db -1 ; end RocketHideout2ArrowMovement17: - db D_UP,$02 - db D_RIGHT,$04 - db D_UP,$02 - db $FF + db D_UP, 2 + db D_RIGHT, 4 + db D_UP, 2 + db -1 ; end RocketHideout2ArrowMovement18: - db D_DOWN,$02 - db D_RIGHT,$04 - db D_DOWN,$02 - db $FF + db D_DOWN, 2 + db D_RIGHT, 4 + db D_DOWN, 2 + db -1 ; end RocketHideout2ArrowMovement19: - db D_DOWN,$02 - db D_RIGHT,$04 - db $FF + db D_DOWN, 2 + db D_RIGHT, 4 + db -1 ; end RocketHideout2ArrowMovement20: - db D_LEFT,$0A - db $FF + db D_LEFT, 10 + db -1 ; end RocketHideout2ArrowMovement21: - db D_LEFT,$0A - db D_UP,$02 - db $FF + db D_LEFT, 10 + db D_UP, 2 + db -1 ; end RocketHideout2ArrowMovement22: - db D_LEFT,$0A - db D_UP,$04 - db $FF + db D_LEFT, 10 + db D_UP, 4 + db -1 ; end RocketHideout2ArrowMovement23: - db D_UP,$02 - db D_RIGHT,$02 - db $FF + db D_UP, 2 + db D_RIGHT, 2 + db -1 ; end RocketHideout2ArrowMovement24: - db D_RIGHT,$01 - db D_DOWN,$02 - db $FF + db D_RIGHT, 1 + db D_DOWN, 2 + db -1 ; end RocketHideout2ArrowMovement25: - db D_RIGHT,$01 - db $FF + db D_RIGHT, 1 + db -1 ; end RocketHideout2ArrowMovement26: - db D_DOWN,$02 - db D_RIGHT,$02 - db $FF + db D_DOWN, 2 + db D_RIGHT, 2 + db -1 ; end RocketHideout2ArrowMovement27: - db D_DOWN,$02 - db D_LEFT,$02 - db $FF + db D_DOWN, 2 + db D_LEFT, 2 + db -1 ; end RocketHideout2ArrowMovement28: - db D_UP,$02 - db D_RIGHT,$04 - db D_UP,$02 - db D_LEFT,$03 - db $FF + db D_UP, 2 + db D_RIGHT, 4 + db D_UP, 2 + db D_LEFT, 3 + db -1 ; end RocketHideout2ArrowMovement29: - db D_DOWN,$02 - db D_LEFT,$04 - db $FF + db D_DOWN, 2 + db D_LEFT, 4 + db -1 ; end RocketHideout2ArrowMovement30: - db D_LEFT,$06 - db D_UP,$04 - db D_LEFT,$05 - db $FF + db D_LEFT, 6 + db D_UP, 4 + db D_LEFT, 5 + db -1 ; end RocketHideout2ArrowMovement31: - db D_UP,$02 - db $FF + db D_UP, 2 + db -1 ; end RocketHideout2ArrowMovement32: - db D_UP,$01 - db $FF + db D_UP, 1 + db -1 ; end RocketHideout2ArrowMovement33: - db D_UP,$03 - db $FF + db D_UP, 3 + db -1 ; end RocketHideout2ArrowMovement34: - db D_UP,$05 - db $FF + db D_UP, 5 + db -1 ; end RocketHideout2ArrowMovement35: - db D_RIGHT,$01 - db D_DOWN,$02 - db D_LEFT,$04 - db $FF + db D_RIGHT, 1 + db D_DOWN, 2 + db D_LEFT, 4 + db -1 ; end RocketHideout2ArrowMovement36: - db D_LEFT,$0A - db D_UP,$02 - db D_LEFT,$05 - db $FF + db D_LEFT, 10 + db D_UP, 2 + db D_LEFT, 5 + db -1 ; end RocketHideout2Script3: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/RocketHideoutB3F.asm b/scripts/RocketHideoutB3F.asm index 3a8b2290..88876f04 100755 --- a/scripts/RocketHideoutB3F.asm +++ b/scripts/RocketHideoutB3F.asm @@ -33,103 +33,84 @@ RocketHideout3Script0: ld [wCurMapScript], a ret -;format: -;db y,x -;dw pointer to movement RocketHideout3ArrowTilePlayerMovement: - db $d,$a - dw RocketHideout3ArrowMovement6 - db $13,$a - dw RocketHideout3ArrowMovement1 - db $12,$b - dw RocketHideout3ArrowMovement2 - db $b,$c - dw RocketHideout3ArrowMovement3 - db $11,$c - dw RocketHideout3ArrowMovement4 - db $14,$c - dw RocketHideout3ArrowMovement5 - db $10,$d - dw RocketHideout3ArrowMovement6 - db $b,$e - dw RocketHideout3ArrowMovement7 - db $f,$e - dw RocketHideout3ArrowMovement6 - db $11,$e - dw RocketHideout3ArrowMovement8 - db $13,$e - dw RocketHideout3ArrowMovement9 - db $10,$f - dw RocketHideout3ArrowMovement7 - db $12,$f - dw RocketHideout3ArrowMovement10 - db $d,$10 - dw RocketHideout3ArrowMovement11 - db $c,$11 - dw RocketHideout3ArrowMovement10 - db $10,$12 - dw RocketHideout3ArrowMovement12 - db $FF + map_coord_movement 10, 13, RocketHideout3ArrowMovement6 + map_coord_movement 10, 19, RocketHideout3ArrowMovement1 + map_coord_movement 11, 18, RocketHideout3ArrowMovement2 + map_coord_movement 12, 11, RocketHideout3ArrowMovement3 + map_coord_movement 12, 17, RocketHideout3ArrowMovement4 + map_coord_movement 12, 20, RocketHideout3ArrowMovement5 + map_coord_movement 13, 16, RocketHideout3ArrowMovement6 + map_coord_movement 14, 11, RocketHideout3ArrowMovement7 + map_coord_movement 14, 15, RocketHideout3ArrowMovement6 + map_coord_movement 14, 17, RocketHideout3ArrowMovement8 + map_coord_movement 14, 19, RocketHideout3ArrowMovement9 + map_coord_movement 15, 16, RocketHideout3ArrowMovement7 + map_coord_movement 15, 18, RocketHideout3ArrowMovement10 + map_coord_movement 16, 13, RocketHideout3ArrowMovement11 + map_coord_movement 17, 12, RocketHideout3ArrowMovement10 + map_coord_movement 18, 16, RocketHideout3ArrowMovement12 + db -1 ; end ;format: direction, count ;each list is read starting from the $FF and working backwards RocketHideout3ArrowMovement1: - db D_RIGHT,$04 - db D_UP,$04 - db D_RIGHT,$04 - db $FF + db D_RIGHT, 4 + db D_UP, 4 + db D_RIGHT, 4 + db -1 ; end RocketHideout3ArrowMovement2: - db D_DOWN,$04 - db D_RIGHT,$04 - db $FF + db D_DOWN, 4 + db D_RIGHT, 4 + db -1 ; end RocketHideout3ArrowMovement3: - db D_LEFT,$02 - db $FF + db D_LEFT, 2 + db -1 ; end RocketHideout3ArrowMovement4: - db D_RIGHT,$04 - db D_UP,$02 - db D_RIGHT,$02 - db $FF + db D_RIGHT, 4 + db D_UP, 2 + db D_RIGHT, 2 + db -1 ; end RocketHideout3ArrowMovement5: - db D_RIGHT,$04 - db D_UP,$02 - db D_RIGHT,$02 - db D_UP,$03 - db $FF + db D_RIGHT, 4 + db D_UP, 2 + db D_RIGHT, 2 + db D_UP, 3 + db -1 ; end RocketHideout3ArrowMovement6: - db D_RIGHT,$04 - db $FF + db D_RIGHT, 4 + db -1 ; end RocketHideout3ArrowMovement7: - db D_RIGHT,$02 - db $FF + db D_RIGHT, 2 + db -1 ; end RocketHideout3ArrowMovement8: - db D_RIGHT,$04 - db D_UP,$02 - db $FF + db D_RIGHT, 4 + db D_UP, 2 + db -1 ; end RocketHideout3ArrowMovement9: - db D_RIGHT,$04 - db D_UP,$04 - db $FF + db D_RIGHT, 4 + db D_UP, 4 + db -1 ; end RocketHideout3ArrowMovement10: - db D_DOWN,$04 - db $FF + db D_DOWN, 4 + db -1 ; end RocketHideout3ArrowMovement11: - db D_UP,$02 - db $FF + db D_UP, 2 + db -1 ; end RocketHideout3ArrowMovement12: - db D_UP,$01 - db $FF + db D_UP, 1 + db -1 ; end RocketHideout3Script3: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/RocketHideoutElevator.asm b/scripts/RocketHideoutElevator.asm index 45b27e3b..8c51294e 100755 --- a/scripts/RocketHideoutElevator.asm +++ b/scripts/RocketHideoutElevator.asm @@ -41,19 +41,18 @@ RocketHideoutElevatorScript_45741: ret RocketHideoutElavatorFloors: - db $03 ; num elements in list + db 3 ; # db FLOOR_B1F db FLOOR_B2F db FLOOR_B4F - db $FF ; terminator + db -1 ; end -RocketHideoutElevatorWarpMaps: -; first byte is warp number -; second byte is map number ; These specify where the player goes after getting out of the elevator. - db $04, ROCKET_HIDEOUT_B1F - db $04, ROCKET_HIDEOUT_B2F - db $02, ROCKET_HIDEOUT_B4F +RocketHideoutElevatorWarpMaps: + ; warp number, map id + db 4, ROCKET_HIDEOUT_B1F + db 4, ROCKET_HIDEOUT_B2F + db 2, ROCKET_HIDEOUT_B4F RocketHideoutElevatorWarpMapsEnd: RocketHideoutElevatorScript_4575f: diff --git a/scripts/Route1.asm b/scripts/Route1.asm index 3aa948c7..bd9afea3 100755 --- a/scripts/Route1.asm +++ b/scripts/Route1.asm @@ -9,20 +9,20 @@ Route1_TextPointers: Route1Text1: text_asm CheckAndSetEvent EVENT_GOT_POTION_SAMPLE - jr nz, .asm_1cada + jr nz, .got_item ld hl, Route1ViridianMartSampleText call PrintText lb bc, POTION, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, Route1Text_1cae8 - jr .asm_1cadd -.BagFull + jr .done +.bag_full ld hl, Route1Text_1caf3 - jr .asm_1cadd -.asm_1cada + jr .done +.got_item ld hl, Route1Text_1caee -.asm_1cadd +.done call PrintText jp TextScriptEnd diff --git a/scripts/Route11Gate2F.asm b/scripts/Route11Gate2F.asm index 1797c540..47c8db22 100755 --- a/scripts/Route11Gate2F.asm +++ b/scripts/Route11Gate2F.asm @@ -9,7 +9,7 @@ Route11Gate2F_TextPointers: Route11GateUpstairsText1: text_asm - xor a + xor a ; TRADE_FOR_TERRY ld [wWhichTrade], a predef DoInGameTradeDialogue Route11GateUpstairsScriptEnd: @@ -18,10 +18,10 @@ Route11GateUpstairsScriptEnd: Route11GateUpstairsText2: text_asm CheckEvent EVENT_GOT_ITEMFINDER, 1 - jr c, .asm_4949b - ld a, 30 ; pokemon needed + jr c, .got_item + ld a, 30 ldh [hOaksAideRequirement], a - ld a, ITEMFINDER ; oak's aide reward + ld a, ITEMFINDER ldh [hOaksAideRewardItem], a ld [wd11e], a call GetItemName @@ -32,13 +32,13 @@ Route11GateUpstairsText2: call CopyData predef OaksAideScript ldh a, [hOaksAideResult] - dec a - jr nz, .asm_494a1 + dec a ; OAKS_AIDE_GOT_ITEM? + jr nz, .no_item SetEvent EVENT_GOT_ITEMFINDER -.asm_4949b +.got_item ld hl, Route11GateUpstairsText_494a3 call PrintText -.asm_494a1 +.no_item jr Route11GateUpstairsScriptEnd Route11GateUpstairsText_494a3: diff --git a/scripts/Route12Gate2F.asm b/scripts/Route12Gate2F.asm index a7e426c9..2174fba8 100755 --- a/scripts/Route12Gate2F.asm +++ b/scripts/Route12Gate2F.asm @@ -9,24 +9,24 @@ Route12Gate2F_TextPointers: Route12GateUpstairsText1: text_asm CheckEvent EVENT_GOT_TM39, 1 - jr c, .asm_0ad3c + jr c, .got_item ld hl, TM39PreReceiveText call PrintText lb bc, TM_SWIFT, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedTM39Text call PrintText SetEvent EVENT_GOT_TM39 - jr .asm_4ba56 -.BagFull + jr .done +.bag_full ld hl, TM39NoRoomText call PrintText - jr .asm_4ba56 -.asm_0ad3c + jr .done +.got_item ld hl, TM39ExplanationText call PrintText -.asm_4ba56 +.done jp TextScriptEnd TM39PreReceiveText: @@ -68,7 +68,7 @@ GateUpstairsScript_PrintIfFacingUp: ld a, [wSpritePlayerStateData1FacingDirection] cp SPRITE_FACING_UP jr z, .up - ld a, $1 + ld a, TRUE jr .done .up call PrintText diff --git a/scripts/Route12SuperRodHouse.asm b/scripts/Route12SuperRodHouse.asm index 6cc1602c..fba5426e 100755 --- a/scripts/Route12SuperRodHouse.asm +++ b/scripts/Route12SuperRodHouse.asm @@ -7,30 +7,30 @@ Route12SuperRodHouse_TextPointers: Route12HouseText1: text_asm ld a, [wd728] - bit 5, a - jr nz, .asm_b4cad + bit 5, a ; received super rod? + jr nz, .got_item ld hl, Route12HouseText_564c0 call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_a2d76 + jr nz, .refused lb bc, SUPER_ROD, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, wd728 - set 5, [hl] + set 5, [hl] ; received super rod ld hl, Route12HouseText_564c5 - jr .asm_df984 -.BagFull + jr .done +.bag_full ld hl, Route12HouseText_564d9 - jr .asm_df984 -.asm_a2d76 + jr .done +.refused ld hl, Route12HouseText_564cf - jr .asm_df984 -.asm_b4cad + jr .done +.got_item ld hl, Route12HouseText_564d4 -.asm_df984 +.done call PrintText jp TextScriptEnd diff --git a/scripts/Route15Gate2F.asm b/scripts/Route15Gate2F.asm index 9887fbc1..1b85e34e 100755 --- a/scripts/Route15Gate2F.asm +++ b/scripts/Route15Gate2F.asm @@ -8,10 +8,10 @@ Route15Gate2F_TextPointers: Route15GateUpstairsText1: text_asm CheckEvent EVENT_GOT_EXP_ALL - jr nz, .asm_49683 - ld a, 50 ; pokemon needed + jr nz, .got_item + ld a, 50 ldh [hOaksAideRequirement], a - ld a, EXP_ALL ; oak's aide reward + ld a, EXP_ALL ldh [hOaksAideRewardItem], a ld [wd11e], a call GetItemName @@ -21,13 +21,13 @@ Route15GateUpstairsText1: call CopyData predef OaksAideScript ldh a, [hOaksAideResult] - cp $1 - jr nz, .asm_49689 + cp OAKS_AIDE_GOT_ITEM + jr nz, .no_item SetEvent EVENT_GOT_EXP_ALL -.asm_49683 +.got_item ld hl, Route15GateUpstairsText_4968c call PrintText -.asm_49689 +.no_item jp TextScriptEnd Route15GateUpstairsText_4968c: diff --git a/scripts/Route16FlyHouse.asm b/scripts/Route16FlyHouse.asm index d5b0350a..3bb34b75 100755 --- a/scripts/Route16FlyHouse.asm +++ b/scripts/Route16FlyHouse.asm @@ -9,18 +9,18 @@ Route16HouseText1: text_asm CheckEvent EVENT_GOT_HM02 ld hl, HM02ExplanationText - jr nz, .asm_13616 + jr nz, .got_item ld hl, Route16HouseText3 call PrintText lb bc, HM_FLY, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full SetEvent EVENT_GOT_HM02 ld hl, ReceivedHM02Text - jr .asm_13616 -.BagFull + jr .got_item +.bag_full ld hl, HM02NoRoomText -.asm_13616 +.got_item call PrintText jp TextScriptEnd diff --git a/scripts/Route16Gate1F.asm b/scripts/Route16Gate1F.asm index 5bb77075..e992fa44 100755 --- a/scripts/Route16Gate1F.asm +++ b/scripts/Route16Gate1F.asm @@ -44,11 +44,11 @@ Route16GateScript0: ret CoordsData_49714: - db $07,$04 - db $08,$04 - db $09,$04 - db $0A,$04 - db $FF + dbmapcoord 4, 7 + dbmapcoord 4, 8 + dbmapcoord 4, 9 + dbmapcoord 4, 10 + db -1 ; end Route16GateScript1: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/Route18Gate1F.asm b/scripts/Route18Gate1F.asm index ea8783df..2caeaedd 100755 --- a/scripts/Route18Gate1F.asm +++ b/scripts/Route18Gate1F.asm @@ -44,11 +44,11 @@ Route18GateScript0: ret CoordsData_498cc: - db $03,$04 - db $04,$04 - db $05,$04 - db $06,$04 - db $FF + dbmapcoord 4, 3 + dbmapcoord 4, 4 + dbmapcoord 4, 5 + dbmapcoord 4, 6 + db -1 ; end Route18GateScript1: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/Route18Gate2F.asm b/scripts/Route18Gate2F.asm index d7511859..efb6d70a 100755 --- a/scripts/Route18Gate2F.asm +++ b/scripts/Route18Gate2F.asm @@ -8,7 +8,7 @@ Route18Gate2F_TextPointers: Route18GateUpstairsText1: text_asm - ld a, $5 + ld a, TRADE_FOR_MARC ld [wWhichTrade], a predef DoInGameTradeDialogue jp TextScriptEnd diff --git a/scripts/Route20.asm b/scripts/Route20.asm index e83382d7..f9904d4e 100755 --- a/scripts/Route20.asm +++ b/scripts/Route20.asm @@ -33,7 +33,7 @@ Route20Script_50cc6: db HS_SEAFOAM_ISLANDS_B2F_BOULDER_2 db HS_SEAFOAM_ISLANDS_B3F_BOULDER_3 db HS_SEAFOAM_ISLANDS_B3F_BOULDER_4 - db $FF + db -1 ; end .asm_50cef CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE diff --git a/scripts/Route22.asm b/scripts/Route22.asm index 57dc934e..2e3f171e 100755 --- a/scripts/Route22.asm +++ b/scripts/Route22.asm @@ -52,7 +52,7 @@ Route22RivalMovementData: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT - db $FF + db -1 ; end Route22Script0: CheckEvent EVENT_ROUTE22_RIVAL_WANTS_BATTLE @@ -75,9 +75,9 @@ Route22Script0: ret .Route22RivalBattleCoords - db $04, $1D - db $05, $1D - db $FF + dbmapcoord 29, 4 + dbmapcoord 29, 5 + db -1 ; end .firstRivalBattle ld a, $1 @@ -141,9 +141,9 @@ Route22Script1: StarterMons_50faf: ; starter the rival picked, rival trainer number - db STARTER2,$04 - db STARTER3,$05 - db STARTER1,$06 + db STARTER2, 4 + db STARTER3, 5 + db STARTER1, 6 Route22Script2: ld a, [wIsInBattle] @@ -202,7 +202,7 @@ Route22RivalExitMovementData1: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end Route22RivalExitMovementData2: db NPC_MOVEMENT_UP @@ -215,7 +215,7 @@ Route22RivalExitMovementData2: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end Route22Script3: ld a, [wd730] @@ -296,9 +296,9 @@ Route22Script4: ret StarterMons_510d9: - db STARTER2,$0a - db STARTER3,$0b - db STARTER1,$0c + db STARTER2, 10 + db STARTER3, 11 + db STARTER1, 12 Route22Script5: ld a, [wIsInBattle] @@ -355,12 +355,11 @@ Route22MoveRival2: MovementData_5114c: db NPC_MOVEMENT_LEFT - MovementData_5114d: db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_LEFT - db $FF + db -1 ; end Route22Script6: ld a, [wd730] diff --git a/scripts/Route22Gate.asm b/scripts/Route22Gate.asm index 59b7d7a2..78143481 100755 --- a/scripts/Route22Gate.asm +++ b/scripts/Route22Gate.asm @@ -28,9 +28,9 @@ Route22GateScript0: jp DisplayTextID Route22GateScriptCoords: - db 2,4 - db 2,5 - db $ff + dbmapcoord 4, 2 + dbmapcoord 5, 2 + db -1 ; end Route22GateScript_1e6ba: ld a, $1 diff --git a/scripts/Route23.asm b/scripts/Route23.asm index f4d65266..e5318862 100755 --- a/scripts/Route23.asm +++ b/scripts/Route23.asm @@ -32,16 +32,16 @@ Route23Script0: EventFlagBit c, EVENT_PASSED_EARTHBADGE_CHECK + 1, EVENT_PASSED_CASCADEBADGE_CHECK .asm_51224 ld a, [hli] - cp $ff + cp -1 ret z inc e dec c cp b jr nz, .asm_51224 - cp $23 + cp 35 jr nz, .asm_51237 ld a, [wXCoord] - cp $e + cp 14 ret nc .asm_51237 ld a, e @@ -61,7 +61,14 @@ Route23Script0: ret YCoordsData_51255: - db $23,$38,$55,$60,$69,$77,$88,$FF + db 35 + db 56 + db 85 + db 96 + db 105 + db 119 + db 136 + db -1 ; end Route23Script_5125d: ld hl, BadgeTextPointers diff --git a/scripts/Route24.asm b/scripts/Route24.asm index 28151393..aed112ac 100755 --- a/scripts/Route24.asm +++ b/scripts/Route24.asm @@ -45,7 +45,8 @@ Route24Script0: ret CoordsData_5140e: - db $0F,$0A,$FF + dbmapcoord 10, 15 + db -1 ; end Route24Script4: ld a, [wSimulatedJoypadStatesIndex] @@ -103,12 +104,12 @@ Route24Text1: text_asm ResetEvent EVENT_NUGGET_REWARD_AVAILABLE CheckEvent EVENT_GOT_NUGGET - jr nz, .asm_514f9 + jr nz, .got_item ld hl, Route24Text_51510 call PrintText lb bc, NUGGET, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full SetEvent EVENT_GOT_NUGGET ld hl, Route24Text_5151a call PrintText @@ -130,11 +131,11 @@ Route24Text1: ld [wRoute24CurScript], a ld [wCurMapScript], a jp TextScriptEnd -.asm_514f9 +.got_item ld hl, Route24Text_51530 call PrintText jp TextScriptEnd -.BagFull +.bag_full ld hl, Route24Text_51521 call PrintText SetEvent EVENT_NUGGET_REWARD_AVAILABLE diff --git a/scripts/Route2Gate.asm b/scripts/Route2Gate.asm index d9d30218..60f6ffe1 100755 --- a/scripts/Route2Gate.asm +++ b/scripts/Route2Gate.asm @@ -8,10 +8,10 @@ Route2Gate_TextPointers: Route2GateText1: text_asm CheckEvent EVENT_GOT_HM05 - jr nz, .asm_5d60d - ld a, 10 ; pokemon needed + jr nz, .got_item + ld a, 10 ldh [hOaksAideRequirement], a - ld a, HM_FLASH ; oak's aide reward + ld a, HM_FLASH ldh [hOaksAideRewardItem], a ld [wd11e], a call GetItemName @@ -21,13 +21,13 @@ Route2GateText1: call CopyData predef OaksAideScript ldh a, [hOaksAideResult] - cp $1 - jr nz, .asm_5d613 + cp OAKS_AIDE_GOT_ITEM + jr nz, .no_item SetEvent EVENT_GOT_HM05 -.asm_5d60d +.got_item ld hl, Route2GateText_5d616 call PrintText -.asm_5d613 +.no_item jp TextScriptEnd Route2GateText_5d616: diff --git a/scripts/Route2TradeHouse.asm b/scripts/Route2TradeHouse.asm index fd3c51e3..85ed2d34 100755 --- a/scripts/Route2TradeHouse.asm +++ b/scripts/Route2TradeHouse.asm @@ -11,7 +11,7 @@ Route2HouseText1: Route2HouseText2: text_asm - ld a, $1 + ld a, TRADE_FOR_MARCEL ld [wWhichTrade], a predef DoInGameTradeDialogue jp TextScriptEnd diff --git a/scripts/Route5Gate.asm b/scripts/Route5Gate.asm index f2d45112..e155694a 100755 --- a/scripts/Route5Gate.asm +++ b/scripts/Route5Gate.asm @@ -46,9 +46,9 @@ Route5GateScript0: ret CoordsData_1df8f: - db 3,3 - db 3,4 - db $ff + dbmapcoord 3, 3 + dbmapcoord 4, 3 + db -1 ; end Route5GateScript1: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/Route6Gate.asm b/scripts/Route6Gate.asm index 22d40fd3..143f60ae 100755 --- a/scripts/Route6Gate.asm +++ b/scripts/Route6Gate.asm @@ -39,8 +39,9 @@ Route6GateScript0: jp DisplayTextID CoordsData_1e08c: - db $02,$03 - db $02,$04,$FF + dbmapcoord 3, 2 + dbmapcoord 4, 2 + db -1 ; end Route6GateScript1: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/Route7Gate.asm b/scripts/Route7Gate.asm index 182dedab..9a647965 100755 --- a/scripts/Route7Gate.asm +++ b/scripts/Route7Gate.asm @@ -52,9 +52,9 @@ Route7GateScript0: ret CoordsData_1e167: - db 3,3 - db 4,3 - db $ff + dbmapcoord 3, 3 + dbmapcoord 3, 4 + db -1 ; end Route7GateScript1: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/Route8Gate.asm b/scripts/Route8Gate.asm index 9ddaf601..3167cd76 100755 --- a/scripts/Route8Gate.asm +++ b/scripts/Route8Gate.asm @@ -50,9 +50,9 @@ Route8GateScript0: jp DisplayTextID CoordsData_1e22c: - db 3,2 - db 4,2 - db $ff + dbmapcoord 2, 3 + dbmapcoord 2, 4 + db -1 ; end Route8GateScript1: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/SSAnne2F.asm b/scripts/SSAnne2F.asm index 5060f1e1..6b216350 100755 --- a/scripts/SSAnne2F.asm +++ b/scripts/SSAnne2F.asm @@ -58,17 +58,16 @@ SSAnne2Script0: MovementData_6140c: db NPC_MOVEMENT_DOWN - MovementData_6140d: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end CoordsData_61411: - db $08,$24 - db $08,$25 - db $FF + dbmapcoord 36, 8 + dbmapcoord 37, 8 + db -1 ; end SSAnne2Script_61416: ld a, [wXCoord] @@ -156,13 +155,12 @@ SSAnne2Script2: MovementData_614b7: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_DOWN - MovementData_614b9: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end SSAnne2Script3: ld a, [wd730] diff --git a/scripts/SSAnne2FRooms.asm b/scripts/SSAnne2FRooms.asm index a82afa26..3fe2d34f 100755 --- a/scripts/SSAnne2FRooms.asm +++ b/scripts/SSAnne2FRooms.asm @@ -1,5 +1,5 @@ SSAnne2FRooms_Script: - ld a, $1 + ld a, TRUE ld [wAutoTextBoxDrawingControl], a xor a ld [wDoNotWaitForButtonPressAfterDisplayingText], a diff --git a/scripts/SSAnneB1F.asm b/scripts/SSAnneB1F.asm index 91452977..f66fdfaa 100755 --- a/scripts/SSAnneB1F.asm +++ b/scripts/SSAnneB1F.asm @@ -2,4 +2,5 @@ SSAnneB1F_Script: jp EnableAutoTextBoxDrawing SSAnneB1F_TextPointers: - text_end + + text_end ; unused diff --git a/scripts/SSAnneCaptainsRoom.asm b/scripts/SSAnneCaptainsRoom.asm index 8b464b53..3d5c5645 100755 --- a/scripts/SSAnneCaptainsRoom.asm +++ b/scripts/SSAnneCaptainsRoom.asm @@ -17,28 +17,28 @@ SSAnneCaptainsRoom_TextPointers: SSAnne7Text1: text_asm CheckEvent EVENT_GOT_HM01 - jr nz, .asm_797c4 + jr nz, .got_item ld hl, SSAnne7RubText call PrintText ld hl, ReceivingHM01Text call PrintText lb bc, HM_CUT, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedHM01Text call PrintText SetEvent EVENT_GOT_HM01 - jr .asm_0faf5 -.BagFull + jr .done +.bag_full ld hl, HM01NoRoomText call PrintText ld hl, wd72d set 5, [hl] - jr .asm_0faf5 -.asm_797c4 + jr .done +.got_item ld hl, SSAnne7Text_61932 call PrintText -.asm_0faf5 +.done jp TextScriptEnd SSAnne7RubText: diff --git a/scripts/SSAnneKitchen.asm b/scripts/SSAnneKitchen.asm index 969c6b7f..30a9830f 100755 --- a/scripts/SSAnneKitchen.asm +++ b/scripts/SSAnneKitchen.asm @@ -41,17 +41,17 @@ SSAnne6Text7: call PrintText ldh a, [hRandomAdd] bit 7, a - jr z, .asm_93eb1 + jr z, .not_dialog_1 ld hl, SSAnne6Text_6180c - jr .asm_63292 -.asm_93eb1 + jr .done +.not_dialog_1 bit 4, a - jr z, .asm_7436c + jr z, .not_dialog_2 ld hl, SSAnne6Text_61811 - jr .asm_63292 -.asm_7436c + jr .done +.not_dialog_2 ld hl, SSAnne6Text_61816 -.asm_63292 +.done call PrintText jp TextScriptEnd diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm index a15a5630..fd9a0884 100755 --- a/scripts/SafariZoneGate.asm +++ b/scripts/SafariZoneGate.asm @@ -43,9 +43,9 @@ SafariZoneGate_ScriptPointers: ret .CoordsData_75221: - db $02,$03 - db $02,$04 - db $FF + dbmapcoord 3, 2 + dbmapcoord 4, 2 + db -1 ; end .SafariZoneEntranceScript1 call SafariZoneEntranceScript_752b4 diff --git a/scripts/SafariZoneSecretHouse.asm b/scripts/SafariZoneSecretHouse.asm index 35aa90d7..6eeff8ad 100755 --- a/scripts/SafariZoneSecretHouse.asm +++ b/scripts/SafariZoneSecretHouse.asm @@ -7,24 +7,24 @@ SafariZoneSecretHouse_TextPointers: SafariZoneSecretHouseText1: text_asm CheckEvent EVENT_GOT_HM03 - jr nz, .asm_20a9b + jr nz, .got_item ld hl, SafariZoneSecretHouseText_4a350 call PrintText lb bc, HM_SURF, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedHM03Text call PrintText SetEvent EVENT_GOT_HM03 - jr .asm_8f1fc -.BagFull + jr .done +.bag_full ld hl, HM03NoRoomText call PrintText - jr .asm_8f1fc -.asm_20a9b + jr .done +.got_item ld hl, HM03ExplanationText call PrintText -.asm_8f1fc +.done jp TextScriptEnd SafariZoneSecretHouseText_4a350: diff --git a/scripts/SeafoamIslands1F.asm b/scripts/SeafoamIslands1F.asm index b024a6bd..ceb2a2fb 100755 --- a/scripts/SeafoamIslands1F.asm +++ b/scripts/SeafoamIslands1F.asm @@ -38,9 +38,9 @@ SeafoamIslands1F_Script: jp IsPlayerOnDungeonWarp Seafoam1HolesCoords: - db $06,$11 - db $06,$18 - db $ff + dbmapcoord 17, 6 + dbmapcoord 24, 6 + db -1 ; end SeafoamIslands1F_TextPointers: dw BoulderText diff --git a/scripts/SeafoamIslandsB1F.asm b/scripts/SeafoamIslandsB1F.asm index a4c5767b..ac667513 100755 --- a/scripts/SeafoamIslandsB1F.asm +++ b/scripts/SeafoamIslandsB1F.asm @@ -37,9 +37,9 @@ SeafoamIslandsB1F_Script: jp IsPlayerOnDungeonWarp Seafoam2HolesCoords: - db $06,$12 - db $06,$17 - db $ff + dbmapcoord 18, 6 + dbmapcoord 23, 6 + db -1 ; end SeafoamIslandsB1F_TextPointers: dw BoulderText diff --git a/scripts/SeafoamIslandsB2F.asm b/scripts/SeafoamIslandsB2F.asm index eb6d2437..fe4b3ead 100755 --- a/scripts/SeafoamIslandsB2F.asm +++ b/scripts/SeafoamIslandsB2F.asm @@ -37,9 +37,9 @@ SeafoamIslandsB2F_Script: jp IsPlayerOnDungeonWarp Seafoam3HolesCoords: - db $06,$13 - db $06,$16 - db $ff + dbmapcoord 19, 6 + dbmapcoord 22, 6 + db -1 ; end SeafoamIslandsB2F_TextPointers: dw BoulderText diff --git a/scripts/SeafoamIslandsB3F.asm b/scripts/SeafoamIslandsB3F.asm index 7d0e032b..d735f824 100755 --- a/scripts/SeafoamIslandsB3F.asm +++ b/scripts/SeafoamIslandsB3F.asm @@ -45,9 +45,9 @@ SeafoamIslandsB3F_Script: jp CallFunctionInTable Seafoam4HolesCoords: - db $10,$03 - db $10,$06 - db $ff + dbmapcoord 3, 16 + dbmapcoord 6, 16 + db -1 ; end SeafoamIslandsB3F_ScriptPointers: dw SeafoamIslands4Script0 @@ -77,10 +77,10 @@ SeafoamIslands4Script0: ret RLEMovement46632: - db D_DOWN,6 - db D_RIGHT,5 - db D_DOWN,3 - db $ff + db D_DOWN, 6 + db D_RIGHT, 5 + db D_DOWN, 3 + db -1 ; end SeafoamIslands4Script1: ld a, [wSimulatedJoypadStatesIndex] @@ -120,17 +120,17 @@ SeafoamIslands4Script2: ret RLEData_4667f: - db D_DOWN,$06 - db D_RIGHT,$02 - db D_DOWN,$04 - db D_LEFT,$01 - db $FF + db D_DOWN, 6 + db D_RIGHT, 2 + db D_DOWN, 4 + db D_LEFT, 1 + db -1 ; end RLEData_46688: - db D_DOWN,$06 - db D_RIGHT,$02 - db D_DOWN,$04 - db $FF + db D_DOWN, 6 + db D_RIGHT, 2 + db D_DOWN, 4 + db -1 ; end SeafoamIslands4Script3: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/SeafoamIslandsB4F.asm b/scripts/SeafoamIslandsB4F.asm index 250dfd39..bf80d3e0 100755 --- a/scripts/SeafoamIslandsB4F.asm +++ b/scripts/SeafoamIslandsB4F.asm @@ -53,11 +53,11 @@ SeafoamIslands5Script0: ret .Coords - db $11,$14 - db $11,$15 - db $10,$14 - db $10,$15 - db $FF + dbmapcoord 20, 17 + dbmapcoord 21, 17 + dbmapcoord 20, 16 + dbmapcoord 21, 16 + db -1 ; end SeafoamIslands5Script1: ld a, [wSimulatedJoypadStatesIndex] @@ -96,21 +96,21 @@ SeafoamIslands5Script2: ret .Coords - db $0E,$04 - db $0E,$05 - db $FF + dbmapcoord 4, 14 + dbmapcoord 5, 14 + db -1 ; end RLEMovementData_46852: - db D_UP,$03 - db D_RIGHT,$02 - db D_UP,$01 - db $FF + db D_UP, 3 + db D_RIGHT, 2 + db D_UP, 1 + db -1 ; end RLEMovementData_46859: - db D_UP,$03 - db D_RIGHT,$03 - db D_UP,$01 - db $FF + db D_UP, 3 + db D_RIGHT, 3 + db D_UP, 1 + db -1 ; end SeafoamIslands5Script3: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/SilphCo10F.asm b/scripts/SilphCo10F.asm index 1ac993ed..29b640fd 100755 --- a/scripts/SilphCo10F.asm +++ b/scripts/SilphCo10F.asm @@ -24,8 +24,8 @@ SilphCo10Script_5a14f: predef_jump ReplaceTileBlock SilphCo10GateCoords: - db $04,$05 - db $FF + dbmapcoord 5, 4 + db -1 ; end SilphCo10Text_5a176: ldh a, [hUnlockedSilphCoDoors] diff --git a/scripts/SilphCo11F.asm b/scripts/SilphCo11F.asm index abea6da4..f3a7088b 100755 --- a/scripts/SilphCo11F.asm +++ b/scripts/SilphCo11F.asm @@ -24,8 +24,8 @@ SilphCo11Script_62110: predef_jump ReplaceTileBlock SilphCo11GateCoords: - db $06,$03 - db $FF + dbmapcoord 3, 6 + db -1 ; end SilphCo11Script_62137: push hl @@ -85,7 +85,7 @@ SilphCo11Script_6216d: ld hl, MissableObjectIDs_62194 .asm_62184 ld a, [hli] - cp $ff + cp -1 ret z push hl ld [wMissableObjectIndex], a @@ -100,7 +100,7 @@ MissableObjectIDs_62194: db HS_SAFFRON_CITY_B db HS_SAFFRON_CITY_C db HS_SAFFRON_CITY_D - db $FF + db -1 ; end MissableObjectIDs_6219b: db HS_SAFFRON_CITY_1 @@ -143,7 +143,7 @@ MissableObjectIDs_6219b: db HS_SILPH_CO_11F_1 db HS_SILPH_CO_11F_2 db HS_SILPH_CO_11F_3 - db $FF + db -1 ; end SilphCo11Script_621c4: xor a @@ -186,15 +186,15 @@ SilphCo11Script0: jp SilphCo11Script_621c8 CoordsData_62211: - db $0D,$06 - db $0C,$07 - db $FF + dbmapcoord 6, 13 + dbmapcoord 7, 12 + db -1 ; end MovementData_62216: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end SilphCo11Script_6221a: ld [wPlayerMovingDirection], a @@ -289,24 +289,24 @@ SilphCo11TrainerHeader1: SilphCo11Text1: text_asm CheckEvent EVENT_GOT_MASTER_BALL - jp nz, .asm_62308 + jp nz, .got_item ld hl, SilphCoPresidentText call PrintText lb bc, MASTER_BALL, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedSilphCoMasterBallText call PrintText SetEvent EVENT_GOT_MASTER_BALL - jr .asm_6230e -.BagFull + jr .done +.bag_full ld hl, SilphCoMasterBallNoRoomText call PrintText - jr .asm_6230e -.asm_62308 + jr .done +.got_item ld hl, SilphCo10Text_6231c call PrintText -.asm_6230e +.done jp TextScriptEnd SilphCoPresidentText: diff --git a/scripts/SilphCo2F.asm b/scripts/SilphCo2F.asm index 5433bca4..4b96c314 100755 --- a/scripts/SilphCo2F.asm +++ b/scripts/SilphCo2F.asm @@ -33,9 +33,9 @@ SilphCo2Script_59d07: predef_jump ReplaceTileBlock SilphCo2GateCoords: - db $02,$02 - db $05,$02 - db $FF + dbmapcoord 2, 2 + dbmapcoord 2, 5 + db -1 ; end SilphCo2Script_59d43: push hl diff --git a/scripts/SilphCo3F.asm b/scripts/SilphCo3F.asm index f2b4b1fd..69dfdad9 100755 --- a/scripts/SilphCo3F.asm +++ b/scripts/SilphCo3F.asm @@ -33,9 +33,9 @@ SilphCo3Script_59f71: predef_jump ReplaceTileBlock SilphCo3GateCoords: - db $04,$04 - db $04,$08 - db $FF + dbmapcoord 4, 4 + dbmapcoord 8, 4 + db -1 ; end SilphCo3Script_59fad: EventFlagAddress hl, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 diff --git a/scripts/SilphCo4F.asm b/scripts/SilphCo4F.asm index 4b6303a1..8d5d696a 100755 --- a/scripts/SilphCo4F.asm +++ b/scripts/SilphCo4F.asm @@ -33,9 +33,9 @@ SilphCo4Script_19d21: predef_jump ReplaceTileBlock SilphCo4GateCoords: - db $06,$02 - db $04,$06 - db $FF + dbmapcoord 2, 6 + dbmapcoord 6, 4 + db -1 ; end SilphCo4Script_19d5d: push hl diff --git a/scripts/SilphCo5F.asm b/scripts/SilphCo5F.asm index 94a7ec30..975dacac 100755 --- a/scripts/SilphCo5F.asm +++ b/scripts/SilphCo5F.asm @@ -42,10 +42,10 @@ SilphCo5Script_19f4d: predef_jump ReplaceTileBlock SilphCo5GateCoords: - db $02,$03 - db $06,$03 - db $05,$07 - db $FF + dbmapcoord 3, 2 + dbmapcoord 3, 6 + dbmapcoord 7, 5 + db -1 ; end SilphCo5Script_19f9e: EventFlagAddress hl, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 diff --git a/scripts/SilphCo6F.asm b/scripts/SilphCo6F.asm index 51d29498..ea8c20c2 100755 --- a/scripts/SilphCo6F.asm +++ b/scripts/SilphCo6F.asm @@ -24,8 +24,8 @@ SilphCo6Script_1a1bf: predef_jump ReplaceTileBlock SilphCo6GateCoords: - db $06,$02 - db $FF + dbmapcoord 2, 6 + db -1 ; end SilphCo6Script_1a1e6: ldh a, [hUnlockedSilphCoDoors] diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm index 3627bc7f..32a95fb5 100755 --- a/scripts/SilphCo7F.asm +++ b/scripts/SilphCo7F.asm @@ -42,10 +42,10 @@ SilphCo7Script_51b77: predef_jump ReplaceTileBlock SilphCo7GateCoords: - db $03,$05 - db $02,$0A - db $06,$0A - db $FF + dbmapcoord 5, 3 + dbmapcoord 10, 2 + dbmapcoord 10, 6 + db -1 ; end SilphCo7Text_51bc8: push hl @@ -156,16 +156,16 @@ SilphCo7Script0: jp SilphCo7Text_51c10 CoordsData_51c78: - db $02,$03 - db $03,$03 - db $FF + dbmapcoord 3, 2 + dbmapcoord 3, 3 + db -1 ; end MovementData_51c7d: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP - db $FF + db -1 ; end SilphCo7Script3: ld a, [wd730] @@ -238,7 +238,7 @@ SilphCo7Script4: MovementData_51d1a: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT - db $FF + db -1 ; end MovementData_51d1d: db NPC_MOVEMENT_LEFT @@ -248,7 +248,7 @@ MovementData_51d1d: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_DOWN - db $FF + db -1 ; end SilphCo7Script5: ld a, [wd730] diff --git a/scripts/SilphCo8F.asm b/scripts/SilphCo8F.asm index 6b77ce46..c4e022d4 100755 --- a/scripts/SilphCo8F.asm +++ b/scripts/SilphCo8F.asm @@ -24,8 +24,8 @@ SilphCo8Script_5651a: predef_jump ReplaceTileBlock SilphCo8GateCoords: - db $04,$03 - db $FF + dbmapcoord 3, 4 + db -1 ; end SilphCo8Script_56541: push hl diff --git a/scripts/SilphCo9F.asm b/scripts/SilphCo9F.asm index 0fbfc239..1efb3d78 100755 --- a/scripts/SilphCo9F.asm +++ b/scripts/SilphCo9F.asm @@ -51,11 +51,11 @@ SilphCo9Script_5d7d1: predef_jump ReplaceTileBlock SilphCo9GateCoords: - db $04,$01 - db $02,$09 - db $05,$09 - db $06,$05 - db $FF + dbmapcoord 1, 4 + dbmapcoord 9, 2 + dbmapcoord 9, 5 + dbmapcoord 5, 6 + db -1 ; end SilphCo9Script_5d837: push hl diff --git a/scripts/SilphCoElevator.asm b/scripts/SilphCoElevator.asm index e660cd0f..c898cbd1 100755 --- a/scripts/SilphCoElevator.asm +++ b/scripts/SilphCoElevator.asm @@ -41,7 +41,7 @@ SilphCoElevatorScript_457f1: ret SilphCoElevatorFloors: - db $0B ; num elements in list + db 11 ; # db FLOOR_1F db FLOOR_2F db FLOOR_3F @@ -53,23 +53,22 @@ SilphCoElevatorFloors: db FLOOR_9F db FLOOR_10F db FLOOR_11F - db $FF ; terminator + db -1 ; end -SilphCoElevatorWarpMaps: -; first byte is warp number -; second byte is map number ; These specify where the player goes after getting out of the elevator. - db $03, SILPH_CO_1F - db $02, SILPH_CO_2F - db $02, SILPH_CO_3F - db $02, SILPH_CO_4F - db $02, SILPH_CO_5F - db $02, SILPH_CO_6F - db $02, SILPH_CO_7F - db $02, SILPH_CO_8F - db $02, SILPH_CO_9F - db $02, SILPH_CO_10F - db $01, SILPH_CO_11F +SilphCoElevatorWarpMaps: + ; warp number, map id + db 3, SILPH_CO_1F + db 2, SILPH_CO_2F + db 2, SILPH_CO_3F + db 2, SILPH_CO_4F + db 2, SILPH_CO_5F + db 2, SILPH_CO_6F + db 2, SILPH_CO_7F + db 2, SILPH_CO_8F + db 2, SILPH_CO_9F + db 2, SILPH_CO_10F + db 1, SILPH_CO_11F SilphCoElevatorWarpMapsEnd: SilphCoElevatorScript_45827: diff --git a/scripts/TradeCenter.asm b/scripts/TradeCenter.asm index b91996e0..dbed79c1 100755 --- a/scripts/TradeCenter.asm +++ b/scripts/TradeCenter.asm @@ -15,16 +15,16 @@ TradeCenter_Script: set 0, [hl] ret nz ld hl, wSprite01StateData2MapY - ld a, $8 + ld a, 8 ; y ld [hli], a - ld a, $a + ld a, 10 ; x ld [hl], a ld a, SPRITE_FACING_LEFT ld [wSprite01StateData1FacingDirection], a ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK ret z - ld a, $7 + ld a, 7 ; x ld [wSprite01StateData2MapX], a ld a, SPRITE_FACING_RIGHT ld [wSprite01StateData1FacingDirection], a diff --git a/scripts/UndergroundPathNorthSouth.asm b/scripts/UndergroundPathNorthSouth.asm index eb8fe4fd..00a7ef90 100755 --- a/scripts/UndergroundPathNorthSouth.asm +++ b/scripts/UndergroundPathNorthSouth.asm @@ -2,4 +2,5 @@ UndergroundPathNorthSouth_Script: jp EnableAutoTextBoxDrawing UndergroundPathNorthSouth_TextPointers: - text_end + + text_end ; unused diff --git a/scripts/UndergroundPathRoute5.asm b/scripts/UndergroundPathRoute5.asm index 1cb1f78a..5c078050 100755 --- a/scripts/UndergroundPathRoute5.asm +++ b/scripts/UndergroundPathRoute5.asm @@ -11,7 +11,7 @@ UndergroundPathRoute5_TextPointers: UndergroundPathEntranceRoute5Text1: text_asm - ld a, $9 + ld a, TRADE_FOR_SPOT ld [wWhichTrade], a predef DoInGameTradeDialogue ld hl, UndergroundPathEntranceRoute5_TextScriptEndingText diff --git a/scripts/UndergroundPathWestEast.asm b/scripts/UndergroundPathWestEast.asm index e21c3268..98571e17 100755 --- a/scripts/UndergroundPathWestEast.asm +++ b/scripts/UndergroundPathWestEast.asm @@ -2,4 +2,5 @@ UndergroundPathWestEast_Script: jp EnableAutoTextBoxDrawing UndergroundPathWestEast_TextPointers: - text_end + + text_end ; unused diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm index 9178cd65..629bb0c8 100755 --- a/scripts/VermilionCity.asm +++ b/scripts/VermilionCity.asm @@ -68,8 +68,8 @@ VermilionCityScript0: ret SSAnneTicketCheckCoords: - db $1e,$12 ; y, x - db $ff + dbmapcoord 18, 30 + db -1 ; end VermilionCityScript4: ld hl, SSAnneTicketCheckCoords @@ -191,9 +191,9 @@ VermilionCityText3: jp TextScriptEnd .inFrontOfOrBehindGuardCoords - db $1d,$13 ; y, x of tile in front of guard - db $1f,$13 ; y, x of tile behind guard - db $ff + dbmapcoord 19, 29 ; in front of guard + dbmapcoord 19, 31 ; behind guard + db -1 ; end SSAnneWelcomeText4: text_far _SSAnneWelcomeText4 diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm index 9dc4b2b9..728675eb 100755 --- a/scripts/VermilionDock.asm +++ b/scripts/VermilionDock.asm @@ -155,6 +155,7 @@ VermilionDock_EmitSmokePuff: ret VermilionDockOAMBlock: + ; tile id, attribute db $fc, $10 db $fd, $10 db $fe, $10 diff --git a/scripts/VermilionOldRodHouse.asm b/scripts/VermilionOldRodHouse.asm index 5305820d..524395d4 100755 --- a/scripts/VermilionOldRodHouse.asm +++ b/scripts/VermilionOldRodHouse.asm @@ -7,30 +7,30 @@ VermilionOldRodHouse_TextPointers: VermilionHouse2Text1: text_asm ld a, [wd728] - bit 3, a - jr nz, .asm_03ef5 + bit 3, a ; got old rod? + jr nz, .got_item ld hl, VermilionHouse2Text_560b1 call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_eb1b7 + jr nz, .refused lb bc, OLD_ROD, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, wd728 - set 3, [hl] + set 3, [hl] ; got old rod ld hl, VermilionHouse2Text_560b6 - jr .asm_5dd95 -.BagFull + jr .done +.bag_full ld hl, VermilionHouse2Text_560ca - jr .asm_5dd95 -.asm_eb1b7 + jr .done +.refused ld hl, VermilionHouse2Text_560c0 - jr .asm_5dd95 -.asm_03ef5 + jr .done +.got_item ld hl, VermilionHouse2Text_560c5 -.asm_5dd95 +.done call PrintText jp TextScriptEnd diff --git a/scripts/VermilionTradeHouse.asm b/scripts/VermilionTradeHouse.asm index 368654d9..7fdb9f40 100755 --- a/scripts/VermilionTradeHouse.asm +++ b/scripts/VermilionTradeHouse.asm @@ -6,7 +6,7 @@ VermilionTradeHouse_TextPointers: VermilionHouse3Text1: text_asm - ld a, $4 + ld a, TRADE_FOR_DUX ld [wWhichTrade], a predef DoInGameTradeDialogue jp TextScriptEnd diff --git a/scripts/VictoryRoad1F.asm b/scripts/VictoryRoad1F.asm index 784329f0..b70f0dd4 100755 --- a/scripts/VictoryRoad1F.asm +++ b/scripts/VictoryRoad1F.asm @@ -35,7 +35,8 @@ VictoryRoad1Script0: ret CoordsData_5da5c: - db $0D,$11,$FF + dbmapcoord 17, 13 + db -1 ; end VictoryRoad1F_TextPointers: dw VictoryRoad1Text1 diff --git a/scripts/VictoryRoad2F.asm b/scripts/VictoryRoad2F.asm index 82cd1c18..9622206c 100755 --- a/scripts/VictoryRoad2F.asm +++ b/scripts/VictoryRoad2F.asm @@ -64,9 +64,9 @@ VictoryRoad2Script0: ret CoordsData_51816: - db $10,$01 - db $10,$09 - db $FF + dbmapcoord 1, 16 + dbmapcoord 9, 16 + db -1 ; end VictoryRoad2F_TextPointers: dw VictoryRoad2Text1 diff --git a/scripts/VictoryRoad3F.asm b/scripts/VictoryRoad3F.asm index 4715941d..7febdd3d 100755 --- a/scripts/VictoryRoad3F.asm +++ b/scripts/VictoryRoad3F.asm @@ -51,9 +51,9 @@ VictoryRoad3Script0: predef_jump ShowObject .coordsData_449f9: - db $05,$03 - db $0F,$17 - db $FF + dbmapcoord 3, 5 + dbmapcoord 23, 15 + db -1 ; end .asm_449fe ld a, VICTORY_ROAD_2F diff --git a/scripts/ViridianCity.asm b/scripts/ViridianCity.asm index 62d98c4c..543ffa97 100755 --- a/scripts/ViridianCity.asm +++ b/scripts/ViridianCity.asm @@ -18,11 +18,11 @@ ViridianCityScript_1900b: CheckEvent EVENT_VIRIDIAN_GYM_OPEN ret nz ld a, [wObtainedBadges] - cp %01111111 - jr nz, .gymClosed + cp $ff ^ (1 << BIT_EARTHBADGE) + jr nz, .gym_closed SetEvent EVENT_VIRIDIAN_GYM_OPEN ret -.gymClosed +.gym_closed ld a, [wYCoord] cp $8 ret nz @@ -148,13 +148,13 @@ ViridianCityText1: ViridianCityText2: text_asm ld a, [wObtainedBadges] - cp %01111111 + cp $ff ^ (1 << BIT_EARTHBADGE) ld hl, ViridianCityText_19127 - jr z, .printAndDone + jr z, .done CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI - jr nz, .printAndDone + jr nz, .done ld hl, ViridianCityText_19122 -.printAndDone +.done call PrintText jp TextScriptEnd @@ -232,21 +232,21 @@ ViridianCityText_19191: ViridianCityText6: text_asm CheckEvent EVENT_GOT_TM42 - jr nz, .gotTm42 + jr nz, .got_item ld hl, ViridianCityText_191ca call PrintText lb bc, TM_DREAM_EATER, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedTM42Text call PrintText SetEvent EVENT_GOT_TM42 jr .done -.BagFull +.bag_full ld hl, TM42NoRoomText call PrintText jr .done -.gotTm42 +.got_item ld hl, TM42Explanation call PrintText .done @@ -278,13 +278,13 @@ ViridianCityText7: call YesNoChoice ld a, [wCurrentMenuItem] and a - jr z, .hurry + jr z, .refused ld hl, ViridianCityText_1920f call PrintText ld a, $1 ld [wViridianCityCurScript], a jr .done -.hurry +.refused ld hl, ViridianCityText_19214 call PrintText .done diff --git a/scripts/ViridianGym.asm b/scripts/ViridianGym.asm index f169f1f5..4a5dd6b7 100755 --- a/scripts/ViridianGym.asm +++ b/scripts/ViridianGym.asm @@ -49,72 +49,68 @@ ViridianGymScript0: ld [wCurMapScript], a ret -;format: -;db y,x -;dw pointer to movement ViridianGymArrowTilePlayerMovement: - db $b,$13 - dw ViridianGymArrowMovement1 - db $1,$13 - dw ViridianGymArrowMovement2 - db $2,$12 - dw ViridianGymArrowMovement3 - db $2,$b - dw ViridianGymArrowMovement4 - db $a,$10 - dw ViridianGymArrowMovement5 - db $6,$4 - dw ViridianGymArrowMovement6 - db $d,$5 - dw ViridianGymArrowMovement7 - db $e,$4 - dw ViridianGymArrowMovement8 - db $f,$0 - dw ViridianGymArrowMovement9 - db $f,$1 - dw ViridianGymArrowMovement10 - db $10,$d - dw ViridianGymArrowMovement11 - db $11,$d - dw ViridianGymArrowMovement12 - db $FF - -;format: direction, count + map_coord_movement 19, 11, ViridianGymArrowMovement1 + map_coord_movement 19, 1, ViridianGymArrowMovement2 + map_coord_movement 18, 2, ViridianGymArrowMovement3 + map_coord_movement 11, 2, ViridianGymArrowMovement4 + map_coord_movement 16, 10, ViridianGymArrowMovement5 + map_coord_movement 4, 6, ViridianGymArrowMovement6 + map_coord_movement 5, 13, ViridianGymArrowMovement7 + map_coord_movement 4, 14, ViridianGymArrowMovement8 + map_coord_movement 0, 15, ViridianGymArrowMovement9 + map_coord_movement 1, 15, ViridianGymArrowMovement10 + map_coord_movement 13, 16, ViridianGymArrowMovement11 + map_coord_movement 13, 17, ViridianGymArrowMovement12 + db -1 ; end + ViridianGymArrowMovement1: - db D_UP,$09,$FF + db D_UP, 9 + db -1 ; end ViridianGymArrowMovement2: - db D_LEFT,$08,$FF + db D_LEFT, 8 + db -1 ; end ViridianGymArrowMovement3: - db D_DOWN,$09,$FF + db D_DOWN, 9 + db -1 ; end ViridianGymArrowMovement4: - db D_RIGHT,$06,$FF + db D_RIGHT, 6 + db -1 ; end ViridianGymArrowMovement5: - db D_DOWN,$02,$FF + db D_DOWN, 2 + db -1 ; end ViridianGymArrowMovement6: - db D_DOWN,$07,$FF + db D_DOWN, 7 + db -1 ; end ViridianGymArrowMovement7: - db D_RIGHT,$08,$FF + db D_RIGHT, 8 + db -1 ; end ViridianGymArrowMovement8: - db D_RIGHT,$09,$FF + db D_RIGHT, 9 + db -1 ; end ViridianGymArrowMovement9: - db D_UP,$08,$FF + db D_UP, 8 + db -1 ; end ViridianGymArrowMovement10: - db D_UP,$06,$FF + db D_UP, 6 + db -1 ; end ViridianGymArrowMovement11: - db D_LEFT,$06,$FF + db D_LEFT, 6 + db -1 ; end ViridianGymArrowMovement12: - db D_LEFT,$0C,$FF + db D_LEFT, 12 + db -1 ; end ViridianGymScript4: ld a, [wSimulatedJoypadStatesIndex] diff --git a/scripts/ViridianMart.asm b/scripts/ViridianMart.asm index ea1c373f..f71cc6ef 100755 --- a/scripts/ViridianMart.asm +++ b/scripts/ViridianMart.asm @@ -7,12 +7,12 @@ ViridianMart_Script: ViridianMartScript_1d47d: CheckEvent EVENT_OAK_GOT_PARCEL - jr nz, .asm_1d489 + jr nz, .delivered_parcel ld hl, ViridianMart_TextPointers - jr .asm_1d48c -.asm_1d489 + jr .done +.delivered_parcel ld hl, ViridianMart_TextPointers2 -.asm_1d48c +.done ld a, l ld [wMapTextPtr], a ld a, h @@ -40,9 +40,9 @@ ViridianMartScript0: ret RLEMovement1d4bb: - db D_LEFT, $01 - db D_UP, $02 - db $ff + db D_LEFT, 1 + db D_UP, 2 + db -1 ; end ViridianMartScript1: ld a, [wSimulatedJoypadStatesIndex] @@ -67,6 +67,7 @@ ViridianMart_TextPointers: dw ViridianMartText3 dw ViridianMartText4 dw ViridianMartText5 + ViridianMart_TextPointers2: dw ViridianCashierText dw ViridianMartText2 diff --git a/scripts/WardensHouse.asm b/scripts/WardensHouse.asm index 6705a450..2dd0410c 100755 --- a/scripts/WardensHouse.asm +++ b/scripts/WardensHouse.asm @@ -11,48 +11,48 @@ WardensHouse_TextPointers: FuchsiaHouse2Text1: text_asm CheckEvent EVENT_GOT_HM04 - jr nz, .subtract + jr nz, .got_item ld b, GOLD_TEETH call IsItemInBag - jr nz, .asm_3f30f + jr nz, .have_gold_teeth CheckEvent EVENT_GAVE_GOLD_TEETH - jr nz, .asm_60cba + jr nz, .gave_gold_teeth ld hl, WardenGibberishText1 call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a ld hl, WardenGibberishText3 - jr nz, .asm_61238 + jr nz, .refused ld hl, WardenGibberishText2 -.asm_61238 +.refused call PrintText - jr .asm_52039 -.asm_3f30f + jr .done +.have_gold_teeth ld hl, WardenTeethText1 call PrintText ld a, GOLD_TEETH ldh [hItemToRemoveID], a farcall RemoveItemByID SetEvent EVENT_GAVE_GOLD_TEETH -.asm_60cba +.gave_gold_teeth ld hl, WardenThankYouText call PrintText lb bc, HM_STRENGTH, 1 call GiveItem - jr nc, .BagFull + jr nc, .bag_full ld hl, ReceivedHM04Text call PrintText SetEvent EVENT_GOT_HM04 - jr .asm_52039 -.subtract + jr .done +.got_item ld hl, HM04ExplanationText call PrintText - jr .asm_52039 -.BagFull + jr .done +.bag_full ld hl, HM04NoRoomText call PrintText -.asm_52039 +.done jp TextScriptEnd WardenGibberishText1: diff --git a/text/BluesHouse.asm b/text/BluesHouse.asm index a9b9ca47..6e57cb21 100644 --- a/text/BluesHouse.asm +++ b/text/BluesHouse.asm @@ -29,14 +29,14 @@ _DaisyUseMapText:: cont "you are." done -_BluesHouseText2:: +_BluesHouseDaisyWalkingText:: text "#MON are living" line "things! If they" cont "get tired, give" cont "them a rest!" done -_BluesHouseText3:: +_BluesHouseTownMapText:: text "It's a big map!" line "This is useful!" done |