Start organizing WRAM

- Use db and dw when they're more meaningful than ds 1/2
- Use unions to group related labels
This commit is contained in:
Remy Oukaour 2017-12-09 13:52:14 -05:00
parent 0b7d8d44ad
commit 16c6696dd5
14 changed files with 195 additions and 223 deletions

View File

@ -60,15 +60,15 @@ _MapSetup_Sound_Off:: ; e8000
MusicFadeRestart: ; e803d MusicFadeRestart: ; e803d
; restart but keep the music id to fade in to ; restart but keep the music id to fade in to
ld a, [MusicFadeIDHi] ld a, [MusicFadeID + 1]
push af push af
ld a, [MusicFadeIDLo] ld a, [MusicFadeID]
push af push af
call _MapSetup_Sound_Off call _MapSetup_Sound_Off
pop af pop af
ld [MusicFadeIDLo], a ld [MusicFadeID], a
pop af pop af
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ret ret
; e8051 ; e8051
@ -654,11 +654,11 @@ FadeMusic: ; e8358
; restart sound ; restart sound
call MusicFadeRestart call MusicFadeRestart
; get new song id ; get new song id
ld a, [MusicFadeIDLo] ld a, [MusicFadeID]
and a and a
jr z, .quit ; this assumes there are fewer than 256 songs! jr z, .quit ; this assumes there are fewer than 256 songs!
ld e, a ld e, a
ld a, [MusicFadeIDHi] ld a, [MusicFadeID + 1]
ld d, a ld d, a
; load new song ; load new song
call _PlayMusic call _PlayMusic
@ -679,9 +679,9 @@ FadeMusic: ; e8358
xor a xor a
ld [Volume], a ld [Volume], a
; get new song id ; get new song id
ld a, [MusicFadeIDLo] ld a, [MusicFadeID]
ld e, a ld e, a
ld a, [MusicFadeIDHi] ld a, [MusicFadeID + 1]
ld d, a ld d, a
; load new song ; load new song
call _PlayMusic call _PlayMusic
@ -1364,9 +1364,9 @@ GetNoiseSample: ; e86c5
add hl, de add hl, de
; load sample pointer into NoiseSampleAddress ; load sample pointer into NoiseSampleAddress
ld a, [hli] ld a, [hli]
ld [NoiseSampleAddressLo], a ld [NoiseSampleAddress], a
ld a, [hl] ld a, [hl]
ld [NoiseSampleAddressHi], a ld [NoiseSampleAddress + 1], a
; clear ???? ; clear ????
xor a xor a
ld [wNoiseSampleDelay], a ld [wNoiseSampleDelay], a
@ -2160,9 +2160,9 @@ Music_RestartChannel: ; e8a08
ld hl, Channel1MusicID - Channel1 ld hl, Channel1MusicID - Channel1
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
ld [MusicIDLo], a ld [MusicID], a
ld a, [hl] ld a, [hl]
ld [MusicIDHi], a ld [MusicID + 1], a
; update music bank ; update music bank
ld hl, Channel1MusicBank - Channel1 ld hl, Channel1MusicBank - Channel1
add hl, bc add hl, bc
@ -2437,7 +2437,7 @@ _PlayMusic:: ; e8b30
ld hl, MusicID ld hl, MusicID
ld [hl], e ; song number ld [hl], e ; song number
inc hl inc hl
ld [hl], d ; MusicIDHi (always $) ld [hl], d ; (always 0)
ld hl, Music ld hl, Music
add hl, de ; three add hl, de ; three
add hl, de ; byte add hl, de ; byte
@ -2466,8 +2466,8 @@ _PlayMusic:: ; e8b30
ld [Channel2JumpCondition], a ld [Channel2JumpCondition], a
ld [Channel3JumpCondition], a ld [Channel3JumpCondition], a
ld [Channel4JumpCondition], a ld [Channel4JumpCondition], a
ld [NoiseSampleAddressLo], a ld [NoiseSampleAddress], a
ld [NoiseSampleAddressHi], a ld [NoiseSampleAddress + 1], a
ld [wNoiseSampleDelay], a ld [wNoiseSampleDelay], a
ld [MusicNoiseSampleSet], a ld [MusicNoiseSampleSet], a
call MusicOn call MusicOn
@ -2647,8 +2647,8 @@ _PlaySFX:: ; e8c04
ld a, $80 ld a, $80
ld [rNR44], a ; restart sound (freq hi = 0) ld [rNR44], a ; restart sound (freq hi = 0)
xor a xor a
ld [NoiseSampleAddressLo], a ld [NoiseSampleAddress], a
ld [NoiseSampleAddressHi], a ld [NoiseSampleAddress + 1], a
.chscleared .chscleared
; start reading sfx header for # chs ; start reading sfx header for # chs
ld hl, MusicID ld hl, MusicID
@ -2825,9 +2825,9 @@ LoadChannel: ; e8d1b
; load music id ; load music id
ld hl, Channel1MusicID - Channel1 ld hl, Channel1MusicID - Channel1
add hl, bc add hl, bc
ld a, [MusicIDLo] ld a, [MusicID]
ld [hli], a ld [hli], a
ld a, [MusicIDHi] ld a, [MusicID + 1]
ld [hl], a ld [hl], a
; load music bank ; load music bank
ld hl, Channel1MusicBank - Channel1 ld hl, Channel1MusicBank - Channel1

