mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-11-14 09:06:41 +13:00
Organize macros/ like pokecrystal
While doing so I replaced the StopAllMusic macro with a SFX_STOP_ALL_MUSIC constant and applied it throughout the code.
This commit is contained in:
parent
ccb01731fe
commit
9878f01e29
|
|
@ -2,9 +2,9 @@ PlayBattleMusic::
|
||||||
xor a
|
xor a
|
||||||
ld [wAudioFadeOutControl], a
|
ld [wAudioFadeOutControl], a
|
||||||
ld [wLowHealthAlarm], a
|
ld [wLowHealthAlarm], a
|
||||||
dec a
|
dec a ; SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound ; stop music
|
call PlaySound
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
ld c, BANK(Music_GymLeaderBattle)
|
ld c, BANK(Music_GymLeaderBattle)
|
||||||
ld a, [wGymLeaderNo]
|
ld a, [wGymLeaderNo]
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ PlayPokedexRatingSfx::
|
||||||
jr .getSfxPointer
|
jr .getSfxPointer
|
||||||
.gotSfxPointer
|
.gotSfxPointer
|
||||||
push bc
|
push bc
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
pop bc
|
pop bc
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ INCLUDE "constants/palette_constants.asm"
|
||||||
INCLUDE "constants/list_constants.asm"
|
INCLUDE "constants/list_constants.asm"
|
||||||
INCLUDE "constants/map_constants.asm"
|
INCLUDE "constants/map_constants.asm"
|
||||||
INCLUDE "constants/map_data_constants.asm"
|
INCLUDE "constants/map_data_constants.asm"
|
||||||
|
INCLUDE "constants/map_object_constants.asm"
|
||||||
INCLUDE "constants/hide_show_constants.asm"
|
INCLUDE "constants/hide_show_constants.asm"
|
||||||
INCLUDE "constants/credits_constants.asm"
|
INCLUDE "constants/credits_constants.asm"
|
||||||
INCLUDE "constants/audio_constants.asm"
|
INCLUDE "constants/audio_constants.asm"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,29 @@
|
||||||
|
; pitch
|
||||||
|
const_def
|
||||||
|
const C_ ; 0
|
||||||
|
const C# ; 1
|
||||||
|
const D_ ; 2
|
||||||
|
const D# ; 3
|
||||||
|
const E_ ; 4
|
||||||
|
const F_ ; 5
|
||||||
|
const F# ; 6
|
||||||
|
const G_ ; 7
|
||||||
|
const G# ; 8
|
||||||
|
const A_ ; 9
|
||||||
|
const A# ; A
|
||||||
|
const B_ ; B
|
||||||
|
|
||||||
|
; channel
|
||||||
|
const_def
|
||||||
|
const Ch1 ; 0
|
||||||
|
const Ch2 ; 1
|
||||||
|
const Ch3 ; 2
|
||||||
|
const Ch4 ; 3
|
||||||
|
const Ch5 ; 4
|
||||||
|
const Ch6 ; 5
|
||||||
|
const Ch7 ; 6
|
||||||
|
const Ch8 ; 7
|
||||||
|
|
||||||
; HW sound channel register base addresses
|
; HW sound channel register base addresses
|
||||||
HW_CH1_BASE EQU (rNR10 % $100)
|
HW_CH1_BASE EQU (rNR10 % $100)
|
||||||
HW_CH2_BASE EQU ((rNR21 % $100) - 1)
|
HW_CH2_BASE EQU ((rNR21 % $100) - 1)
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,8 @@ EAST EQU 1
|
||||||
WEST EQU 2
|
WEST EQU 2
|
||||||
SOUTH EQU 4
|
SOUTH EQU 4
|
||||||
NORTH EQU 8
|
NORTH EQU 8
|
||||||
|
|
||||||
|
; tileset environments
|
||||||
|
INDOOR EQU 0
|
||||||
|
CAVE EQU 1
|
||||||
|
OUTDOOR EQU 2
|
||||||
|
|
|
||||||
14
constants/map_object_constants.asm
Normal file
14
constants/map_object_constants.asm
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
; different kinds of people events
|
||||||
|
ITEM EQU $80
|
||||||
|
TRAINER EQU $40
|
||||||
|
|
||||||
|
WALK EQU $FE
|
||||||
|
STAY EQU $FF
|
||||||
|
|
||||||
|
DOWN EQU $D0
|
||||||
|
UP EQU $D1
|
||||||
|
LEFT EQU $D2
|
||||||
|
RIGHT EQU $D3
|
||||||
|
NONE EQU $FF
|
||||||
|
|
||||||
|
BOULDER_MOVEMENT_BYTE_2 EQU $10
|
||||||
|
|
@ -238,3 +238,5 @@ MAX_SFX_ID_2 EQUS "SFX_SILPH_SCOPE"
|
||||||
music_const SFX_SLOTS_NEW_SPIN, SFX_Slots_New_Spin
|
music_const SFX_SLOTS_NEW_SPIN, SFX_Slots_New_Spin
|
||||||
music_const SFX_SHOOTING_STAR, SFX_Shooting_Star
|
music_const SFX_SHOOTING_STAR, SFX_Shooting_Star
|
||||||
MAX_SFX_ID_3 EQUS "SFX_SHOOTING_STAR"
|
MAX_SFX_ID_3 EQUS "SFX_SHOOTING_STAR"
|
||||||
|
|
||||||
|
SFX_STOP_ALL_MUSIC EQU $ff
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,3 @@
|
||||||
; different kinds of people events
|
|
||||||
ITEM EQU $80
|
|
||||||
TRAINER EQU $40
|
|
||||||
|
|
||||||
BOULDER_MOVEMENT_BYTE_2 EQU $10
|
|
||||||
|
|
||||||
; sprite facing directions
|
; sprite facing directions
|
||||||
SPRITE_FACING_DOWN EQU $00
|
SPRITE_FACING_DOWN EQU $00
|
||||||
SPRITE_FACING_UP EQU $04
|
SPRITE_FACING_UP EQU $04
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,11 @@
|
||||||
|
tileset: MACRO
|
||||||
|
db BANK(\2) ; BANK(GFX)
|
||||||
|
dw \1, \2, \3 ; Block, GFX, Coll
|
||||||
|
db \4, \5, \6 ; counter tiles
|
||||||
|
db \7 ; grass tile
|
||||||
|
db \8 ; permission (indoor, cave, outdoor)
|
||||||
|
ENDM
|
||||||
|
|
||||||
Tilesets:
|
Tilesets:
|
||||||
tileset Overworld_Block, Overworld_GFX, Overworld_Coll, $FF,$FF,$FF, $52, OUTDOOR
|
tileset Overworld_Block, Overworld_GFX, Overworld_Coll, $FF,$FF,$FF, $52, OUTDOOR
|
||||||
tileset RedsHouse1_Block, RedsHouse1_GFX, RedsHouse1_Coll, $FF,$FF,$FF, $FF, INDOOR
|
tileset RedsHouse1_Block, RedsHouse1_GFX, RedsHouse1_Coll, $FF,$FF,$FF, $FF, INDOOR
|
||||||
|
|
|
||||||
|
|
@ -958,7 +958,7 @@ TrainerDefeatedText:
|
||||||
|
|
||||||
PlayBattleVictoryMusic:
|
PlayBattleVictoryMusic:
|
||||||
push af
|
push af
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
ld c, BANK(Music_DefeatedTrainer)
|
ld c, BANK(Music_DefeatedTrainer)
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ BillsHouseInitiatedText::
|
||||||
TX_FAR _BillsHouseInitiatedText
|
TX_FAR _BillsHouseInitiatedText
|
||||||
TX_BLINK
|
TX_BLINK
|
||||||
TX_ASM
|
TX_ASM
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld c, 16
|
ld c, 16
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ SafariZoneGameOver:
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
xor a
|
xor a
|
||||||
ld [wAudioFadeOutControl], a
|
ld [wAudioFadeOutControl], a
|
||||||
dec a
|
dec a ; SFX_STOP_ALL_MUSIC
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld c, BANK(SFX_Safari_Zone_PA)
|
ld c, BANK(SFX_Safari_Zone_PA)
|
||||||
ld a, SFX_SAFARI_ZONE_PA
|
ld a, SFX_SAFARI_ZONE_PA
|
||||||
|
|
|
||||||
|
|
@ -1844,8 +1844,8 @@ PlayedFluteHadEffectText:
|
||||||
and a
|
and a
|
||||||
jr nz, .done
|
jr nz, .done
|
||||||
; play out-of-battle pokeflute music
|
; play out-of-battle pokeflute music
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
call PlaySound ; turn off music
|
call PlaySound
|
||||||
ld a, SFX_POKEFLUTE
|
ld a, SFX_POKEFLUTE
|
||||||
ld c, BANK(SFX_Pokeflute)
|
ld c, BANK(SFX_Pokeflute)
|
||||||
call PlayMusic
|
call PlayMusic
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ CableClub_DoBattleOrTradeAgain:
|
||||||
call Serial_ExchangeBytes
|
call Serial_ExchangeBytes
|
||||||
ld a, (1 << SERIAL) | (1 << TIMER) | (1 << VBLANK)
|
ld a, (1 << SERIAL) | (1 << TIMER) | (1 << VBLANK)
|
||||||
ld [rIE], a
|
ld [rIE], a
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp USING_INTERNAL_CLOCK
|
cp USING_INTERNAL_CLOCK
|
||||||
|
|
@ -261,7 +261,7 @@ CableClub_DoBattleOrTradeAgain:
|
||||||
ld [wUnusedCF8D + 1], a
|
ld [wUnusedCF8D + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wTradeCenterPointerTableIndex], a
|
ld [wTradeCenterPointerTableIndex], a
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp USING_INTERNAL_CLOCK
|
cp USING_INTERNAL_CLOCK
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ HallOfFamePC:
|
||||||
ld a, %11000000
|
ld a, %11000000
|
||||||
ld [rBGP], a
|
ld [rBGP], a
|
||||||
call EnableLCD
|
call EnableLCD
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
ld c, BANK(Music_Credits)
|
ld c, BANK(Music_Credits)
|
||||||
ld a, MUSIC_CREDITS
|
ld a, MUSIC_CREDITS
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ EvolveMon:
|
||||||
xor a
|
xor a
|
||||||
ld [wLowHealthAlarm], a
|
ld [wLowHealthAlarm], a
|
||||||
ld [wChannelSoundIDs + Ch5], a
|
ld [wChannelSoundIDs + Ch5], a
|
||||||
dec a
|
dec a ; SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
@ -67,7 +67,7 @@ EvolveMon:
|
||||||
ld a, [wEvoNewSpecies]
|
ld a, [wEvoNewSpecies]
|
||||||
.done
|
.done
|
||||||
ld [wWholeScreenPaletteMonSpecies], a
|
ld [wWholeScreenPaletteMonSpecies], a
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld a, [wWholeScreenPaletteMonSpecies]
|
ld a, [wWholeScreenPaletteMonSpecies]
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ SetDefaultNames:
|
||||||
jp CopyData
|
jp CopyData
|
||||||
|
|
||||||
OakSpeech:
|
OakSpeech:
|
||||||
ld a, $FF
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
call PlaySound ; stop music
|
call PlaySound
|
||||||
ld a, BANK(Music_Routes2)
|
ld a, BANK(Music_Routes2)
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, MUSIC_ROUTES2
|
ld a, MUSIC_ROUTES2
|
||||||
|
|
@ -133,9 +133,9 @@ OakSpeech:
|
||||||
ld [wAudioSavedROMBank], a
|
ld [wAudioSavedROMBank], a
|
||||||
ld a, 10
|
ld a, 10
|
||||||
ld [wAudioFadeOutControl], a
|
ld [wAudioFadeOutControl], a
|
||||||
ld a, $FF
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound ; stop music
|
call PlaySound
|
||||||
pop af
|
pop af
|
||||||
ld [H_LOADEDROMBANK], a
|
ld [H_LOADEDROMBANK], a
|
||||||
ld [MBC1RomBank], a
|
ld [MBC1RomBank], a
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ ShakeElevator::
|
||||||
ld de, SCREEN_HEIGHT * $20
|
ld de, SCREEN_HEIGHT * $20
|
||||||
call ShakeElevatorRedrawRow
|
call ShakeElevatorRedrawRow
|
||||||
call Delay3
|
call Delay3
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld a, [hSCY]
|
ld a, [hSCY]
|
||||||
ld d, a
|
ld d, a
|
||||||
|
|
@ -27,7 +27,7 @@ ShakeElevator::
|
||||||
jr nz, .shakeLoop
|
jr nz, .shakeLoop
|
||||||
ld a, d
|
ld a, d
|
||||||
ld [hSCY], a
|
ld [hSCY], a
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld c, BANK(SFX_Safari_Zone_PA)
|
ld c, BANK(SFX_Safari_Zone_PA)
|
||||||
ld a, SFX_SAFARI_ZONE_PA
|
ld a, SFX_SAFARI_ZONE_PA
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ AnimateHealingMachine:
|
||||||
call CopyHealingMachineOAM
|
call CopyHealingMachineOAM
|
||||||
ld a, 4
|
ld a, 4
|
||||||
ld [wAudioFadeOutControl], a
|
ld [wAudioFadeOutControl], a
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
.waitLoop
|
.waitLoop
|
||||||
|
|
@ -38,7 +38,7 @@ AnimateHealingMachine:
|
||||||
cp BANK(Audio3_UpdateMusic)
|
cp BANK(Audio3_UpdateMusic)
|
||||||
ld [wAudioSavedROMBank], a
|
ld [wAudioSavedROMBank], a
|
||||||
jr nz, .next
|
jr nz, .next
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld a, BANK(Music_PkmnHealed)
|
ld a, BANK(Music_PkmnHealed)
|
||||||
|
|
|
||||||
4
home.asm
4
home.asm
|
|
@ -939,7 +939,7 @@ FadeOutAudio::
|
||||||
ld b, a
|
ld b, a
|
||||||
xor a
|
xor a
|
||||||
ld [wAudioFadeOutControl], a
|
ld [wAudioFadeOutControl], a
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld a, [wAudioSavedROMBank]
|
ld a, [wAudioSavedROMBank]
|
||||||
|
|
@ -2506,7 +2506,7 @@ PlayTrainerMusic::
|
||||||
ret nz
|
ret nz
|
||||||
xor a
|
xor a
|
||||||
ld [wAudioFadeOutControl], a
|
ld [wAudioFadeOutControl], a
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld a, BANK(Music_MeetEvilTrainer)
|
ld a, BANK(Music_MeetEvilTrainer)
|
||||||
ld [wAudioROMBank], a
|
ld [wAudioROMBank], a
|
||||||
|
|
|
||||||
|
|
@ -772,7 +772,7 @@ HandleBlackOut::
|
||||||
|
|
||||||
StopMusic::
|
StopMusic::
|
||||||
ld [wAudioFadeOutControl], a
|
ld [wAudioFadeOutControl], a
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
.wait
|
.wait
|
||||||
|
|
|
||||||
16
macros.asm
16
macros.asm
|
|
@ -1,5 +1,11 @@
|
||||||
INCLUDE "macros/asm_macros.asm"
|
INCLUDE "macros/enum.asm"
|
||||||
INCLUDE "macros/data_macros.asm"
|
INCLUDE "macros/predef.asm"
|
||||||
INCLUDE "macros/text_macros.asm"
|
INCLUDE "macros/farcall.asm"
|
||||||
INCLUDE "macros/audio_macros.asm"
|
INCLUDE "macros/data.asm"
|
||||||
INCLUDE "macros/event_macros.asm"
|
INCLUDE "macros/code.asm"
|
||||||
|
INCLUDE "macros/coords.asm"
|
||||||
|
|
||||||
|
INCLUDE "macros/scripts/audio.asm"
|
||||||
|
INCLUDE "macros/scripts/maps.asm"
|
||||||
|
INCLUDE "macros/scripts/events.asm"
|
||||||
|
INCLUDE "macros/scripts/text.asm"
|
||||||
|
|
|
||||||
|
|
@ -1,192 +0,0 @@
|
||||||
|
|
||||||
lb: MACRO ; r, hi, lo
|
|
||||||
ld \1, ((\2) & $ff) << 8 + ((\3) & $ff)
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
homecall: MACRO
|
|
||||||
ld a, [H_LOADEDROMBANK]
|
|
||||||
push af
|
|
||||||
ld a, BANK(\1)
|
|
||||||
ld [H_LOADEDROMBANK], a
|
|
||||||
ld [MBC1RomBank], a
|
|
||||||
call \1
|
|
||||||
pop af
|
|
||||||
ld [H_LOADEDROMBANK], a
|
|
||||||
ld [MBC1RomBank], a
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
farcall EQUS "callba"
|
|
||||||
|
|
||||||
callba: MACRO
|
|
||||||
ld b, BANK(\1)
|
|
||||||
ld hl, \1
|
|
||||||
call Bankswitch
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
callab: MACRO
|
|
||||||
ld hl, \1
|
|
||||||
ld b, BANK(\1)
|
|
||||||
call Bankswitch
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
jpba: MACRO
|
|
||||||
ld b, BANK(\1)
|
|
||||||
ld hl, \1
|
|
||||||
jp Bankswitch
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
jpab: MACRO
|
|
||||||
ld hl, \1
|
|
||||||
ld b, BANK(\1)
|
|
||||||
jp Bankswitch
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
validateCoords: MACRO
|
|
||||||
IF \1 >= SCREEN_WIDTH
|
|
||||||
fail "x coord out of range"
|
|
||||||
ENDC
|
|
||||||
IF \2 >= SCREEN_HEIGHT
|
|
||||||
fail "y coord out of range"
|
|
||||||
ENDC
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
;\1 = r
|
|
||||||
;\2 = X
|
|
||||||
;\3 = Y
|
|
||||||
;\4 = which tilemap (optional)
|
|
||||||
coord: MACRO
|
|
||||||
validateCoords \2, \3
|
|
||||||
IF _NARG >= 4
|
|
||||||
ld \1, \4 + SCREEN_WIDTH * \3 + \2
|
|
||||||
ELSE
|
|
||||||
ld \1, wTileMap + SCREEN_WIDTH * \3 + \2
|
|
||||||
ENDC
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
;\1 = X
|
|
||||||
;\2 = Y
|
|
||||||
;\3 = which tilemap (optional)
|
|
||||||
aCoord: MACRO
|
|
||||||
validateCoords \1, \2
|
|
||||||
IF _NARG >= 3
|
|
||||||
ld a, [\3 + SCREEN_WIDTH * \2 + \1]
|
|
||||||
ELSE
|
|
||||||
ld a, [wTileMap + SCREEN_WIDTH * \2 + \1]
|
|
||||||
ENDC
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
;\1 = X
|
|
||||||
;\2 = Y
|
|
||||||
;\3 = which tilemap (optional)
|
|
||||||
Coorda: MACRO
|
|
||||||
validateCoords \1, \2
|
|
||||||
IF _NARG >= 3
|
|
||||||
ld [\3 + SCREEN_WIDTH * \2 + \1], a
|
|
||||||
ELSE
|
|
||||||
ld [wTileMap + SCREEN_WIDTH * \2 + \1], a
|
|
||||||
ENDC
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
;\1 = X
|
|
||||||
;\2 = Y
|
|
||||||
;\3 = which tilemap (optional)
|
|
||||||
dwCoord: MACRO
|
|
||||||
validateCoords \1, \2
|
|
||||||
IF _NARG >= 3
|
|
||||||
dw \3 + SCREEN_WIDTH * \2 + \1
|
|
||||||
ELSE
|
|
||||||
dw wTileMap + SCREEN_WIDTH * \2 + \1
|
|
||||||
ENDC
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
;\1 = r
|
|
||||||
;\2 = X
|
|
||||||
;\3 = Y
|
|
||||||
;\4 = map width
|
|
||||||
overworldMapCoord: MACRO
|
|
||||||
ld \1, wOverworldMap + ((\2) + 3) + (((\3) + 3) * ((\4) + (3 * 2)))
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; macro for two nibbles
|
|
||||||
dn: MACRO
|
|
||||||
db (\1 << 4 | \2)
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; macro for putting a byte then a word
|
|
||||||
dbw: MACRO
|
|
||||||
db \1
|
|
||||||
dw \2
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
dba: MACRO
|
|
||||||
dbw BANK(\1), \1
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
dwb: MACRO
|
|
||||||
dw \1
|
|
||||||
db \2
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
dab: MACRO
|
|
||||||
dwb \1, BANK(\1)
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
dbbw: MACRO
|
|
||||||
db \1, \2
|
|
||||||
dw \3
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; Predef macro.
|
|
||||||
predef_const: MACRO
|
|
||||||
const \1PredefID
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
add_predef: MACRO
|
|
||||||
\1Predef::
|
|
||||||
db BANK(\1)
|
|
||||||
dw \1
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
predef_id: MACRO
|
|
||||||
ld a, (\1Predef - PredefPointers) / 3
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
predef: MACRO
|
|
||||||
predef_id \1
|
|
||||||
call Predef
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
predef_jump: MACRO
|
|
||||||
predef_id \1
|
|
||||||
jp Predef
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
tx_pre_const: MACRO
|
|
||||||
const \1_id
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
add_tx_pre: MACRO
|
|
||||||
\1_id:: dw \1
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
db_tx_pre: MACRO
|
|
||||||
db (\1_id - TextPredefs) / 2 + 1
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
tx_pre_id: MACRO
|
|
||||||
ld a, (\1_id - TextPredefs) / 2 + 1
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
tx_pre: MACRO
|
|
||||||
tx_pre_id \1
|
|
||||||
call PrintPredefTextID
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
tx_pre_jump: MACRO
|
|
||||||
tx_pre_id \1
|
|
||||||
jp PrintPredefTextID
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
ldPal: MACRO
|
|
||||||
ld \1, \2 << 6 | \3 << 4 | \4 << 2 | \5
|
|
||||||
ENDM
|
|
||||||
9
macros/code.asm
Executable file
9
macros/code.asm
Executable file
|
|
@ -0,0 +1,9 @@
|
||||||
|
; Syntactic sugar macros
|
||||||
|
|
||||||
|
lb: MACRO ; r, hi, lo
|
||||||
|
ld \1, ((\2) & $ff) << 8 + ((\3) & $ff)
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
ldPal: MACRO
|
||||||
|
ld \1, \2 << 6 | \3 << 4 | \4 << 2 | \5
|
||||||
|
ENDM
|
||||||
65
macros/coords.asm
Normal file
65
macros/coords.asm
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
validateCoords: MACRO
|
||||||
|
IF \1 >= SCREEN_WIDTH
|
||||||
|
fail "x coord out of range"
|
||||||
|
ENDC
|
||||||
|
IF \2 >= SCREEN_HEIGHT
|
||||||
|
fail "y coord out of range"
|
||||||
|
ENDC
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
;\1 = r
|
||||||
|
;\2 = X
|
||||||
|
;\3 = Y
|
||||||
|
;\4 = which tilemap (optional)
|
||||||
|
coord: MACRO
|
||||||
|
validateCoords \2, \3
|
||||||
|
IF _NARG >= 4
|
||||||
|
ld \1, \4 + SCREEN_WIDTH * \3 + \2
|
||||||
|
ELSE
|
||||||
|
ld \1, wTileMap + SCREEN_WIDTH * \3 + \2
|
||||||
|
ENDC
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
;\1 = X
|
||||||
|
;\2 = Y
|
||||||
|
;\3 = which tilemap (optional)
|
||||||
|
aCoord: MACRO
|
||||||
|
validateCoords \1, \2
|
||||||
|
IF _NARG >= 3
|
||||||
|
ld a, [\3 + SCREEN_WIDTH * \2 + \1]
|
||||||
|
ELSE
|
||||||
|
ld a, [wTileMap + SCREEN_WIDTH * \2 + \1]
|
||||||
|
ENDC
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
;\1 = X
|
||||||
|
;\2 = Y
|
||||||
|
;\3 = which tilemap (optional)
|
||||||
|
Coorda: MACRO
|
||||||
|
validateCoords \1, \2
|
||||||
|
IF _NARG >= 3
|
||||||
|
ld [\3 + SCREEN_WIDTH * \2 + \1], a
|
||||||
|
ELSE
|
||||||
|
ld [wTileMap + SCREEN_WIDTH * \2 + \1], a
|
||||||
|
ENDC
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
;\1 = X
|
||||||
|
;\2 = Y
|
||||||
|
;\3 = which tilemap (optional)
|
||||||
|
dwCoord: MACRO
|
||||||
|
validateCoords \1, \2
|
||||||
|
IF _NARG >= 3
|
||||||
|
dw \3 + SCREEN_WIDTH * \2 + \1
|
||||||
|
ELSE
|
||||||
|
dw wTileMap + SCREEN_WIDTH * \2 + \1
|
||||||
|
ENDC
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
;\1 = r
|
||||||
|
;\2 = X
|
||||||
|
;\3 = Y
|
||||||
|
;\4 = map width
|
||||||
|
overworldMapCoord: MACRO
|
||||||
|
ld \1, wOverworldMap + ((\2) + 3) + (((\3) + 3) * ((\4) + (3 * 2)))
|
||||||
|
ENDM
|
||||||
62
macros/data.asm
Executable file
62
macros/data.asm
Executable file
|
|
@ -0,0 +1,62 @@
|
||||||
|
; Value macros
|
||||||
|
|
||||||
|
percent EQUS "* $ff / 100"
|
||||||
|
|
||||||
|
bcd2: MACRO
|
||||||
|
dn ((\1) / 1000) % 10, ((\1) / 100) % 10
|
||||||
|
dn ((\1) / 10) % 10, (\1) % 10
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
bcd3: MACRO
|
||||||
|
dn ((\1) / 100000) % 10, ((\1) / 10000) % 10
|
||||||
|
dn ((\1) / 1000) % 10, ((\1) / 100) % 10
|
||||||
|
dn ((\1) / 10) % 10, (\1) % 10
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
coins equs "bcd2"
|
||||||
|
money equs "bcd3"
|
||||||
|
|
||||||
|
RGB: MACRO
|
||||||
|
dw (\3 << 10 | \2 << 5 | \1)
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
tmlearn: MACRO
|
||||||
|
x = 0
|
||||||
|
REPT _NARG
|
||||||
|
IF \1 != 0
|
||||||
|
x = x | (1 << ((\1 - 1) % 8))
|
||||||
|
ENDC
|
||||||
|
SHIFT
|
||||||
|
ENDR
|
||||||
|
db x
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
|
; Constant data (db, dw, dl) macros
|
||||||
|
|
||||||
|
dn: MACRO ; nybbles
|
||||||
|
db (\1 << 4 | \2)
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
dbw: MACRO
|
||||||
|
db \1
|
||||||
|
dw \2
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
dba: MACRO
|
||||||
|
dbw BANK(\1), \1
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
dwb: MACRO
|
||||||
|
dw \1
|
||||||
|
db \2
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
dab: MACRO
|
||||||
|
dwb \1, BANK(\1)
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
dbbw: MACRO
|
||||||
|
db \1, \2
|
||||||
|
dw \3
|
||||||
|
ENDM
|
||||||
43
macros/enum.asm
Normal file
43
macros/enum.asm
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
; Enumerate variables
|
||||||
|
|
||||||
|
enum_start: MACRO
|
||||||
|
if _NARG >= 1
|
||||||
|
__enum__ = \1
|
||||||
|
else
|
||||||
|
__enum__ = 0
|
||||||
|
endc
|
||||||
|
if _NARG >= 2
|
||||||
|
__enumdir__ = \2
|
||||||
|
else
|
||||||
|
__enumdir__ = 1
|
||||||
|
endc
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
enum: MACRO
|
||||||
|
\1 EQU __enum__
|
||||||
|
__enum__ = __enum__ + __enumdir__
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
enum_set: MACRO
|
||||||
|
__enum__ = \1
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
; Enumerate constants
|
||||||
|
|
||||||
|
const_def: MACRO
|
||||||
|
if _NARG >= 1
|
||||||
|
const_value = \1
|
||||||
|
else
|
||||||
|
const_value = 0
|
||||||
|
endc
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
const: MACRO
|
||||||
|
\1 EQU const_value
|
||||||
|
const_value = const_value + 1
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
shift_const: MACRO
|
||||||
|
\1 EQU (1 << const_value)
|
||||||
|
const_value = const_value + 1
|
||||||
|
ENDM
|
||||||
37
macros/farcall.asm
Normal file
37
macros/farcall.asm
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
farcall EQUS "callba"
|
||||||
|
|
||||||
|
callba: MACRO
|
||||||
|
ld b, BANK(\1)
|
||||||
|
ld hl, \1
|
||||||
|
call Bankswitch
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
callab: MACRO
|
||||||
|
ld hl, \1
|
||||||
|
ld b, BANK(\1)
|
||||||
|
call Bankswitch
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
jpba: MACRO
|
||||||
|
ld b, BANK(\1)
|
||||||
|
ld hl, \1
|
||||||
|
jp Bankswitch
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
jpab: MACRO
|
||||||
|
ld hl, \1
|
||||||
|
ld b, BANK(\1)
|
||||||
|
jp Bankswitch
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
homecall: MACRO
|
||||||
|
ld a, [H_LOADEDROMBANK]
|
||||||
|
push af
|
||||||
|
ld a, BANK(\1)
|
||||||
|
ld [H_LOADEDROMBANK], a
|
||||||
|
ld [MBC1RomBank], a
|
||||||
|
call \1
|
||||||
|
pop af
|
||||||
|
ld [H_LOADEDROMBANK], a
|
||||||
|
ld [MBC1RomBank], a
|
||||||
|
ENDM
|
||||||
49
macros/predef.asm
Normal file
49
macros/predef.asm
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
predef_const: MACRO
|
||||||
|
const \1PredefID
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
add_predef: MACRO
|
||||||
|
\1Predef::
|
||||||
|
db BANK(\1)
|
||||||
|
dw \1
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
predef_id: MACRO
|
||||||
|
ld a, (\1Predef - PredefPointers) / 3
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
predef: MACRO
|
||||||
|
predef_id \1
|
||||||
|
call Predef
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
predef_jump: MACRO
|
||||||
|
predef_id \1
|
||||||
|
jp Predef
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
tx_pre_const: MACRO
|
||||||
|
const \1_id
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
add_tx_pre: MACRO
|
||||||
|
\1_id:: dw \1
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
db_tx_pre: MACRO
|
||||||
|
db (\1_id - TextPredefs) / 2 + 1
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
tx_pre_id: MACRO
|
||||||
|
ld a, (\1_id - TextPredefs) / 2 + 1
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
tx_pre: MACRO
|
||||||
|
tx_pre_id \1
|
||||||
|
call PrintPredefTextID
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
tx_pre_jump: MACRO
|
||||||
|
tx_pre_id \1
|
||||||
|
jp PrintPredefTextID
|
||||||
|
ENDM
|
||||||
|
|
@ -1,18 +1,3 @@
|
||||||
|
|
||||||
StopAllMusic: MACRO
|
|
||||||
ld a, $ff
|
|
||||||
call PlaySound
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
Ch1 EQU 0
|
|
||||||
Ch2 EQU 1
|
|
||||||
Ch3 EQU 2
|
|
||||||
Ch4 EQU 3
|
|
||||||
Ch5 EQU 4
|
|
||||||
Ch6 EQU 5
|
|
||||||
Ch7 EQU 6
|
|
||||||
Ch8 EQU 7
|
|
||||||
|
|
||||||
audio_header: MACRO
|
audio_header: MACRO
|
||||||
db (_NARG - 2) << 6 | \2
|
db (_NARG - 2) << 6 | \2
|
||||||
dw \1_\2
|
dw \1_\2
|
||||||
|
|
@ -73,19 +58,6 @@ noise_note: MACRO
|
||||||
db \4
|
db \4
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
C_ EQU $0
|
|
||||||
C# EQU $1
|
|
||||||
D_ EQU $2
|
|
||||||
D# EQU $3
|
|
||||||
E_ EQU $4
|
|
||||||
F_ EQU $5
|
|
||||||
F# EQU $6
|
|
||||||
G_ EQU $7
|
|
||||||
G# EQU $8
|
|
||||||
A_ EQU $9
|
|
||||||
A# EQU $A
|
|
||||||
B_ EQU $B
|
|
||||||
|
|
||||||
; arguments: pitch, length [1, 16]
|
; arguments: pitch, length [1, 16]
|
||||||
note: MACRO
|
note: MACRO
|
||||||
db (\1 << 4) | (\2 - 1)
|
db (\1 << 4) | (\2 - 1)
|
||||||
|
|
@ -15,7 +15,8 @@ event_byte = ((\1) / 8)
|
||||||
ELSE
|
ELSE
|
||||||
bit (\1) % 8, a
|
bit (\1) % 8, a
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
CheckEventReuseA: MACRO
|
CheckEventReuseA: MACRO
|
||||||
|
|
@ -25,7 +26,8 @@ event_byte = ((\1) / 8)
|
||||||
ENDC
|
ENDC
|
||||||
|
|
||||||
bit (\1) % 8, a
|
bit (\1) % 8, a
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
;\2 = event index of the last event used before the branch
|
;\2 = event index of the last event used before the branch
|
||||||
|
|
@ -37,7 +39,8 @@ event_byte = ((\1) / 8)
|
||||||
ENDC
|
ENDC
|
||||||
|
|
||||||
bit (\1) % 8, a
|
bit (\1) % 8, a
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = reg
|
;\1 = reg
|
||||||
;\2 = event index
|
;\2 = event index
|
||||||
|
|
@ -48,21 +51,24 @@ EventFlagBit: MACRO
|
||||||
ELSE
|
ELSE
|
||||||
ld \1, (\2) % 8
|
ld \1, (\2) % 8
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = reg
|
;\1 = reg
|
||||||
;\2 = event index
|
;\2 = event index
|
||||||
EventFlagAddress: MACRO
|
EventFlagAddress: MACRO
|
||||||
event_byte = ((\2) / 8)
|
event_byte = ((\2) / 8)
|
||||||
ld \1, wEventFlags + event_byte
|
ld \1, wEventFlags + event_byte
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
CheckEventHL: MACRO
|
CheckEventHL: MACRO
|
||||||
event_byte = ((\1) / 8)
|
event_byte = ((\1) / 8)
|
||||||
ld hl, wEventFlags + event_byte
|
ld hl, wEventFlags + event_byte
|
||||||
bit (\1) % 8, [hl]
|
bit (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
CheckEventReuseHL: MACRO
|
CheckEventReuseHL: MACRO
|
||||||
|
|
@ -72,14 +78,16 @@ event_byte = ((\1) / 8)
|
||||||
ENDC
|
ENDC
|
||||||
|
|
||||||
bit (\1) % 8, [hl]
|
bit (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
; dangerous, only use when HL is guaranteed to be the desired value
|
; dangerous, only use when HL is guaranteed to be the desired value
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
CheckEventForceReuseHL: MACRO
|
CheckEventForceReuseHL: MACRO
|
||||||
event_byte = ((\1) / 8)
|
event_byte = ((\1) / 8)
|
||||||
bit (\1) % 8, [hl]
|
bit (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
;\2 = event index of the last event used before the branch
|
;\2 = event index of the last event used before the branch
|
||||||
|
|
@ -91,7 +99,8 @@ event_byte = ((\1) / 8)
|
||||||
ENDC
|
ENDC
|
||||||
|
|
||||||
bit (\1) % 8, [hl]
|
bit (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
CheckAndSetEvent: MACRO
|
CheckAndSetEvent: MACRO
|
||||||
|
|
@ -99,7 +108,8 @@ event_byte = ((\1) / 8)
|
||||||
ld hl, wEventFlags + event_byte
|
ld hl, wEventFlags + event_byte
|
||||||
bit (\1) % 8, [hl]
|
bit (\1) % 8, [hl]
|
||||||
set (\1) % 8, [hl]
|
set (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
CheckAndResetEvent: MACRO
|
CheckAndResetEvent: MACRO
|
||||||
|
|
@ -107,7 +117,8 @@ event_byte = ((\1) / 8)
|
||||||
ld hl, wEventFlags + event_byte
|
ld hl, wEventFlags + event_byte
|
||||||
bit (\1) % 8, [hl]
|
bit (\1) % 8, [hl]
|
||||||
res (\1) % 8, [hl]
|
res (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
CheckAndSetEventA: MACRO
|
CheckAndSetEventA: MACRO
|
||||||
|
|
@ -115,7 +126,8 @@ CheckAndSetEventA: MACRO
|
||||||
bit (\1) % 8, a
|
bit (\1) % 8, a
|
||||||
set (\1) % 8, a
|
set (\1) % 8, a
|
||||||
ld [wEventFlags + ((\1) / 8)], a
|
ld [wEventFlags + ((\1) / 8)], a
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
CheckAndResetEventA: MACRO
|
CheckAndResetEventA: MACRO
|
||||||
|
|
@ -123,14 +135,16 @@ CheckAndResetEventA: MACRO
|
||||||
bit (\1) % 8, a
|
bit (\1) % 8, a
|
||||||
res (\1) % 8, a
|
res (\1) % 8, a
|
||||||
ld [wEventFlags + ((\1) / 8)], a
|
ld [wEventFlags + ((\1) / 8)], a
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
SetEvent: MACRO
|
SetEvent: MACRO
|
||||||
event_byte = ((\1) / 8)
|
event_byte = ((\1) / 8)
|
||||||
ld hl, wEventFlags + event_byte
|
ld hl, wEventFlags + event_byte
|
||||||
set (\1) % 8, [hl]
|
set (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
SetEventReuseHL: MACRO
|
SetEventReuseHL: MACRO
|
||||||
|
|
@ -140,7 +154,8 @@ event_byte = ((\1) / 8)
|
||||||
ENDC
|
ENDC
|
||||||
|
|
||||||
set (\1) % 8, [hl]
|
set (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
;\2 = event index of the last event used before the branch
|
;\2 = event index of the last event used before the branch
|
||||||
|
|
@ -152,14 +167,16 @@ event_byte = ((\1) / 8)
|
||||||
ENDC
|
ENDC
|
||||||
|
|
||||||
set (\1) % 8, [hl]
|
set (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
; dangerous, only use when HL is guaranteed to be the desired value
|
; dangerous, only use when HL is guaranteed to be the desired value
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
SetEventForceReuseHL: MACRO
|
SetEventForceReuseHL: MACRO
|
||||||
event_byte = ((\1) / 8)
|
event_byte = ((\1) / 8)
|
||||||
set (\1) % 8, [hl]
|
set (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
;\2 = event index
|
;\2 = event index
|
||||||
|
|
@ -170,14 +187,16 @@ SetEvents: MACRO
|
||||||
SetEventReuseHL \2
|
SetEventReuseHL \2
|
||||||
shift
|
shift
|
||||||
endr
|
endr
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
ResetEvent: MACRO
|
ResetEvent: MACRO
|
||||||
event_byte = ((\1) / 8)
|
event_byte = ((\1) / 8)
|
||||||
ld hl, wEventFlags + event_byte
|
ld hl, wEventFlags + event_byte
|
||||||
res (\1) % 8, [hl]
|
res (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
ResetEventReuseHL: MACRO
|
ResetEventReuseHL: MACRO
|
||||||
|
|
@ -187,7 +206,8 @@ event_byte = ((\1) / 8)
|
||||||
ENDC
|
ENDC
|
||||||
|
|
||||||
res (\1) % 8, [hl]
|
res (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
;\2 = event index of the last event used before the branch
|
;\2 = event index of the last event used before the branch
|
||||||
|
|
@ -199,14 +219,16 @@ event_byte = ((\1) / 8)
|
||||||
ENDC
|
ENDC
|
||||||
|
|
||||||
res (\1) % 8, [hl]
|
res (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
; dangerous, only use when HL is guaranteed to be the desired value
|
; dangerous, only use when HL is guaranteed to be the desired value
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
ResetEventForceReuseHL: MACRO
|
ResetEventForceReuseHL: MACRO
|
||||||
event_byte = ((\1) / 8)
|
event_byte = ((\1) / 8)
|
||||||
res (\1) % 8, [hl]
|
res (\1) % 8, [hl]
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
;\2 = event index
|
;\2 = event index
|
||||||
|
|
@ -217,7 +239,8 @@ ResetEvents: MACRO
|
||||||
ResetEventReuseHL \2
|
ResetEventReuseHL \2
|
||||||
shift
|
shift
|
||||||
endr
|
endr
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
;\2 = number of bytes away from the base address (optional, for matching the ROM)
|
;\2 = number of bytes away from the base address (optional, for matching the ROM)
|
||||||
|
|
@ -227,7 +250,8 @@ dbEventFlagBit: MACRO
|
||||||
ELSE
|
ELSE
|
||||||
db ((\1) % 8)
|
db ((\1) % 8)
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
;\2 = number of bytes away from the base address (optional, for matching the ROM)
|
;\2 = number of bytes away from the base address (optional, for matching the ROM)
|
||||||
|
|
@ -237,7 +261,8 @@ dwEventFlagAddress: MACRO
|
||||||
ELSE
|
ELSE
|
||||||
dw wEventFlags + ((\1) / 8)
|
dw wEventFlags + ((\1) / 8)
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = start
|
;\1 = start
|
||||||
;\2 = end
|
;\2 = end
|
||||||
|
|
@ -297,7 +322,8 @@ event_fill_count = event_fill_count + 1
|
||||||
ENDC
|
ENDC
|
||||||
ENDC
|
ENDC
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
;\1 = start
|
;\1 = start
|
||||||
;\2 = end
|
;\2 = end
|
||||||
|
|
@ -362,7 +388,8 @@ event_fill_count = event_fill_count + 1
|
||||||
ENDC
|
ENDC
|
||||||
ENDC
|
ENDC
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
; returns whether both events are set in Z flag
|
; returns whether both events are set in Z flag
|
||||||
; This is counter-intuitive because the other event checks set the Z flag when
|
; This is counter-intuitive because the other event checks set the Z flag when
|
||||||
|
|
@ -400,7 +427,8 @@ event_byte = ((\1) / 8)
|
||||||
pop bc
|
pop bc
|
||||||
ENDC
|
ENDC
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
; returns the complement of whether either event is set in Z flag
|
; returns the complement of whether either event is set in Z flag
|
||||||
;\1 = event index 1
|
;\1 = event index 1
|
||||||
|
|
@ -429,7 +457,8 @@ CheckEitherEventSet: MACRO
|
||||||
pop bc
|
pop bc
|
||||||
ENDC
|
ENDC
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
|
||||||
; for handling fixed event bits when events are inserted/removed
|
; for handling fixed event bits when events are inserted/removed
|
||||||
;\1 = event index
|
;\1 = event index
|
||||||
|
|
@ -438,4 +467,5 @@ AdjustEventBit: MACRO
|
||||||
IF ((\1) % 8) != (\2)
|
IF ((\1) % 8) != (\2)
|
||||||
add ((\1) % 8) - (\2)
|
add ((\1) % 8) - (\2)
|
||||||
ENDC
|
ENDC
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
95
macros/data_macros.asm → macros/scripts/maps.asm
Executable file → Normal file
95
macros/data_macros.asm → macros/scripts/maps.asm
Executable file → Normal file
|
|
@ -1,39 +1,6 @@
|
||||||
|
;\1 map width
|
||||||
; Constant enumeration is useful for monsters, items, moves, etc.
|
;\2 Rows above (Y-blocks)
|
||||||
const_def: MACRO
|
;\3 X movement (X-blocks)
|
||||||
if _NARG >= 1
|
|
||||||
const_value = \1
|
|
||||||
else
|
|
||||||
const_value = 0
|
|
||||||
endc
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
const: MACRO
|
|
||||||
\1 EQU const_value
|
|
||||||
const_value = const_value + 1
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
; data format macros
|
|
||||||
|
|
||||||
percent EQUS "* $ff / 100"
|
|
||||||
|
|
||||||
bcd2: MACRO
|
|
||||||
dn ((\1) / 1000) % 10, ((\1) / 100) % 10
|
|
||||||
dn ((\1) / 10) % 10, (\1) % 10
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
bcd3: MACRO
|
|
||||||
dn ((\1) / 100000) % 10, ((\1) / 10000) % 10
|
|
||||||
dn ((\1) / 1000) % 10, ((\1) / 100) % 10
|
|
||||||
dn ((\1) / 10) % 10, (\1) % 10
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
coins equs "bcd2"
|
|
||||||
money equs "bcd3"
|
|
||||||
|
|
||||||
;\1 = Map Width
|
|
||||||
;\2 = Rows above (Y-blocks)
|
|
||||||
;\3 = X movement (X-blocks)
|
|
||||||
EVENT_DISP: MACRO
|
EVENT_DISP: MACRO
|
||||||
dw (wOverworldMap + 7 + (\1) + ((\1) + 6) * ((\2) >> 1) + ((\3) >> 1)) ; Ev.Disp
|
dw (wOverworldMap + 7 + (\1) + ((\1) + 6) * ((\2) >> 1) + ((\3) >> 1)) ; Ev.Disp
|
||||||
db \2,\3 ;Y,X
|
db \2,\3 ;Y,X
|
||||||
|
|
@ -67,32 +34,6 @@ IMAP: MACRO ; imap mapid_less_than,x-coordinate,y-coordinate,textpointer
|
||||||
dw \4
|
dw \4
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
; tilesets' headers macro
|
|
||||||
tileset: MACRO
|
|
||||||
db BANK(\2) ; BANK(GFX)
|
|
||||||
dw \1, \2, \3 ; Block, GFX, Coll
|
|
||||||
db \4, \5, \6 ; counter tiles
|
|
||||||
db \7 ; grass tile
|
|
||||||
db \8 ; permission (indoor, cave, outdoor)
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
INDOOR EQU 0
|
|
||||||
CAVE EQU 1
|
|
||||||
OUTDOOR EQU 2
|
|
||||||
|
|
||||||
RGB: MACRO
|
|
||||||
dw (\3 << 10 | \2 << 5 | \1)
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
WALK EQU $FE
|
|
||||||
STAY EQU $FF
|
|
||||||
|
|
||||||
DOWN EQU $D0
|
|
||||||
UP EQU $D1
|
|
||||||
LEFT EQU $D2
|
|
||||||
RIGHT EQU $D3
|
|
||||||
NONE EQU $FF
|
|
||||||
|
|
||||||
;\1 sprite id
|
;\1 sprite id
|
||||||
;\2 x position
|
;\2 x position
|
||||||
;\3 y position
|
;\3 y position
|
||||||
|
|
@ -144,11 +85,11 @@ warp_to: MACRO
|
||||||
EVENT_DISP \3, \2, \1
|
EVENT_DISP \3, \2, \1
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
;\1 map name
|
||||||
|
;\2 map id
|
||||||
|
;\3 tileset
|
||||||
|
;\4 connections: combo of NORTH, SOUTH, WEST, and/or EAST, or 0 for none
|
||||||
map_header: MACRO
|
map_header: MACRO
|
||||||
;\1: map name
|
|
||||||
;\2: map id
|
|
||||||
;\3: tileset
|
|
||||||
;\4: connections: combo of NORTH, SOUTH, WEST, and/or EAST, or 0 for none
|
|
||||||
CURRENT_MAP_WIDTH = \2_WIDTH
|
CURRENT_MAP_WIDTH = \2_WIDTH
|
||||||
CURRENT_MAP_HEIGHT = \2_HEIGHT
|
CURRENT_MAP_HEIGHT = \2_HEIGHT
|
||||||
CURRENT_MAP_OBJECT EQUS "\1_Object"
|
CURRENT_MAP_OBJECT EQUS "\1_Object"
|
||||||
|
|
@ -161,6 +102,7 @@ CURRENT_MAP_OBJECT EQUS "\1_Object"
|
||||||
db \4
|
db \4
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
; Comes after map_header and connection macros
|
||||||
end_map_header: MACRO
|
end_map_header: MACRO
|
||||||
dw CURRENT_MAP_OBJECT
|
dw CURRENT_MAP_OBJECT
|
||||||
PURGE CURRENT_MAP_WIDTH
|
PURGE CURRENT_MAP_WIDTH
|
||||||
|
|
@ -169,12 +111,12 @@ PURGE CURRENT_MAP_OBJECT
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
; Connections go in order: north, south, west, east
|
; Connections go in order: north, south, west, east
|
||||||
|
;\1 direction
|
||||||
|
;\2 map name
|
||||||
|
;\3 map id
|
||||||
|
;\4 offset of the target map relative to the current map
|
||||||
|
; (x offset for east/west, y offset for north/south)
|
||||||
connection: MACRO
|
connection: MACRO
|
||||||
;\1: direction
|
|
||||||
;\2: map name
|
|
||||||
;\3: map id
|
|
||||||
;\4: offset of the target map relative to the current map
|
|
||||||
; (x offset for east/west, y offset for north/south)
|
|
||||||
|
|
||||||
; Calculate tile offsets for source (current) and target maps
|
; Calculate tile offsets for source (current) and target maps
|
||||||
_src = 0
|
_src = 0
|
||||||
|
|
@ -240,14 +182,3 @@ endc
|
||||||
db _y, _x
|
db _y, _x
|
||||||
dw wOverworldMap + _win
|
dw wOverworldMap + _win
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
tmlearn: MACRO
|
|
||||||
x = 0
|
|
||||||
REPT _NARG
|
|
||||||
IF \1 != 0
|
|
||||||
x = x | (1 << ((\1 - 1) % 8))
|
|
||||||
ENDC
|
|
||||||
SHIFT
|
|
||||||
ENDR
|
|
||||||
db x
|
|
||||||
ENDM
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
; text macros
|
|
||||||
text EQUS "db $00," ; Start writing text.
|
text EQUS "db $00," ; Start writing text.
|
||||||
next EQUS "db $4e," ; Move a line down.
|
next EQUS "db $4e," ; Move a line down.
|
||||||
line EQUS "db $4f," ; Start writing at the bottom line.
|
line EQUS "db $4f," ; Start writing at the bottom line.
|
||||||
|
|
@ -64,7 +64,7 @@ CeruleanCityScript0:
|
||||||
ld a, [wWalkBikeSurfState]
|
ld a, [wWalkBikeSurfState]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_19512
|
jr z, .asm_19512
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
.asm_19512
|
.asm_19512
|
||||||
|
|
@ -171,7 +171,7 @@ CeruleanCityScript2:
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [hSpriteIndexOrTextID], a
|
ld [hSpriteIndexOrTextID], a
|
||||||
call DisplayTextID
|
call DisplayTextID
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
callba Music_RivalAlternateStart
|
callba Music_RivalAlternateStart
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@ OaksLabScript15:
|
||||||
xor a
|
xor a
|
||||||
ld [hJoyHeld], a
|
ld [hJoyHeld], a
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
callba Music_RivalAlternateStart
|
callba Music_RivalAlternateStart
|
||||||
|
|
@ -611,7 +611,7 @@ OaksLabScript16:
|
||||||
xor a ; NPC_MOVEMENT_DOWN
|
xor a ; NPC_MOVEMENT_DOWN
|
||||||
call FillMemory
|
call FillMemory
|
||||||
ld [hl], $ff
|
ld [hl], $ff
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
callba Music_RivalAlternateStart
|
callba Music_RivalAlternateStart
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ PalletTownScript0:
|
||||||
ld [hJoyHeld], a
|
ld [hJoyHeld], a
|
||||||
ld a, PLAYER_DIR_DOWN
|
ld a, PLAYER_DIR_DOWN
|
||||||
ld [wPlayerMovingDirection], a
|
ld [wPlayerMovingDirection], a
|
||||||
ld a, $FF
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
call PlaySound ; stop music
|
call PlaySound
|
||||||
ld a, BANK(Music_MeetProfOak)
|
ld a, BANK(Music_MeetProfOak)
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, MUSIC_MEET_PROF_OAK ; “oak appears” music
|
ld a, MUSIC_MEET_PROF_OAK ; “oak appears” music
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ PewterJigglypuffText:
|
||||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||||
ld hl, .Text
|
ld hl, .Text
|
||||||
call PrintText
|
call PrintText
|
||||||
StopAllMusic
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
|
call PlaySound
|
||||||
ld c, 32
|
ld c, 32
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, JigglypuffFacingDirections
|
ld hl, JigglypuffFacingDirections
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ PokemonTower2Script0:
|
||||||
ld hl, CoordsData_6055e
|
ld hl, CoordsData_6055e
|
||||||
call ArePlayerCoordsInArray
|
call ArePlayerCoordsInArray
|
||||||
ret nc
|
ret nc
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld c, BANK(Music_MeetRival)
|
ld c, BANK(Music_MeetRival)
|
||||||
|
|
@ -76,7 +76,7 @@ PokemonTower2Script1:
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_SPRITEINDEX], a
|
ld [H_SPRITEINDEX], a
|
||||||
call MoveSprite
|
call MoveSprite
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
callba Music_RivalAlternateStart
|
callba Music_RivalAlternateStart
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ Route22Script0:
|
||||||
ld a, [wWalkBikeSurfState]
|
ld a, [wWalkBikeSurfState]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_50f4e
|
jr z, .asm_50f4e
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
.asm_50f4e
|
.asm_50f4e
|
||||||
|
|
@ -167,7 +167,7 @@ Route22Script2:
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [hSpriteIndexOrTextID], a
|
ld [hSpriteIndexOrTextID], a
|
||||||
call DisplayTextID
|
call DisplayTextID
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
callba Music_RivalAlternateStart
|
callba Music_RivalAlternateStart
|
||||||
|
|
@ -241,11 +241,11 @@ Route22Script_5104e:
|
||||||
ld a, [wWalkBikeSurfState]
|
ld a, [wWalkBikeSurfState]
|
||||||
and a
|
and a
|
||||||
jr z, .skipYVisibilityTesta
|
jr z, .skipYVisibilityTesta
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
.skipYVisibilityTesta
|
.skipYVisibilityTesta
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
callba Music_RivalAlternateTempo
|
callba Music_RivalAlternateTempo
|
||||||
|
|
@ -326,7 +326,7 @@ Route22Script5:
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [hSpriteIndexOrTextID], a
|
ld [hSpriteIndexOrTextID], a
|
||||||
call DisplayTextID
|
call DisplayTextID
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
callba Music_RivalAlternateStartAndTempo
|
callba Music_RivalAlternateStartAndTempo
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ SSAnne2Script0:
|
||||||
ld hl, CoordsData_61411
|
ld hl, CoordsData_61411
|
||||||
call ArePlayerCoordsInArray
|
call ArePlayerCoordsInArray
|
||||||
ret nc
|
ret nc
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld c, BANK(Music_MeetRival)
|
ld c, BANK(Music_MeetRival)
|
||||||
|
|
@ -145,7 +145,7 @@ SSAnne2Script2:
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [H_SPRITEINDEX], a
|
ld [H_SPRITEINDEX], a
|
||||||
call MoveSprite
|
call MoveSprite
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
callba Music_RivalAlternateStart
|
callba Music_RivalAlternateStart
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ SSAnne7RubText:
|
||||||
cp BANK(Audio3_UpdateMusic)
|
cp BANK(Audio3_UpdateMusic)
|
||||||
ld [wAudioSavedROMBank], a
|
ld [wAudioSavedROMBank], a
|
||||||
jr nz, .asm_61908
|
jr nz, .asm_61908
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld a, Bank(Music_PkmnHealed)
|
ld a, Bank(Music_PkmnHealed)
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ SilphCo7Script0:
|
||||||
ld [wJoyIgnore], a
|
ld [wJoyIgnore], a
|
||||||
ld a, PLAYER_DIR_DOWN
|
ld a, PLAYER_DIR_DOWN
|
||||||
ld [wPlayerMovingDirection], a
|
ld [wPlayerMovingDirection], a
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld c, BANK(Music_MeetRival)
|
ld c, BANK(Music_MeetRival)
|
||||||
|
|
@ -219,7 +219,7 @@ SilphCo7Script4:
|
||||||
ld a, $f
|
ld a, $f
|
||||||
ld [hSpriteIndexOrTextID], a
|
ld [hSpriteIndexOrTextID], a
|
||||||
call DisplayTextID
|
call DisplayTextID
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
callba Music_RivalAlternateStart
|
callba Music_RivalAlternateStart
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ VermilionDock_Script:
|
||||||
|
|
||||||
VermilionDock_1db9b:
|
VermilionDock_1db9b:
|
||||||
SetEventForceReuseHL EVENT_SS_ANNE_LEFT
|
SetEventForceReuseHL EVENT_SS_ANNE_LEFT
|
||||||
ld a, $ff
|
ld a, SFX_STOP_ALL_MUSIC
|
||||||
ld [wJoyIgnore], a
|
ld [wJoyIgnore], a
|
||||||
ld [wNewSoundID], a
|
ld [wNewSoundID], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue