summaryrefslogtreecommitdiff
path: root/wram.asm
diff options
context:
space:
mode:
Diffstat (limited to 'wram.asm')
-rw-r--r--wram.asm274
1 files changed, 39 insertions, 235 deletions
diff --git a/wram.asm b/wram.asm
index 056816e92..129dc3e33 100644
--- a/wram.asm
+++ b/wram.asm
@@ -1,217 +1,5 @@
INCLUDE "includes.asm"
-
-flag_array: MACRO
- ds ((\1) + 7) / 8
-ENDM
-
-box_struct: MACRO
-\1Species:: db
-\1Item:: db
-\1Moves:: ds NUM_MOVES
-\1ID:: dw
-\1Exp:: ds 3
-\1StatExp::
-\1HPExp:: dw
-\1AtkExp:: dw
-\1DefExp:: dw
-\1SpdExp:: dw
-\1SpcExp:: dw
-\1DVs:: ds 2
-\1PP:: ds NUM_MOVES
-\1Happiness:: db
-\1PokerusStatus:: db
-\1CaughtData::
-\1CaughtTime::
-\1CaughtLevel:: db
-\1CaughtGender::
-\1CaughtLocation:: db
-\1Level:: db
-\1End::
-ENDM
-
-party_struct: MACRO
- box_struct \1
-\1Status:: db
-\1Unused:: db
-\1HP:: dw
-\1MaxHP:: dw
-\1Stats:: ; big endian
-\1Attack:: dw
-\1Defense:: dw
-\1Speed:: dw
-\1SpclAtk:: dw
-\1SpclDef:: dw
-\1StatsEnd::
-ENDM
-
-red_box_struct: MACRO
-\1Species:: db
-\1HP:: dw
-\1BoxLevel:: db
-\1Status:: db
-\1Type::
-\1Type1:: db
-\1Type2:: db
-\1CatchRate:: db
-\1Moves:: ds NUM_MOVES
-\1OTID:: dw
-\1Exp:: ds 3
-\1HPExp:: dw
-\1AttackExp:: dw
-\1DefenseExp:: dw
-\1SpeedExp:: dw
-\1SpecialExp:: dw
-\1DVs:: ds 2
-\1PP:: ds NUM_MOVES
-ENDM
-
-red_party_struct: MACRO
- red_box_struct \1
-\1Level:: db
-\1Stats::
-\1MaxHP:: dw
-\1Attack:: dw
-\1Defense:: dw
-\1Speed:: dw
-\1Special:: dw
-ENDM
-
-
-battle_struct: MACRO
-\1Species:: db
-\1Item:: db
-\1Moves:: ds NUM_MOVES
-\1MovesEnd::
-\1DVs:: ds 2
-\1PP:: ds NUM_MOVES
-\1Happiness:: db
-\1Level:: db
-\1Status:: ds 2
-\1HP:: dw
-\1MaxHP:: dw
-\1Stats:: ; big endian
-\1Attack:: dw
-\1Defense:: dw
-\1Speed:: dw
-\1SpclAtk:: dw
-\1SpclDef:: dw
-\1StatsEnd::
-\1Type::
-\1Type1:: db
-\1Type2:: db
-\1StructEnd::
-ENDM
-
-box: MACRO
-\1::
-\1Count:: ds 1
-\1Species:: ds MONS_PER_BOX + 1
-\1Mons::
-\1Mon1:: box_struct \1Mon1
-\1Mon2:: ds BOXMON_STRUCT_LENGTH * (MONS_PER_BOX +- 1)
-\1MonOT:: ds NAME_LENGTH * MONS_PER_BOX
-\1MonNicknames:: ds PKMN_NAME_LENGTH * MONS_PER_BOX
-\1MonNicknamesEnd::
-\1End:: ds 2 ; padding
-ENDM
-
-
-channel_struct: MACRO
-; Addreses are Channel1 (c101).
-\1MusicID:: dw
-\1MusicBank:: db
-\1Flags:: db ; 0:on/off 1:subroutine 3:sfx 4:noise 5:rest
-\1Flags2:: db ; 0:vibrato on/off 2:duty 4:cry pitch
-\1Flags3:: db ; 0:vibrato up/down
-\1MusicAddress:: dw
-\1LastMusicAddress:: dw
- dw
-\1NoteFlags:: db ; 5:rest
-\1Condition:: db ; conditional jumps
-\1DutyCycle:: db ; bits 6-7 (0:12.5% 1:25% 2:50% 3:75%)
-\1Intensity:: db ; hi:pressure lo:velocity
-\1Frequency:: ; 11 bits
-\1FrequencyLo:: db
-\1FrequencyHi:: db
-\1Pitch:: db ; 0:rest 1-c:note
-\1Octave:: db ; 7-0 (0 is highest)
-\1StartingOctave:: db ; raises existing octaves (to repeat phrases)
-\1NoteDuration:: db ; frames remaining for the current note
-\1Field0x16:: ds 1 ; c117
- ds 1 ; c118
-\1LoopCount:: db
-\1Tempo:: dw
-\1Tracks:: db ; hi:left lo:right
-\1Field0x1c:: ds 1 ; c11d
-\1VibratoDelayCount:: db ; initialized by \1VibratoDelay
-\1VibratoDelay:: db ; number of frames a note plays until vibrato starts
-\1VibratoExtent:: db
-\1VibratoRate:: db ; hi:frames for each alt lo:frames to the next alt
-\1Field0x21:: ds 1 ; c122
-\1Field0x22:: ds 1 ; c123
-\1Field0x23:: ds 1 ; c124
-\1Field0x24:: ds 1 ; c125
-\1Field0x25:: ds 1 ; c126
- ds 1 ; c127
-\1CryPitch:: dw
-\1Field0x29:: ds 1
-\1Field0x2a:: ds 2
-\1Field0x2c:: ds 1
-\1NoteLength:: db ; frames per 16th note
-\1Field0x2e:: ds 1 ; c12f
-\1Field0x2f:: ds 1 ; c130
-\1Field0x30:: ds 1 ; c131
- ds 1 ; c132
-ENDM
-
-battle_tower_struct: MACRO
-\1Name:: ds NAME_LENGTH +- 1
-\1TrainerClass:: ds 1
-\1Pkmn1:: party_struct \1Pkmn1
-\1Pkmn1Name:: ds PKMN_NAME_LENGTH
-\1Pkmn1NameEnd::
-\1Pkmn2:: party_struct \1Pkmn2
-\1Pkmn2Name:: ds PKMN_NAME_LENGTH
-\1Pkmn2NameEnd::
-\1Pkmn3:: party_struct \1Pkmn3
-\1Pkmn3Name:: ds PKMN_NAME_LENGTH
-\1Pkmn3NameEnd::
-\1TrainerData:: ds BATTLETOWER_TRAINERDATALENGTH
-\1TrainerEnd::
-endm
-
-mailmsg: MACRO
-\1Message:: ds MAIL_MSG_LENGTH
-\1MessageEnd:: ds 1
-\1Author:: ds PLAYER_NAME_LENGTH
-\1AuthorNationality:: ds 2
-\1AuthorID:: ds 2
-\1Species:: ds 1
-\1Type:: ds 1
-\1End::
-endm
-
-hof_mon: MACRO
-\1Species:: ds 1
-\1ID:: ds 2
-\1DVs:: ds 2
-\1Level:: ds 1
-\1Nickname:: ds PKMN_NAME_LENGTH +- 1
-\1End::
-endm
-
-hall_of_fame: MACRO
-\1::
-\1WinCount:: ds 1
-\1Mon1:: hof_mon \1Mon1
-\1Mon2:: hof_mon \1Mon2
-\1Mon3:: hof_mon \1Mon3
-\1Mon4:: hof_mon \1Mon4
-\1Mon5:: hof_mon \1Mon5
-\1Mon6:: hof_mon \1Mon6
-\1End:: ds 1
-ENDM
-
+INCLUDE "macros/wram.asm"
INCLUDE "vram.asm"
SECTION "Stack", WRAM0
@@ -907,9 +695,11 @@ wc6d6::
EnemySpdLevel:: ; c6d6
ds 1
wc6d7::
+wTownMapCursorLandmark::
EnemySAtkLevel:: ; c6d7
ds 1
wc6d8::
+wTownMapPlayerIconLandmark::
EnemySDefLevel:: ; c6d8
ds 1
wc6d9::
@@ -1764,7 +1554,7 @@ wMinutesSince:: ds 1
wHoursSince:: ds 1
wDaysSince:: ds 1
-wRAM0End:: ; cfc0
+wRAM0End:: ; cfd8
SECTION "WRAM 1", WRAMX, BANK [1]
@@ -1903,6 +1693,8 @@ MenuItemsList::
CurFruitTree::
CurInput::
wElevatorPointerBank::
+wCurCoordEventTriggerID::
+wCurSignpostYCoord::
EngineBuffer1:: ; d03e
ds 1
@@ -1911,24 +1703,30 @@ wJumpStdScriptBuffer::
CurFruit:: ; d03f
MartPointerBank::
wElevatorPointerLo::
+wCurCoordEventMapY::
+wCurSignpostXCoord::
EngineBuffer2::
ds 1
wd040::
wElevatorPointerHi::
MartPointer:: ; d040
+wCurCoordEventMapX::
+wCurSignpostType::
EngineBuffer3::
ds 1
wd041::
wElevatorOriginFloor::
-EngineBuffer4::
wTempTrainerHeader::
wTempTrainerEventFlagLo::
+wCurSignpostScriptAddr::
+EngineBuffer4::
ds 1
wTempTrainerEventFlagHi::
MovementAnimation:: ; d042
+wCurCoordEventScriptAddr::
EngineBuffer5::
ds 1
@@ -2072,7 +1870,7 @@ wd10b:: ds 1
wItemQuantityChangeBuffer:: ds 1
wItemQuantityBuffer:: ds 1
-TempMon::
+TempMon:: ; d10e
party_struct TempMon
wSpriteFlags:: ds 1
@@ -2398,11 +2196,11 @@ CurDamage:: ; d256
ds 2
ds 2
-wMornEncounterRate:: ds 1
-wDayEncounterRate:: ds 1
-wNiteEncounterRate:: ds 1
-wWaterEncounterRate:: ds 1
-wListMoves_MoveIndicesBuffer:: ds 4
+wMornEncounterRate:: ds 1 ; d25a
+wDayEncounterRate:: ds 1 ; d25b
+wNiteEncounterRate:: ds 1 ; d25c
+wWaterEncounterRate:: ds 1 ; d25d
+wListMoves_MoveIndicesBuffer:: ds NUM_MOVES
wPutativeTMHMMove:: ds 1
wd263:: ds 1
wd264:: ds 1
@@ -2428,7 +2226,6 @@ wPokedexShowPointerBank::
wd26d:: ds 1
ds 3
wd271:: ds 5
-wd276:: ds 10
ds wd26b - @
@@ -2466,7 +2263,7 @@ OTPartyMonsEnd::
OTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8
OTPartyMonNicknames:: ds PKMN_NAME_LENGTH * PARTY_LENGTH ; d3ea
-
+OTPartyDataEnd::
ds 4
wd430::
@@ -2523,6 +2320,9 @@ wd454:: ds 1
wBattleScriptFlags:: ds 2
wPlayerSpriteSetupFlags:: ds 1
+; bit 7: if set, cancel PlayerAction
+; bit 5: if set, set facing according to bits 0-1
+; bits 0-1: direction facing
wMapReentryScriptQueueFlag:: ds 1 ; MemScriptFlag
wMapReentryScriptBank:: ds 1 ; MemScriptBank
wMapReentryScriptAddress:: ds 2 ; MemScriptAddr
@@ -2946,6 +2746,7 @@ wCelebiEvent:: ds 1
ds 1
BikeFlags:: ; dbf5
+; bit 0: using strength
; bit 1: always on bike
; bit 2: downhill
ds 1
@@ -2958,8 +2759,8 @@ wCurrentCaller:: ds 2
wCurrMapWarpCount:: ds 1
wCurrMapWarpHeaderPointer:: ds 1
wdbfd:: ds 1
-wCurrentNextMapXYTriggerCount:: ds 1
-wCurrentNextMapXYTriggerHeaderPointer:: ds 1
+wCurrentMapXYTriggerCount:: ds 1
+wCurrentMapXYTriggerHeaderPointer:: ds 1
wdc00:: ds 1
wCurrentMapSignpostCount:: ds 1
wCurrentMapSignpostHeaderPointer::
@@ -3054,12 +2855,12 @@ PoisonStepCount:: ; dc74
ds 1
ds 2
-wdc77:: ds 2
-wdc79::
+wHappinessStepCount:: ds 1
+ ds 1
wParkBallsRemaining::
-wSafariBallsRemaining:: ds 1
-wSafariTimeRemaining:: ds 2
-wPhoneList:: ds CONTACT_LIST_SIZE
+wSafariBallsRemaining:: ds 1 ; dc79
+wSafariTimeRemaining:: ds 2 ; dc7a
+wPhoneList:: ds CONTACT_LIST_SIZE ; dc7c
ds 23
wLuckyNumberShowFlag:: ds 2 ; dc9d
wLuckyIDNumber:: ds 2 ; dc9f
@@ -3287,7 +3088,8 @@ w3_d742:: battle_tower_struct w3_d742
ds -$22
wBTChoiceOfLvlGroup::
-w3_d800:: ds $69
+w3_d800:: ; ds BG_MAP_WIDTH * SCREEN_HEIGHT ($240)
+ ds $69
w3_d869:: ds $17
w3_d880:: ds 1
w3_d881:: ds 1
@@ -3300,10 +3102,12 @@ w3_d895:: ds 11
w3_d8a0:: ds 1
w3_d8a1:: ds 1
w3_d8a2:: ds 1
-w3_d8a3:: ds 1
- ds $35c
-w3_dc00:: ds $168
-w3_dd68:: ds $284
+w3_d8a3:: ds $19d
+w3_da40:: ds $1c0
+
+w3_dc00:: ds SCREEN_WIDTH * SCREEN_HEIGHT
+w3_dd68:: ds SCREEN_WIDTH * SCREEN_HEIGHT
+ ds $11c
w3_dfec:: ds $10
w3_dffc:: ds 4