View File

@ -491,7 +491,7 @@ ParseCredits: ; 1099aa
ld a, MUSIC_POST_CREDITS % $100 ld a, MUSIC_POST_CREDITS % $100
ld [MusicFadeID], a ld [MusicFadeID], a
ld a, MUSIC_POST_CREDITS / $100 ld a, MUSIC_POST_CREDITS / $100
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ret ret
.get .get

View File

@ -68,9 +68,9 @@ InitGenderScreen: ; 48e14 (12:4e14)
ld a, $10 ld a, $10
ld [MusicFade], a ld [MusicFade], a
ld a, MUSIC_NONE ld a, MUSIC_NONE
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, $0 ld a, $0
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld c, 8 ld c, 8
call DelayFrames call DelayFrames
call ClearBGPalettes call ClearBGPalettes

View File

@ -375,9 +375,9 @@ Continue: ; 5d65
ld a, $8 ld a, $8
ld [MusicFade], a ld [MusicFade], a
ld a, MUSIC_NONE % $100 ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, MUSIC_NONE / $100 ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
call ClearBGPalettes call ClearBGPalettes
call Continue_MobileAdapterMenu call Continue_MobileAdapterMenu
call CloseWindow call CloseWindow
@ -429,9 +429,9 @@ Continue_MobileAdapterMenu: ; 5df0
ld a, 5 ld a, 5
ld [MusicFade], a ld [MusicFade], a
ld a, MUSIC_MOBILE_ADAPTER_MENU % $100 ld a, MUSIC_MOBILE_ADAPTER_MENU % $100
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, MUSIC_MOBILE_ADAPTER_MENU / $100 ld a, MUSIC_MOBILE_ADAPTER_MENU / $100
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld c, 20 ld c, 20
call DelayFrames call DelayFrames
ld c, $1 ld c, $1
@ -440,9 +440,9 @@ Continue_MobileAdapterMenu: ; 5df0
ld a, 8 ld a, 8
ld [MusicFade], a ld [MusicFade], a
ld a, MUSIC_NONE % $100 ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, MUSIC_NONE / $100 ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld c, 35 ld c, 35
call DelayFrames call DelayFrames
ret ret
@ -859,9 +859,9 @@ ShrinkPlayer: ; 610f
ld [MusicFade], a ld [MusicFade], a
ld de, MUSIC_NONE ld de, MUSIC_NONE
ld a, e ld a, e
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, d ld a, d
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld de, SFX_ESCAPE_ROPE ld de, SFX_ESCAPE_ROPE
call PlaySFX call PlaySFX
@ -1282,8 +1282,8 @@ TitleScreenMain: ; 6304
; Fade out the title screen music ; Fade out the title screen music
xor a xor a
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld hl, MusicFade ld hl, MusicFade
ld [hl], 8 ; 1 second ld [hl], 8 ; 1 second

View File

@ -414,9 +414,9 @@ RetainOldPalettes: ; 1556d
RotatePalettesRightMapAndMusic: ; 15574 RotatePalettesRightMapAndMusic: ; 15574
ld e, 0 ld e, 0
ld a, [MusicFadeIDLo] ld a, [MusicFadeID]
ld d, 0 ld d, 0
ld a, [MusicFadeIDHi] ld a, [MusicFadeID + 1]
ld a, $4 ld a, $4
ld [MusicFade], a ld [MusicFade], a
call RotateThreePalettesRight call RotateThreePalettesRight

View File

@ -618,9 +618,9 @@ SpecialGameboyCheck: ; c478
Special_FadeOutMusic: ; c48f Special_FadeOutMusic: ; c48f
ld a, MUSIC_NONE % $100 ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, MUSIC_NONE / $100 ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld a, $2 ld a, $2
ld [MusicFade], a ld [MusicFade], a
ret ret

View File

@ -10,9 +10,9 @@ InitClock: ; 90672 (24:4672)
ld a, $10 ld a, $10
ld [MusicFade], a ld [MusicFade], a
ld a, MUSIC_NONE % $100 ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, MUSIC_NONE / $100 ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld c, 8 ld c, 8
call DelayFrames call DelayFrames
call RotateFourPalettesLeft call RotateFourPalettesLeft

View File

@ -37,9 +37,9 @@ HallOfFame:: ; 0x8640e
RedCredits:: ; 86455 RedCredits:: ; 86455
ld a, MUSIC_NONE % $100 ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, MUSIC_NONE / $100 ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld a, 10 ld a, 10
ld [MusicFade], a ld [MusicFade], a
callba FadeOutPalettes callba FadeOutPalettes
@ -60,9 +60,9 @@ RedCredits:: ; 86455
HallOfFame_FadeOutMusic: ; 8648e HallOfFame_FadeOutMusic: ; 8648e
ld a, MUSIC_NONE % $100 ld a, MUSIC_NONE % $100
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, MUSIC_NONE / $100 ld a, MUSIC_NONE / $100
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld a, 10 ld a, 10
ld [MusicFade], a ld [MusicFade], a
callba FadeOutPalettes callba FadeOutPalettes

View File

@ -348,9 +348,9 @@ FadeToMapMusic:: ; 3cbc
ld a, 8 ld a, 8
ld [MusicFade], a ld [MusicFade], a
ld a, e ld a, e
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, d ld a, d
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld a, e ld a, e
ld [wMapMusic], a ld [wMapMusic], a

View File

@ -40,9 +40,9 @@ InitMobileProfile: ; 4802f (12:402f)
ld a, $5 ld a, $5
ld [MusicFade], a ld [MusicFade], a
ld a, MUSIC_MOBILE_ADAPTER_MENU % $100 ld a, MUSIC_MOBILE_ADAPTER_MENU % $100
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, MUSIC_MOBILE_ADAPTER_MENU / $100 ld a, MUSIC_MOBILE_ADAPTER_MENU / $100
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld c, 20 ld c, 20
call DelayFrames call DelayFrames
ld b, $1 ld b, $1

View File

@ -496,9 +496,9 @@ Function1161d5: ; 1161d5
ld [MusicFade], a ld [MusicFade], a
ld de, MUSIC_MOBILE_ADAPTER ld de, MUSIC_MOBILE_ADAPTER
ld a, e ld a, e
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, d ld a, d
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld a, [$c319] ld a, [$c319]
inc a inc a
ld [$c319], a ld [$c319], a
@ -680,9 +680,9 @@ Function11636e: ; 11636e
ld a, $8 ld a, $8
ld [MusicFade], a ld [MusicFade], a
ld a, [wMapMusic] ld a, [wMapMusic]
ld [MusicFadeIDLo], a ld [MusicFadeID], a
xor a xor a
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
xor a xor a
ld [$c319], a ld [$c319], a
ld [wc30d], a ld [wc30d], a
@ -728,18 +728,18 @@ Function1163c0: ; 1163c0
ld a, $8 ld a, $8
ld [MusicFade], a ld [MusicFade], a
ld a, [wMapMusic] ld a, [wMapMusic]
ld [MusicFadeIDLo], a ld [MusicFadeID], a
xor a xor a
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
jr .asm_116439 jr .asm_116439
.asm_11642a .asm_11642a
ld a, $8 ld a, $8
ld [MusicFade], a ld [MusicFade], a
ld a, $0 ld a, $0
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, $0 ld a, $0
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
.asm_116439 .asm_116439
xor a xor a
@ -757,9 +757,9 @@ Function116441: ; 116441
ld a, $8 ld a, $8
ld [MusicFade], a ld [MusicFade], a
ld a, [wMapMusic] ld a, [wMapMusic]
ld [MusicFadeIDLo], a ld [MusicFadeID], a
xor a xor a
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
xor a xor a
ld [$c319], a ld [$c319], a
ld [wc30d], a ld [wc30d], a

View File

@ -559,9 +559,9 @@ Function17d2ce: ; 17d2ce
ld de, MUSIC_MOBILE_CENTER ld de, MUSIC_MOBILE_CENTER
ld a, e ld a, e
ld [wMapMusic], a ld [wMapMusic], a
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, d ld a, d
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
call PlayMusic call PlayMusic
call ReturnToMapFromSubmenu call ReturnToMapFromSubmenu
call CloseSubmenu call CloseSubmenu
@ -4728,9 +4728,9 @@ Function17f5e4: ; 17f5e4
ld [MusicFade], a ld [MusicFade], a
ld de, MUSIC_NONE ld de, MUSIC_NONE
ld a, e ld a, e
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, d ld a, d
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld a, " " ld a, " "
hlcoord 0, 0 hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
@ -5274,9 +5274,9 @@ Function17ff23: ; 17ff23
ld a, $8 ld a, $8
ld [MusicFade], a ld [MusicFade], a
ld a, [wMapMusic] ld a, [wMapMusic]
ld [MusicFadeIDLo], a ld [MusicFadeID], a
xor a xor a
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld hl, wc303 ld hl, wc303
set 7, [hl] set 7, [hl]
ret ret

View File

@ -856,9 +856,9 @@ Function4a6c5: ; 4a6c5 (12:66c5)
ld a, $5 ld a, $5
ld [MusicFade], a ld [MusicFade], a
ld a, e ld a, e
ld [MusicFadeIDLo], a ld [MusicFadeID], a
ld a, d ld a, d
ld [MusicFadeIDHi], a ld [MusicFadeID + 1], a
ld c, 22 ld c, 22
call DelayFrames call DelayFrames
ret ret

290
wram.asm
View File

@ -2,7 +2,9 @@ INCLUDE "includes.asm"
INCLUDE "macros/wram.asm" INCLUDE "macros/wram.asm"
INCLUDE "vram.asm" INCLUDE "vram.asm"
SECTION "Stack", WRAM0 SECTION "Stack", WRAM0
wc000:: wc000::
StackBottom:: StackBottom::
ds $100 - 1 ds $100 - 1
@ -12,10 +14,11 @@ StackTop::
SECTION "Audio RAM", WRAM0 SECTION "Audio RAM", WRAM0
wMusic:: wMusic::
MusicPlaying:: ; c100
; nonzero if playing ; nonzero if playing
ds 1 MusicPlaying:: db ; c100
Channels:: Channels::
Channel1:: channel_struct Channel1 ; c101 Channel1:: channel_struct Channel1 ; c101
@ -30,16 +33,15 @@ Channel7:: channel_struct Channel7 ; c22d
Channel8:: channel_struct Channel8 ; c25f Channel8:: channel_struct Channel8 ; c25f
ds 1 ; c291 ds 1 ; c291
wCurTrackDuty:: ds 1
wCurTrackIntensity:: ds 1
wCurTrackFrequency:: dw
wc296:: ds 1 ; BCD value, dummied out
wCurNoteDuration:: ds 1 ; used in MusicE0 and LoadNote
CurMusicByte:: ; c298 wCurTrackDuty:: db
ds 1 wCurTrackIntensity:: db
CurChannel:: ; c299 wCurTrackFrequency:: dw
ds 1 wc296:: db ; BCD value, dummied out
wCurNoteDuration:: db ; used in MusicE0 and LoadNote
CurMusicByte:: db ; c298
CurChannel:: db ; c299
Volume:: ; c29a Volume:: ; c29a
; corresponds to $ff24 ; corresponds to $ff24
; Channel control / ON-OFF / Volume (R/W) ; Channel control / ON-OFF / Volume (R/W)
@ -47,12 +49,12 @@ Volume:: ; c29a
; bit 6-4 - SO2 output level (volume) (# 0-7) ; bit 6-4 - SO2 output level (volume) (# 0-7)
; bit 3 - Vin->SO1 ON/OFF ; bit 3 - Vin->SO1 ON/OFF
; bit 2-0 - SO1 output level (volume) (# 0-7) ; bit 2-0 - SO1 output level (volume) (# 0-7)
ds 1 db
SoundOutput:: ; c29b SoundOutput:: ; c29b
; corresponds to $ff25 ; corresponds to $ff25
; bit 4-7: ch1-4 so2 on/off ; bit 4-7: ch1-4 so2 on/off
; bit 0-3: ch1-4 so1 on/off ; bit 0-3: ch1-4 so1 on/off
ds 1 db
SoundInput:: ; c29c SoundInput:: ; c29c
; corresponds to $ff26 ; corresponds to $ff26
; bit 7: global on/off ; bit 7: global on/off
@ -60,80 +62,69 @@ SoundInput:: ; c29c
; bit 1: ch2 on/off ; bit 1: ch2 on/off
; bit 2: ch3 on/off ; bit 2: ch3 on/off
; bit 3: ch4 on/off ; bit 3: ch4 on/off
ds 1 db
MusicID:: dw ; c29d
MusicBank:: db ; c29f
NoiseSampleAddress:: dw ; c2a0
wNoiseSampleDelay:: db ; c2a2
ds 1 ; c2a3
MusicNoiseSampleSet:: db ; c2a4
SFXNoiseSampleSet:: db ; c2a5
MusicID::
MusicIDLo:: ; c29d
ds 1
MusicIDHi:: ; c29e
ds 1
MusicBank:: ; c29f
ds 1
NoiseSampleAddress::
NoiseSampleAddressLo:: ; c2a0
ds 1
NoiseSampleAddressHi:: ; c2a1
ds 1
wNoiseSampleDelay:: ; noise delay? ; c2a2
ds 1
; c2a3
ds 1
MusicNoiseSampleSet:: ; c2a4
ds 1
SFXNoiseSampleSet:: ; c2a5
ds 1
Danger:: ; c2a6 Danger:: ; c2a6
; bit 7: on/off ; bit 7: on/off
; bit 4: pitch ; bit 4: pitch
; bit 0-3: counter ; bit 0-3: counter
ds 1 db
MusicFade:: ; c2a7 MusicFade:: ; c2a7
; fades volume over x frames ; fades volume over x frames
; bit 7: fade in/out ; bit 7: fade in/out
; bit 0-5: number of frames for each volume level ; bit 0-5: number of frames for each volume level
; $00 = none (default) ; $00 = none (default)
ds 1 db
MusicFadeCount:: ; c2a8 MusicFadeCount:: db ; c2a8
ds 1 MusicFadeID:: dw ; c2a9
MusicFadeID::
wc2a9::
MusicFadeIDLo:: ; c2a9
ds 1
wc2aa::
MusicFadeIDHi:: ; c2aa
ds 1
ds 5 ds 5
CryPitch:: ; c2b0
ds 2 CryPitch:: dw ; c2b0
CryLength:: ; c2b2 CryLength:: dw ; c2b2
ds 2
LastVolume:: ; c2b4 LastVolume:: db ; c2b4
ds 1 wc2b5:: db ; c2b5
wc2b5:: ds 1
SFXPriority:: ; c2b6 SFXPriority:: ; c2b6
; if nonzero, turn off music when playing sfx ; if nonzero, turn off music when playing sfx
db
ds 1 ds 1
ds 1
Channel1JumpCondition:: ds 1 Channel1JumpCondition:: db
Channel2JumpCondition:: ds 1 Channel2JumpCondition:: db
Channel3JumpCondition:: ds 1 Channel3JumpCondition:: db
Channel4JumpCondition:: ds 1 Channel4JumpCondition:: db
wStereoPanningMask:: ds 1 ; c2bc
wStereoPanningMask:: db ; c2bc
CryTracks:: ; c2bd CryTracks:: ; c2bd
; plays only in left or right track depending on what side the monster is on ; plays only in left or right track depending on what side the monster is on
; both tracks active outside of battle ; both tracks active outside of battle
ds 1 db
wSFXDuration:: ds 1
wSFXDuration:: db
CurSFX:: ; c2bf CurSFX:: ; c2bf
; id of sfx currently playing ; id of sfx currently playing
ds 1 db
ChannelsEnd:: ChannelsEnd::
wMapMusic:: ; c2c0
ds 1
wDontPlayMapMusicOnReload:: ds 1 wMapMusic:: db ; c2c0
wDontPlayMapMusicOnReload:: db
wMusicEnd:: wMusicEnd::
SECTION "WRAM", WRAM0 SECTION "WRAM", WRAM0
wLZAddress:: dw ; c2c2 wLZAddress:: dw ; c2c2
@ -141,69 +132,62 @@ wLZBank:: db ; c2c4
ds 1 ds 1
wBoxAlignment:: ds 1 wBoxAlignment:: db
InputType:: ; c2c7
ds 1
AutoInputAddress:: ; c2c8
ds 2
AutoInputBank:: ; c2ca
ds 1
AutoInputLength:: ; c2cb
ds 1
wMonStatusFlags:: ds 1 InputType:: db ; c2c7
wGameLogicPaused:: ds 1 ; c2cd AutoInputAddress:: dw ; c2c8
wSpriteUpdatesEnabled:: ds 1 AutoInputBank:: db ; c2ca
wc2cf:: ds 1 AutoInputLength:: db ; c2cb
wMapTimeOfDay:: ds 1
wMonStatusFlags:: db
wGameLogicPaused:: db ; c2cd
wSpriteUpdatesEnabled:: db
wc2cf:: db
wMapTimeOfDay:: db
ds 3 ds 3
wPrinterConnectionOpen:: ds 1 wPrinterConnectionOpen:: db
wPrinterOpcode:: ds 1 wPrinterOpcode:: db
wLastDexEntry:: ds 1 wLastDexEntry:: db
wDisableTextAcceleration:: ds 1 wDisableTextAcceleration:: db
wPreviousLandmark:: ds 1 wPreviousLandmark:: db
wCurrentLandmark:: ds 1 wCurrentLandmark:: db
wLandmarkSignTimer:: ds 2 wLandmarkSignTimer:: dw
wLinkMode:: ; c2dc wLinkMode:: ; c2dc
; 0 not in link battle ; 0 not in link battle
; 1 link battle ; 1 link battle
; 4 mobile battle ; 4 mobile battle
ds 1 db
ScriptVar:: ; c2dd ScriptVar:: db ; c2dd
ds 1
wPlayerNextMovement:: ds 1 wPlayerNextMovement:: db
wPlayerMovement:: ds 1 wPlayerMovement:: db
ds 2 ds 2
wc2e2:: wc2e2::
wMovementPerson:: ds 1 wMovementPerson:: db
wMovementDataPointer:: ds 3 ; dba wMovementDataPointer:: ds 3 ; dba
wc2e6:: ds 4 wc2e6:: ds 4
wMovementByteWasControlSwitch:: ds 1 wMovementByteWasControlSwitch:: db
wMovementPointer:: ds 2 ; c2eb wMovementPointer:: dw ; c2eb
ds 3 ds 3
wTempObjectCopyMapObjectIndex:: ds 1 ; c2f0 wTempObjectCopyMapObjectIndex:: db ; c2f0
wTempObjectCopySprite:: ds 1 ; c2f1 wTempObjectCopySprite:: db ; c2f1
wTempObjectCopySpriteVTile:: ds 1 ; c2f2 wTempObjectCopySpriteVTile:: db ; c2f2
wTempObjectCopyPalette:: ds 1 ; c2f3 wTempObjectCopyPalette:: db ; c2f3
wTempObjectCopyMovement:: ds 1 ; c2f4 wTempObjectCopyMovement:: db ; c2f4
wTempObjectCopyRange:: ds 1 ; c2f5 wTempObjectCopyRange:: db ; c2f5
wTempObjectCopyX:: ds 1 ; c2f6 wTempObjectCopyX:: db ; c2f6
wTempObjectCopyY:: ds 1 ; c2f7 wTempObjectCopyY:: db ; c2f7
wTempObjectCopyRadius:: ds 1 ; c2f8 wTempObjectCopyRadius:: db ; c2f8
ds 1 ds 1
TileDown:: ; c2fa TileDown:: db ; c2fa
ds 1 TileUp:: db ; c2fb
TileUp:: ; c2fb TileLeft:: db ; c2fc
ds 1 TileRight:: db ; c2fd
TileLeft:: ; c2fc
ds 1
TileRight:: ; c2fd
ds 1
TilePermissions:: ; c2fe TilePermissions:: ; c2fe
; set if tile behavior prevents ; set if tile behavior prevents
@ -212,19 +196,36 @@ TilePermissions:: ; c2fe
; bit 2: up ; bit 2: up
; bit 1: left ; bit 1: left
; bit 0: right ; bit 0: right
ds 1 db
ds 1 ds 1
SECTION "wSpriteAnims", WRAM0 SECTION "wSpriteAnims", WRAM0
; wc300 - wc313 is a 10x2 dictionary.
; keys: taken from third column of SpriteAnimSeqData
; values: VTiles
UNION UNION
; wSpriteAnimDict is a 10x2 dictionary
; keys: taken from third column of SpriteAnimSeqData
; values: VTiles
wSpriteAnimDict:: ds 10 * 2 wSpriteAnimDict:: ds 10 * 2
wSpriteAnimationStructs::
; field 0: index
; fields 1-3: loaded from SpriteAnimSeqData
SpriteAnim1:: sprite_anim_struct SpriteAnim1
SpriteAnim2:: sprite_anim_struct SpriteAnim2
SpriteAnim3:: sprite_anim_struct SpriteAnim3
SpriteAnim4:: sprite_anim_struct SpriteAnim4
SpriteAnim5:: sprite_anim_struct SpriteAnim5
SpriteAnim6:: sprite_anim_struct SpriteAnim6
SpriteAnim7:: sprite_anim_struct SpriteAnim7
SpriteAnim8:: sprite_anim_struct SpriteAnim8
SpriteAnim9:: sprite_anim_struct SpriteAnim9
SpriteAnim10:: sprite_anim_struct SpriteAnim10
wSpriteAnimationStructsEnd::
NEXTU NEXTU
; mobile data
wc300:: ds 1 wc300:: ds 1
wc301:: ds 1 wc301:: ds 1
wc302:: ds 1 wc302:: ds 1
@ -244,62 +245,32 @@ wc310:: ds 1
wc311:: ds 1 wc311:: ds 1
wc312:: ds 1 wc312:: ds 1
wc313:: ds 1 wc313:: ds 1
wc314:: ds 152
wc3ac:: ds 8
ENDU ENDU
wSpriteAnimationStructs:: wSpriteAnimCount:: db
; Field 0: Index wCurrSpriteOAMAddr:: db
; Fields 1-3: Loaded from SpriteAnimSeqData
wc314::
SpriteAnim1:: sprite_anim_struct SpriteAnim1
wc324::
SpriteAnim2:: sprite_anim_struct SpriteAnim2
wc334::
SpriteAnim3:: sprite_anim_struct SpriteAnim3
wc344::
SpriteAnim4:: sprite_anim_struct SpriteAnim4
wc354::
SpriteAnim5:: sprite_anim_struct SpriteAnim5
wc364::
SpriteAnim6:: sprite_anim_struct SpriteAnim6
wc374::
SpriteAnim7:: sprite_anim_struct SpriteAnim7
wc384::
SpriteAnim8:: sprite_anim_struct SpriteAnim8
wc394::
SpriteAnim9:: sprite_anim_struct SpriteAnim9
wc3a4::
UNION CurIcon:: db ; c3b6
SpriteAnim10:: sprite_anim_struct SpriteAnim10
wSpriteAnimationStructsEnd::
NEXTU
ds 8
wc3ac:: ds 8 ; c3ac
ENDU
wSpriteAnimCount:: ds 1 wCurIconTile:: db
wCurrSpriteOAMAddr:: ds 1
CurIcon:: ; c3b6
ds 1
wCurIconTile:: ds 1
wSpriteAnimAddrBackup:: wSpriteAnimAddrBackup::
wSpriteAnimIDBuffer:: wSpriteAnimIDBuffer::
wCurrSpriteAddSubFlags:: wCurrSpriteAddSubFlags::
ds 2 dw
wCurrAnimVTile:: ds 1 wCurrAnimVTile:: db
wCurrAnimXCoord:: ds 1 wCurrAnimXCoord:: db
wCurrAnimYCoord:: ds 1 wCurrAnimYCoord:: db
wCurrAnimXOffset:: ds 1 wCurrAnimXOffset:: db
wCurrAnimYOffset:: ds 1 wCurrAnimYOffset:: db
wGlobalAnimYOffset:: ds 1 wGlobalAnimYOffset:: db
wGlobalAnimXOffset:: ds 1 wGlobalAnimXOffset:: db
wSpriteAnimsEnd:: wSpriteAnimsEnd::
ds 11 ds 11
; mobile data
wc3cc:: ds 1 wc3cc:: ds 1
wc3cd:: ds 31 wc3cd:: ds 31
wc3ec:: ds 1 wc3ec:: ds 1
@ -352,6 +323,7 @@ TileMapEnd::
SECTION "Battle", WRAM0 SECTION "Battle", WRAM0
UNION UNION
wc608:: wc608::
wOddEgg:: party_struct OddEgg wOddEgg:: party_struct OddEgg