wram.asm 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213
  1. INCLUDE "constants.asm"
  2. flag_array: MACRO
  3. ds ((\1) + 7) / 8
  4. ENDM
  5. box_struct_length EQU 25 + NUM_MOVES * 2
  6. box_struct: MACRO
  7. \1Species:: db
  8. \1HP:: dw
  9. \1BoxLevel:: db
  10. \1Status:: db
  11. \1Type::
  12. \1Type1:: db
  13. \1Type2:: db
  14. \1CatchRate:: db
  15. \1Moves:: ds NUM_MOVES
  16. \1OTID:: dw
  17. \1Exp:: ds 3
  18. \1HPExp:: dw
  19. \1AttackExp:: dw
  20. \1DefenseExp:: dw
  21. \1SpeedExp:: dw
  22. \1SpecialExp:: dw
  23. \1DVs:: ds 2
  24. \1PP:: ds NUM_MOVES
  25. ENDM
  26. party_struct: MACRO
  27. box_struct \1
  28. \1Level:: db
  29. \1Stats::
  30. \1MaxHP:: dw
  31. \1Attack:: dw
  32. \1Defense:: dw
  33. \1Speed:: dw
  34. \1Special:: dw
  35. ENDM
  36. battle_struct: MACRO
  37. \1Species:: db
  38. \1HP:: dw
  39. \1PartyPos::
  40. \1BoxLevel:: db
  41. \1Status:: db
  42. \1Type::
  43. \1Type1:: db
  44. \1Type2:: db
  45. \1CatchRate:: db
  46. \1Moves:: ds NUM_MOVES
  47. \1DVs:: ds 2
  48. \1Level:: db
  49. \1Stats::
  50. \1MaxHP:: dw
  51. \1Attack:: dw
  52. \1Defense:: dw
  53. \1Speed:: dw
  54. \1Special:: dw
  55. \1PP:: ds NUM_MOVES
  56. ENDM
  57. SECTION "WRAM Bank 0", WRAM0
  58. wUnusedC000:: ; c000
  59. ds 1
  60. wSoundID:: ; c001
  61. ds 1
  62. wMuteAudioAndPauseMusic:: ; c002
  63. ; bit 7: whether sound has been muted
  64. ; all bits: whether the effective is active
  65. ; Store 1 to activate effect (any value in the range [1, 127] works).
  66. ; All audio is muted and music is paused. Sfx continues playing until it
  67. ; ends normally.
  68. ; Store 0 to resume music.
  69. ds 1
  70. wDisableChannelOutputWhenSfxEnds:: ; c003
  71. ds 1
  72. wStereoPanning:: ; c004
  73. ds 1
  74. wSavedVolume:: ; c005
  75. ds 1
  76. wChannelCommandPointers:: ; c006
  77. ds 16
  78. wChannelReturnAddresses:: ; c016
  79. ds 16
  80. wChannelSoundIDs:: ; c026
  81. ds 8
  82. wChannelFlags1:: ; c02e
  83. ds 8
  84. wChannelFlags2:: ; c036
  85. ds 8
  86. wChannelDuties:: ; c03e
  87. ds 8
  88. wChannelDutyCycles:: ; c046
  89. ds 8
  90. wChannelVibratoDelayCounters:: ; c04e
  91. ; reloaded at the beginning of a note. counts down until the vibrato begins.
  92. ds 8
  93. wChannelVibratoExtents:: ; c056
  94. ds 8
  95. wChannelVibratoRates:: ; c05e
  96. ; high nybble is rate (counter reload value) and low nybble is counter.
  97. ; time between applications of vibrato.
  98. ds 8
  99. wChannelFrequencyLowBytes:: ; c066
  100. ds 8
  101. wChannelVibratoDelayCounterReloadValues:: ; c06e
  102. ; delay of the beginning of the vibrato from the start of the note
  103. ds 8
  104. wChannelPitchBendLengthModifiers:: ; c076
  105. ds 8
  106. wChannelPitchBendFrequencySteps:: ; c07e
  107. ds 8
  108. wChannelPitchBendFrequencyStepsFractionalPart:: ; c086
  109. ds 8
  110. wChannelPitchBendCurrentFrequencyFractionalPart:: ; c08e
  111. ds 8
  112. wChannelPitchBendCurrentFrequencyHighBytes:: ; c096
  113. ds 8
  114. wChannelPitchBendCurrentFrequencyLowBytes:: ; c09e
  115. ds 8
  116. wChannelPitchBendTargetFrequencyHighBytes:: ; c0a6
  117. ds 8
  118. wChannelPitchBendTargetFrequencyLowBytes:: ; c0ae
  119. ds 8
  120. wChannelNoteDelayCounters:: ; c0b6
  121. ; Note delays are stored as 16-bit fixed-point numbers where the integer part
  122. ; is 8 bits and the fractional part is 8 bits.
  123. ds 8
  124. wChannelLoopCounters:: ; c0be
  125. ds 8
  126. wChannelNoteSpeeds:: ; c0c6
  127. ds 8
  128. wChannelNoteDelayCountersFractionalPart:: ; c0ce
  129. ds 8
  130. wChannelOctaves:: ; c0d6
  131. ds 8
  132. wChannelVolumes:: ; c0de
  133. ; also includes fade for hardware channels that support it
  134. ds 8
  135. wMusicWaveInstrument::
  136. ds 1
  137. wSfxWaveInstrument::
  138. ds 1
  139. wMusicTempo:: ; c0e8
  140. ds 2
  141. wSfxTempo:: ; c0ea
  142. ds 2
  143. wSfxHeaderPointer:: ; c0ec
  144. ds 2
  145. wNewSoundID:: ; c0ee
  146. ds 1
  147. wAudioROMBank:: ; c0ef
  148. ds 1
  149. wAudioSavedROMBank:: ; c0f0
  150. ds 1
  151. wFrequencyModifier:: ; c0f1
  152. ds 1
  153. wTempoModifier:: ; c0f2
  154. ds 1
  155. ds 13
  156. SECTION "Sprite State Data", WRAM0[$c100]
  157. wSpriteDataStart::
  158. wSpriteStateData1:: ; c100
  159. ; data for all sprites on the current map
  160. ; holds info for 16 sprites with $10 bytes each
  161. ; player sprite is always sprite 0
  162. ; C1x0: picture ID (fixed, loaded at map init)
  163. ; C1x1: movement status (0: uninitialized, 1: ready, 2: delayed, 3: moving)
  164. ; C1x2: sprite image index (changed on update, $ff if off screen, includes facing direction, progress in walking animation and a sprite-specific offset)
  165. ; C1x3: Y screen position delta (-1,0 or 1; added to c1x4 on each walking animation update)
  166. ; C1x4: Y screen position (in pixels, always 4 pixels above grid which makes sprites appear to be in the center of a tile)
  167. ; C1x5: X screen position delta (-1,0 or 1; added to c1x6 on each walking animation update)
  168. ; C1x6: X screen position (in pixels, snaps to grid if not currently walking)
  169. ; C1x7: intra-animation-frame counter (counting upwards to 4 until c1x8 is incremented)
  170. ; C1x8: animation frame counter (increased every 4 updates, hold four states (totalling to 16 walking frames)
  171. ; C1x9: facing direction (0: down, 4: up, 8: left, $c: right)
  172. ; C1xA
  173. ; C1xB
  174. ; C1xC
  175. ; C1xD
  176. ; C1xE
  177. ; C1xF
  178. spritestatedata1: MACRO
  179. \1SpriteStateData1::
  180. \1PictureID:: db
  181. \1MovementStatus:: db
  182. \1SpriteImageIdx:: db
  183. \1YStepVector:: db
  184. \1YPixels:: db
  185. \1XStepVector:: db
  186. \1XPixels:: db
  187. \1IntraAnimFrameCounter:: db
  188. \1AnimFrameCounter:: db
  189. \1FacingDirection:: db
  190. ds 6
  191. \1SpriteStateData1End::
  192. endm
  193. spritestatedata1 Player
  194. spritestatedata1 Sprite01
  195. spritestatedata1 Sprite02
  196. spritestatedata1 Sprite03
  197. spritestatedata1 Sprite04
  198. spritestatedata1 Sprite05
  199. spritestatedata1 Sprite06
  200. spritestatedata1 Sprite07
  201. spritestatedata1 Sprite08
  202. spritestatedata1 Sprite09
  203. spritestatedata1 Sprite10
  204. spritestatedata1 Sprite11
  205. spritestatedata1 Sprite12
  206. spritestatedata1 Sprite13
  207. spritestatedata1 Sprite14
  208. spritestatedata1 Sprite15
  209. ; ds $10 * $10
  210. ;SECTION "Sprite State Data 2", WRAM0[$c200]
  211. wSpriteStateData2:: ; c200
  212. ; more data for all sprites on the current map
  213. ; holds info for 16 sprites with $10 bytes each
  214. ; player sprite is always sprite 0
  215. ; C2x0: walk animation counter (counting from $10 backwards when moving)
  216. ; C2x1:
  217. ; C2x2: Y displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged)
  218. ; C2x3: X displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged)
  219. ; C2x4: Y position (in 2x2 tile grid steps, topmost 2x2 tile has value 4)
  220. ; C2x5: X position (in 2x2 tile grid steps, leftmost 2x2 tile has value 4)
  221. ; C2x6: movement byte 1 (determines whether a sprite can move, $ff:not moving, $fe:random movements, others unknown)
  222. ; C2x7: (?) (set to $80 when in grass, else $0; may be used to draw grass above the sprite)
  223. ; C2x8: delay until next movement (counted downwards, status (c1x1) is set to ready if reached 0)
  224. ; C2x9
  225. ; C2xA
  226. ; C2xB
  227. ; C2xC
  228. ; C2xD
  229. ; C2xE: sprite image base offset (in video ram, player always has value 1, used to compute c1x2)
  230. ; C2xF
  231. spritestatedata2: MACRO
  232. \1SpriteStateData2::
  233. \1WalkAnimationCounter:: db
  234. ds 1
  235. \1YDisplacement:: db
  236. \1XDisplacement:: db
  237. \1MapY:: db
  238. \1MapX:: db
  239. \1MovementByte1:: db
  240. \1GrassPriority:: db
  241. \1MovementDelay:: db
  242. ds 5
  243. \1SpriteImageBaseOffset:: db
  244. ds 1
  245. \1SpriteStateData2End::
  246. endm
  247. spritestatedata2 Player
  248. spritestatedata2 Sprite01
  249. spritestatedata2 Sprite02
  250. spritestatedata2 Sprite03
  251. spritestatedata2 Sprite04
  252. spritestatedata2 Sprite05
  253. spritestatedata2 Sprite06
  254. spritestatedata2 Sprite07
  255. spritestatedata2 Sprite08
  256. spritestatedata2 Sprite09
  257. spritestatedata2 Sprite10
  258. spritestatedata2 Sprite11
  259. spritestatedata2 Sprite12
  260. spritestatedata2 Sprite13
  261. spritestatedata2 Sprite14
  262. spritestatedata2 Sprite15
  263. ; ds $10 * $10
  264. wSpriteDataEnd::
  265. SECTION "OAM Buffer", WRAM0[$c300]
  266. wOAMBuffer:: ; c300
  267. ; buffer for OAM data. Copied to OAM by DMA
  268. ds 4 * 40
  269. wTileMap:: ; c3a0
  270. ; buffer for tiles that are visible on screen (20 columns by 18 rows)
  271. ds 20 * 18
  272. wSerialPartyMonsPatchList:: ; c508
  273. ; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
  274. wTileMapBackup:: ; c508
  275. ; buffer for temporarily saving and restoring current screen's tiles
  276. ; (e.g. if menus are drawn on top)
  277. ; ds 20 * 18
  278. ds 200
  279. wSerialEnemyMonsPatchList:: ; c5d0
  280. ; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
  281. ds 200
  282. ds 80
  283. wTempPic::
  284. wOverworldMap:: ; c6e8
  285. ds 1300
  286. wRedrawRowOrColumnSrcTiles:: ; cbfc
  287. ; the tiles of the row or column to be redrawn by RedrawRowOrColumn
  288. ds SCREEN_WIDTH * 2
  289. ; coordinates of the position of the cursor for the top menu item (id 0)
  290. wTopMenuItemY:: ; cc24
  291. ds 1
  292. wTopMenuItemX:: ; cc25
  293. ds 1
  294. wCurrentMenuItem:: ; cc26
  295. ; the id of the currently selected menu item
  296. ; the top item has id 0, the one below that has id 1, etc.
  297. ; note that the "top item" means the top item currently visible on the screen
  298. ; add this value to [wListScrollOffset] to get the item's position within the list
  299. ds 1
  300. wTileBehindCursor:: ; cc27
  301. ; the tile that was behind the menu cursor's current location
  302. ds 1
  303. wMaxMenuItem:: ; cc28
  304. ; id of the bottom menu item
  305. ds 1
  306. wMenuWatchedKeys:: ; cc29
  307. ; bit mask of keys that the menu will respond to
  308. ds 1
  309. wLastMenuItem:: ; cc2a
  310. ; id of previously selected menu item
  311. ds 1
  312. wPartyAndBillsPCSavedMenuItem:: ; cc2b
  313. ; It is mainly used by the party menu to remember the cursor position while the
  314. ; menu isn't active.
  315. ; It is also used to remember the cursor position of mon lists (for the
  316. ; withdraw/deposit/release actions) in Bill's PC so that it doesn't get lost
  317. ; when you choose a mon from the list and a sub-menu is shown. It's reset when
  318. ; you return to the main Bill's PC menu.
  319. ds 1
  320. wBagSavedMenuItem:: ; cc2c
  321. ; It is used by the bag list to remember the cursor position while the menu
  322. ; isn't active.
  323. ds 1
  324. wBattleAndStartSavedMenuItem:: ; cc2d
  325. ; It is used by the start menu to remember the cursor position while the menu
  326. ; isn't active.
  327. ; The battle menu uses it so that the cursor position doesn't get lost when
  328. ; a sub-menu is shown. It's reset at the start of each battle.
  329. ds 1
  330. wPlayerMoveListIndex:: ; cc2e
  331. ds 1
  332. wPlayerMonNumber:: ; cc2f
  333. ; index in party of currently battling mon
  334. ds 1
  335. wMenuCursorLocation:: ; cc30
  336. ; the address of the menu cursor's current location within wTileMap
  337. ds 2
  338. ds 2
  339. wMenuJoypadPollCount:: ; cc34
  340. ; how many times should HandleMenuInput poll the joypad state before it returns?
  341. ds 1
  342. wMenuItemToSwap:: ; cc35
  343. ; id of menu item selected for swapping (counts from 1) (0 means that no menu item has been selected for swapping)
  344. ds 1
  345. wListScrollOffset:: ; cc36
  346. ; offset of the current top menu item from the beginning of the list
  347. ; keeps track of what section of the list is on screen
  348. ds 1
  349. wMenuWatchMovingOutOfBounds:: ; cc37
  350. ; If non-zero, then when wrapping is disabled and the player tries to go past
  351. ; the top or bottom of the menu, return from HandleMenuInput. This is useful for
  352. ; menus that have too many items to display at once on the screen because it
  353. ; allows the caller to scroll the entire menu up or down when this happens.
  354. ds 1
  355. wTradeCenterPointerTableIndex:: ; cc38
  356. ds 1
  357. ds 1
  358. wTextDest:: ; cc3a
  359. ; destination pointer for text output
  360. ; this variable is written to, but is never read from
  361. ds 2
  362. wDoNotWaitForButtonPressAfterDisplayingText:: ; cc3c
  363. ; if non-zero, skip waiting for a button press after displaying text in DisplayTextID
  364. ds 1
  365. wSerialSyncAndExchangeNybbleReceiveData:: ; cc3d
  366. ; the final received nybble is stored here by Serial_SyncAndExchangeNybble
  367. wSerialExchangeNybbleTempReceiveData:: ; cc3d
  368. ; temporary nybble used by Serial_ExchangeNybble
  369. wLinkMenuSelectionReceiveBuffer:: ; cc3d
  370. ; two byte buffer
  371. ; the received menu selection is stored twice
  372. ds 1
  373. wSerialExchangeNybbleReceiveData:: ; cc3e
  374. ; the final received nybble is stored here by Serial_ExchangeNybble
  375. ds 1
  376. ds 3
  377. wSerialExchangeNybbleSendData:: ; cc42
  378. ; this nybble is sent when using Serial_SyncAndExchangeNybble or Serial_ExchangeNybble
  379. wLinkMenuSelectionSendBuffer:: ; cc42
  380. ; two byte buffer
  381. ; the menu selection byte is stored twice before sending
  382. ds 5
  383. wLinkTimeoutCounter:: ; cc47
  384. ; 1 byte
  385. wUnknownSerialCounter:: ; cc47
  386. ; 2 bytes
  387. wEnteringCableClub:: ; cc47
  388. ds 1
  389. ds 1
  390. wWhichTradeMonSelectionMenu:: ; cc49
  391. ; $00 = player mons
  392. ; $01 = enemy mons
  393. wMonDataLocation:: ; cc49
  394. ; 0 = player's party
  395. ; 1 = enemy party
  396. ; 2 = current box
  397. ; 3 = daycare
  398. ; 4 = in-battle mon
  399. ;
  400. ; AddPartyMon uses it slightly differently.
  401. ; If the lower nybble is 0, the mon is added to the player's party, else the enemy's.
  402. ; If the entire value is 0, then the player is allowed to name the mon.
  403. ds 1
  404. wMenuWrappingEnabled:: ; cc4a
  405. ; set to 1 if you can go from the bottom to the top or top to bottom of a menu
  406. ; set to 0 if you can't go past the top or bottom of the menu
  407. ds 1
  408. wCheckFor180DegreeTurn:: ; cc4b
  409. ; whether to check for 180-degree turn (0 = don't, 1 = do)
  410. ds 1
  411. ds 1
  412. wMissableObjectIndex:: ; cc4d
  413. ds 1
  414. wPredefID:: ; cc4e
  415. ds 1
  416. wPredefRegisters:: ; cc4f
  417. ds 6
  418. wTrainerHeaderFlagBit:: ; cc55
  419. ds 1
  420. ds 1
  421. wNPCMovementScriptPointerTableNum:: ; cc57
  422. ; which NPC movement script pointer is being used
  423. ; 0 if an NPC movement script is not running
  424. ds 1
  425. wNPCMovementScriptBank:: ; cc58
  426. ; ROM bank of current NPC movement script
  427. ds 1
  428. ds 2
  429. wUnusedCC5B:: ; cc5b
  430. wVermilionDockTileMapBuffer:: ; cc5b
  431. ; 180 bytes
  432. wOaksAideRewardItemName:: ; cc5b
  433. wDexRatingNumMonsSeen:: ; cc5b
  434. wFilteredBagItems:: ; cc5b
  435. ; List of bag items that has been filtered to a certain type of items,
  436. ; such as drinks or fossils.
  437. wElevatorWarpMaps:: ; cc5b
  438. wMonPartySpritesSavedOAM:: ; cc5b
  439. ; Saved copy of OAM for the first frame of the animation to make it easy to
  440. ; flip back from the second frame.
  441. ; $60 bytes
  442. wTrainerCardBlkPacket:: ; cc5b
  443. ; $40 bytes
  444. wSlotMachineSevenAndBarModeChance:: ; cc5b
  445. ; If a random number greater than this value is generated, then the player is
  446. ; allowed to have three 7 symbols or bar symbols line up.
  447. ; So, this value is actually the chance of NOT entering that mode.
  448. ; If the slot is lucky, it equals 250, giving a 5/256 (~2%) chance.
  449. ; Otherwise, it equals 253, giving a 2/256 (~0.8%) chance.
  450. wHallOfFame:: ; cc5b
  451. wBoostExpByExpAll:: ; cc5b
  452. wAnimationType:: ; cc5b
  453. ; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
  454. wNPCMovementDirections:: ; cc5b
  455. ds 1
  456. wDexRatingNumMonsOwned:: ; cc5c
  457. ds 1
  458. wDexRatingText:: ; cc5d
  459. ds 1
  460. wSlotMachineSavedROMBank:: ; cc5e
  461. ; ROM back to return to when the player is done with the slot machine
  462. ds 1
  463. ds 26
  464. wAnimPalette:: ; cc79
  465. ds 1
  466. ds 29
  467. wNPCMovementDirections2:: ; cc97
  468. wSwitchPartyMonTempBuffer:: ; cc97
  469. ; temporary buffer when swapping party mon data
  470. ds 10
  471. wNumStepsToTake:: ; cca1
  472. ; used in Pallet Town scripted movement
  473. ds 49
  474. wRLEByteCount:: ; ccd2
  475. ds 1
  476. wAddedToParty:: ; ccd3
  477. ; 0 = not added
  478. ; 1 = added
  479. wSimulatedJoypadStatesEnd:: ; ccd3
  480. ; this is the end of the joypad states
  481. ; the list starts above this address and extends downwards in memory until here
  482. ; overloaded with below labels
  483. wParentMenuItem:: ; ccd3
  484. wCanEvolveFlags:: ; ccd3
  485. ; 1 flag for each party member indicating whether it can evolve
  486. ; The purpose of these flags is to track which mons levelled up during the
  487. ; current battle at the end of the battle when evolution occurs.
  488. ; Other methods of evolution simply set it by calling TryEvolvingMon.
  489. ds 1
  490. wForceEvolution:: ; ccd4
  491. ds 1
  492. ; if [ccd5] != 1, the second AI layer is not applied
  493. wAILayer2Encouragement:: ; ccd5
  494. ds 1
  495. ds 1
  496. ; current HP of player and enemy substitutes
  497. wPlayerSubstituteHP:: ; ccd7
  498. ds 1
  499. wEnemySubstituteHP:: ; ccd8
  500. ds 1
  501. wTestBattlePlayerSelectedMove:: ; ccd9
  502. ; The player's selected move during a test battle.
  503. ; InitBattleVariables sets it to the move Pound.
  504. ds 1
  505. ds 1
  506. wMoveMenuType:: ; ccdb
  507. ; 0=regular, 1=mimic, 2=above message box (relearn, heal pp..)
  508. ds 1
  509. wPlayerSelectedMove:: ; ccdc
  510. ds 1
  511. wEnemySelectedMove:: ; ccdd
  512. ds 1
  513. wLinkBattleRandomNumberListIndex:: ; ccde
  514. ds 1
  515. wAICount:: ; ccdf
  516. ; number of times remaining that AI action can occur
  517. ds 1
  518. ds 2
  519. wEnemyMoveListIndex:: ; cce2
  520. ds 1
  521. wLastSwitchInEnemyMonHP:: ; cce3
  522. ; The enemy mon's HP when it was switched in or when the current player mon
  523. ; was switched in, which was more recent.
  524. ; It's used to determine the message to print when switching out the player mon.
  525. ds 2
  526. wTotalPayDayMoney:: ; cce5
  527. ; total amount of money made using Pay Day during the current battle
  528. ds 3
  529. wSafariEscapeFactor:: ; cce8
  530. ds 1
  531. wSafariBaitFactor:: ; cce9
  532. ds 1;
  533. ds 1
  534. wTransformedEnemyMonOriginalDVs:: ; cceb
  535. ds 2
  536. wMonIsDisobedient:: ds 1 ; cced
  537. wPlayerDisabledMoveNumber:: ds 1 ; ccee
  538. wEnemyDisabledMoveNumber:: ds 1 ; ccef
  539. wInHandlePlayerMonFainted:: ; ccf0
  540. ; When running in the scope of HandlePlayerMonFainted, it equals 1.
  541. ; When running in the scope of HandleEnemyMonFainted, it equals 0.
  542. ds 1
  543. wPlayerUsedMove:: ds 1 ; ccf1
  544. wEnemyUsedMove:: ds 1 ; ccf2
  545. wEnemyMonMinimized:: ds 1 ; ccf3
  546. wMoveDidntMiss:: ds 1 ; ccf4
  547. wPartyFoughtCurrentEnemyFlags:: ; ccf5
  548. ; flags that indicate which party members have fought the current enemy mon
  549. flag_array 6
  550. wLowHealthAlarmDisabled:: ; ccf6
  551. ; Whether the low health alarm has been disabled due to the player winning the
  552. ; battle.
  553. ds 1
  554. wPlayerMonMinimized:: ; ccf7
  555. ds 1
  556. ds 13
  557. wLuckySlotHiddenObjectIndex:: ; cd05
  558. wEnemyNumHits:: ; cd05
  559. ; number of hits by enemy in attacks like Double Slap, etc.
  560. wEnemyBideAccumulatedDamage:: ; cd05
  561. ; the amount of damage accumulated by the enemy while biding (2 bytes)
  562. ds 10
  563. wInGameTradeGiveMonSpecies:: ; cd0f
  564. wPlayerMonUnmodifiedLevel:: ; cd0f
  565. ds 1
  566. wInGameTradeTextPointerTablePointer:: ; cd10
  567. wPlayerMonUnmodifiedMaxHP:: ; cd10
  568. ds 2
  569. wInGameTradeTextPointerTableIndex:: ; cd12
  570. wPlayerMonUnmodifiedAttack:: ; cd12
  571. ds 1
  572. wInGameTradeGiveMonName:: ; cd13
  573. ds 1
  574. wPlayerMonUnmodifiedDefense:: ; cd14
  575. ds 2
  576. wPlayerMonUnmodifiedSpeed:: ; cd16
  577. ds 2
  578. wPlayerMonUnmodifiedSpecial:: ; cd18
  579. ds 2
  580. ; stat modifiers for the player's current pokemon
  581. ; value can range from 1 - 13 ($1 to $D)
  582. ; 7 is normal
  583. wPlayerMonStatMods::
  584. wPlayerMonAttackMod:: ; cd1a
  585. ds 1
  586. wPlayerMonDefenseMod:: ; cd1b
  587. ds 1
  588. wPlayerMonSpeedMod:: ; cd1c
  589. ds 1
  590. wPlayerMonSpecialMod:: ; cd1d
  591. ds 1
  592. wInGameTradeReceiveMonName:: ; cd1e
  593. wPlayerMonAccuracyMod:: ; cd1e
  594. ds 1
  595. wPlayerMonEvasionMod:: ; cd1f
  596. ds 1
  597. ds 3
  598. wEnemyMonUnmodifiedLevel:: ; cd23
  599. ds 1
  600. wEnemyMonUnmodifiedMaxHP:: ; cd24
  601. ds 2
  602. wEnemyMonUnmodifiedAttack:: ; cd26
  603. ds 2
  604. wEnemyMonUnmodifiedDefense:: ; cd28
  605. ds 1
  606. wInGameTradeMonNick:: ; cd29
  607. ds 1
  608. wEnemyMonUnmodifiedSpeed:: ; cd2a
  609. ds 2
  610. wEnemyMonUnmodifiedSpecial:: ; cd2c
  611. ds 1
  612. wEngagedTrainerClass:: ; cd2d
  613. ds 1
  614. wEngagedTrainerSet:: ; cd2e
  615. ; ds 1
  616. ; stat modifiers for the enemy's current pokemon
  617. ; value can range from 1 - 13 ($1 to $D)
  618. ; 7 is normal
  619. wEnemyMonStatMods::
  620. wEnemyMonAttackMod:: ; cd2e
  621. ds 1
  622. wEnemyMonDefenseMod:: ; cd2f
  623. ds 1
  624. wEnemyMonSpeedMod:: ; cd30
  625. ds 1
  626. wEnemyMonSpecialMod:: ; cd31
  627. ds 1
  628. wEnemyMonAccuracyMod:: ; cd32
  629. ds 1
  630. wEnemyMonEvasionMod:: ; cd33
  631. ds 1
  632. wInGameTradeReceiveMonSpecies::
  633. ds 1
  634. ds 2
  635. wNPCMovementDirections2Index:: ; cd37
  636. wUnusedCD37:: ; cd37
  637. wFilteredBagItemsCount:: ; cd37
  638. ; number of items in wFilteredBagItems list
  639. ds 1
  640. wSimulatedJoypadStatesIndex:: ; cd38
  641. ; the next simulated joypad state is at wSimulatedJoypadStatesEnd plus this value minus 1
  642. ; 0 if the joypad state is not being simulated
  643. ds 1
  644. wWastedByteCD39:: ; cd39
  645. ; written to but nothing ever reads it
  646. ds 1
  647. wWastedByteCD3A:: ; cd3a
  648. ; written to but nothing ever reads it
  649. ds 1
  650. wOverrideSimulatedJoypadStatesMask:: ; cd3b
  651. ; mask indicating which real button presses can override simulated ones
  652. ; XXX is it ever not 0?
  653. ds 1
  654. ds 1
  655. wFallingObjectsMovementData:: ; cd3d
  656. ; up to 20 bytes (one byte for each falling object)
  657. wSavedY:: ; cd3d
  658. wTempSCX:: ; cd3d
  659. wBattleTransitionCircleScreenQuadrantY:: ; cd3d
  660. ; 0 = upper half (Y < 9)
  661. ; 1 = lower half (Y >= 9)
  662. wBattleTransitionCopyTilesOffset:: ; cd3d
  663. ; 2 bytes
  664. ; after 1 row/column has been copied, the offset to the next one to copy from
  665. wInwardSpiralUpdateScreenCounter:: ; cd3d
  666. ; counts down from 7 so that every time 7 more tiles of the spiral have been
  667. ; placed, the tile map buffer is copied to VRAM so that progress is visible
  668. wHoFTeamIndex:: ; cd3d
  669. wSSAnneSmokeDriftAmount:: ; cd3d
  670. ; multiplied by 16 to get the number of times to go right by 2 pixels
  671. wRivalStarterTemp:: ; cd3d
  672. wBoxMonCounts:: ; cd3d
  673. ; 12 bytes
  674. ; array of the number of mons in each box
  675. wDexMaxSeenMon:: ; cd3d
  676. wPPRestoreItem:: ; cd3d
  677. wWereAnyMonsAsleep:: ; cd3d
  678. wCanPlaySlots:: ; cd3d
  679. wNumShakes:: ; cd3d
  680. wDayCareStartLevel:: ; cd3d
  681. ; the level of the mon at the time it entered day care
  682. wWhichBadge:: ; cd3d
  683. wPriceTemp:: ; cd3d
  684. ; 3-byte BCD number
  685. wTitleMonSpecies:: ; cd3d
  686. wPlayerCharacterOAMTile:: ; cd3d
  687. wMoveDownSmallStarsOAMCount:: ; cd3d
  688. ; the number of small stars OAM entries to move down
  689. wChargeMoveNum:: ; cd3d
  690. wCoordIndex:: ; cd3d
  691. wOptionsTextSpeedCursorX:: ; cd3d
  692. wBoxNumString:: ; cd3d
  693. wTrainerInfoTextBoxWidthPlus1:: ; cd3d
  694. wSwappedMenuItem:: ; cd3d
  695. wHoFMonSpecies:: ; cd3d
  696. wFieldMoves:: ; cd3d
  697. ; 4 bytes
  698. ; the current mon's field moves
  699. wBadgeNumberTile:: ; cd3d
  700. ; tile ID of the badge number being drawn
  701. wRodResponse:: ; cd3d
  702. ; 0 = no bite
  703. ; 1 = bite
  704. ; 2 = no fish on map
  705. wWhichTownMapLocation:: ; cd3d
  706. wStoppingWhichSlotMachineWheel:: ; cd3d
  707. ; which wheel the player is trying to stop
  708. ; 0 = none, 1 = wheel 1, 2 = wheel 2, 3 or greater = wheel 3
  709. wTradedPlayerMonSpecies:: ; cd3d
  710. wTradingWhichPlayerMon:: ; cd3d
  711. wChangeBoxSavedMapTextPointer:: ; cd3d
  712. wFlyAnimUsingCoordList:: ; cd3d
  713. wPlayerSpinInPlaceAnimFrameDelay:: ; cd3d
  714. wPlayerSpinWhileMovingUpOrDownAnimDeltaY:: ; cd3d
  715. wHiddenObjectFunctionArgument:: ; cd3d
  716. wWhichTrade:: ; cd3d
  717. ; which entry from TradeMons to select
  718. wTrainerSpriteOffset:: ; cd3d
  719. wUnusedCD3D:: ; cd3d
  720. ds 1
  721. wHUDPokeballGfxOffsetX:: ; cd3e
  722. ; difference in X between the next ball and the current one
  723. wBattleTransitionCircleScreenQuadrantX:: ; cd3e
  724. ; 0 = left half (X < 10)
  725. ; 1 = right half (X >= 10)
  726. wSSAnneSmokeX:: ; cd3e
  727. wRivalStarterBallSpriteIndex:: ; cd3e
  728. wDayCareNumLevelsGrown:: ; cd3e
  729. wOptionsBattleAnimCursorX:: ; cd3e
  730. wTrainerInfoTextBoxWidth:: ; cd3e
  731. wHoFPartyMonIndex:: ; cd3e
  732. wNumCreditsMonsDisplayed:: ; cd3e
  733. ; the number of credits mons that have been displayed so far
  734. wBadgeNameTile:: ; cd3e
  735. ; first tile ID of the name being drawn
  736. wFlyLocationsList:: ; cd3e
  737. ; 11 bytes plus $ff sentinel values at each end
  738. wSlotMachineWheel1Offset:: ; cd3e
  739. wTradedEnemyMonSpecies:: ; cd3e
  740. wTradingWhichEnemyMon:: ; cd3e
  741. wFlyAnimCounter:: ; cd3e
  742. wPlayerSpinInPlaceAnimFrameDelayDelta:: ; cd3e
  743. wPlayerSpinWhileMovingUpOrDownAnimMaxY:: ; cd3e
  744. wHiddenObjectFunctionRomBank:: ; cd3e
  745. wTrainerEngageDistance:: ; cd3e
  746. ds 1
  747. wHUDGraphicsTiles:: ; cd3f
  748. ; 3 bytes
  749. wDayCareTotalCost:: ; cd3f
  750. ; 2-byte BCD number
  751. wJigglypuffFacingDirections:: ; cd3f
  752. wOptionsBattleStyleCursorX:: ; cd3f
  753. wTrainerInfoTextBoxNextRowOffset:: ; cd3f
  754. wHoFMonLevel:: ; cd3f
  755. wBadgeOrFaceTiles:: ; cd3f
  756. ; 8 bytes
  757. ; a list of the first tile IDs of each badge or face (depending on whether the
  758. ; badge is owned) to be drawn on the trainer screen
  759. wSlotMachineWheel2Offset:: ; cd3f
  760. wNameOfPlayerMonToBeTraded:: ; cd3f
  761. wFlyAnimBirdSpriteImageIndex:: ; cd3f
  762. wPlayerSpinInPlaceAnimFrameDelayEndValue:: ; cd3f
  763. wPlayerSpinWhileMovingUpOrDownAnimFrameDelay:: ; cd3f
  764. wHiddenObjectIndex:: ; cd3f
  765. wTrainerFacingDirection:: ; cd3f
  766. ds 1
  767. wHoFMonOrPlayer:: ; cd40
  768. ; show mon or show player?
  769. ; 0 = mon
  770. ; 1 = player
  771. wSlotMachineWheel3Offset:: ; cd40
  772. wPlayerSpinInPlaceAnimSoundID:: ; cd40
  773. wHiddenObjectY:: ; cd40
  774. wTrainerScreenY:: ; cd40
  775. wUnusedCD40:: ; cd40
  776. ds 1
  777. wDayCarePerLevelCost:: ; cd41
  778. ; 2-byte BCD number (always set to $0100)
  779. wHoFTeamIndex2:: ; cd41
  780. wHiddenItemOrCoinsIndex:: ; cd41
  781. wTradedPlayerMonOT:: ; cd41
  782. wHiddenObjectX:: ; cd41
  783. wSlotMachineWinningSymbol:: ; cd41
  784. ; the OAM tile number of the upper left corner of the winning symbol minus 2
  785. wNumFieldMoves:: ; cd41
  786. wSlotMachineWheel1BottomTile:: ; cd41
  787. wTrainerScreenX:: ; cd41
  788. ds 1
  789. ; a lot of the uses for these values use more than the said address
  790. wHoFTeamNo:: ; cd42
  791. wSlotMachineWheel1MiddleTile:: ; cd42
  792. wFieldMovesLeftmostXCoord:: ; cd42
  793. ds 1
  794. wLastFieldMoveID:: ; cd43
  795. ; unused
  796. wSlotMachineWheel1TopTile:: ; cd43
  797. ds 1
  798. wSlotMachineWheel2BottomTile:: ; cd44
  799. ds 1
  800. wSlotMachineWheel2MiddleTile:: ; cd45
  801. ds 1
  802. wTempCoins1:: ; cd46
  803. ; 2 bytes
  804. ; temporary variable used to add payout amount to the player's coins
  805. wSlotMachineWheel2TopTile:: ; cd46
  806. ds 1
  807. wBattleTransitionSpiralDirection:: ; cd47
  808. ; 0 = outward, 1 = inward
  809. wSlotMachineWheel3BottomTile:: ; cd47
  810. ds 1
  811. wSlotMachineWheel3MiddleTile:: ; cd48
  812. wFacingDirectionList:: ; cd48
  813. ; 4 bytes (also, the byte before the start of the list (cd47) is used a temp
  814. ; variable when the list is rotated)
  815. ; used when spinning the player's sprite
  816. ds 1
  817. wSlotMachineWheel3TopTile:: ; cd49
  818. wTempObtainedBadgesBooleans::
  819. ; 8 bytes
  820. ; temporary list created when displaying the badges on the trainer screen
  821. ; one byte for each badge; 0 = not obtained, 1 = obtained
  822. ds 1
  823. wTempCoins2:: ; cd4a
  824. ; 2 bytes
  825. ; temporary variable used to subtract the bet amount from the player's coins
  826. wPayoutCoins:: ; cd4a
  827. ; 2 bytes
  828. ds 2
  829. wTradedPlayerMonOTID:: ; cd4c
  830. wSlotMachineFlags:: ; cd4c
  831. ; These flags are set randomly and control when the wheels stop.
  832. ; bit 6: allow the player to win in general
  833. ; bit 7: allow the player to win with 7 or bar (plus the effect of bit 6)
  834. ds 1
  835. wSlotMachineWheel1SlipCounter:: ; cd4d
  836. ; wheel 1 can "slip" while this is non-zero
  837. wCutTile:: ; cd4d
  838. ; $3d = tree tile
  839. ; $52 = grass tile
  840. ds 1
  841. wSlotMachineWheel2SlipCounter:: ; cd4e
  842. ; wheel 2 can "slip" while this is non-zero
  843. wTradedEnemyMonOT:: ; cd4e
  844. ds 1
  845. wSavedPlayerScreenY:: ; cd4f
  846. wSlotMachineRerollCounter:: ; cd4f
  847. ; The remaining number of times wheel 3 will roll down a symbol until a match is
  848. ; found, when winning is enabled. It's initialized to 4 each bet.
  849. wEmotionBubbleSpriteIndex:: ; cd4f
  850. ; the index of the sprite the emotion bubble is to be displayed above
  851. ds 1
  852. wWhichEmotionBubble:: ; cd50
  853. wSlotMachineBet:: ; cd50
  854. ; how many coins the player bet on the slot machine (1 to 3)
  855. wSavedPlayerFacingDirection:: ; cd50
  856. wWhichAnimationOffsets:: ; cd50
  857. ; 0 = cut animation, 1 = boulder dust animation
  858. ds 9
  859. wTradedEnemyMonOTID:: ; cd59
  860. ds 2
  861. wStandingOnWarpPadOrHole:: ; cd5b
  862. ; 0 = neither
  863. ; 1 = warp pad
  864. ; 2 = hole
  865. wOAMBaseTile:: ; cd5b
  866. wGymTrashCanIndex:: ; cd5b
  867. ds 1
  868. wSymmetricSpriteOAMAttributes:: ; cd5c
  869. ds 1
  870. wMonPartySpriteSpecies:: ; cd5d
  871. ds 1
  872. wLeftGBMonSpecies:: ; cd5e
  873. ; in the trade animation, the mon that leaves the left gameboy
  874. ds 1
  875. wRightGBMonSpecies:: ; cd5f
  876. ; in the trade animation, the mon that leaves the right gameboy
  877. ds 1
  878. wFlags_0xcd60:: ; cd60
  879. ; bit 0: is player engaged by trainer (to avoid being engaged by multiple trainers simultaneously)
  880. ; bit 1: boulder dust animation (from using Strength) pending
  881. ; bit 3: using generic PC
  882. ; bit 5: don't play sound when A or B is pressed in menu
  883. ; bit 6: tried pushing against boulder once (you need to push twice before it will move)
  884. ds 1
  885. ds 9
  886. wActionResultOrTookBattleTurn:: ; cd6a
  887. ; This has overlapping related uses.
  888. ; When the player tries to use an item or use certain field moves, 0 is stored
  889. ; when the attempt fails and 1 is stored when the attempt succeeds.
  890. ; In addition, some items store 2 for certain types of failures, but this
  891. ; cannot happen in battle.
  892. ; In battle, a non-zero value indicates the player has taken their turn using
  893. ; something other than a move (e.g. using an item or switching pokemon).
  894. ; So, when an item is successfully used in battle, this value becomes non-zero
  895. ; and the player is not allowed to make a move and the two uses are compatible.
  896. ds 1
  897. wJoyIgnore:: ; cd6b
  898. ; Set buttons are ignored.
  899. ds 1
  900. wDownscaledMonSize:: ; cd6c
  901. ; size of downscaled mon pic used in pokeball entering/exiting animation
  902. ; $00 = 5×5
  903. ; $01 = 3×3
  904. wNumMovesMinusOne:: ; cd6c
  905. ; FormatMovesString stores the number of moves minus one here
  906. ds 1
  907. UNION
  908. wcd6d:: ds 4 ; buffer for various data
  909. wStatusScreenCurrentPP:: ; cd71
  910. ; temp variable used to print a move's current PP on the status screen
  911. ds 1
  912. ds 6
  913. wNormalMaxPPList:: ; cd78
  914. ; list of normal max PP (without PP up) values
  915. ds 9
  916. NEXTU
  917. wEvosMoves:: ds MAX_EVOLUTIONS * EVOLUTION_SIZE + 1
  918. .end::
  919. ENDU
  920. wSerialOtherGameboyRandomNumberListBlock:: ; cd81
  921. ; buffer for transferring the random number list generated by the other gameboy
  922. wTileMapBackup2:: ; cd81
  923. ; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
  924. ds 20 * 18
  925. wNamingScreenNameLength:: ; cee9
  926. wEvoOldSpecies:: ; cee9
  927. wBuffer:: ; cee9
  928. ; Temporary storage area of 30 bytes.
  929. wTownMapCoords:: ; cee9
  930. ; lower nybble is x, upper nybble is y
  931. wLearningMovesFromDayCare:: ; cee9
  932. ; whether WriteMonMoves is being used to make a mon learn moves from day care
  933. ; non-zero if so
  934. wChangeMonPicEnemyTurnSpecies:: ; cee9
  935. wHPBarMaxHP:: ; cee9
  936. ds 1
  937. wNamingScreenSubmitName:: ; ceea
  938. ; non-zero when the player has chosen to submit the name
  939. wChangeMonPicPlayerTurnSpecies:: ; ceea
  940. wEvoNewSpecies:: ; ceea
  941. ds 1
  942. wAlphabetCase:: ; ceeb
  943. ; 0 = upper case
  944. ; 1 = lower case
  945. wEvoMonTileOffset:: ; ceeb
  946. wHPBarOldHP:: ; ceeb
  947. ds 1
  948. wEvoCancelled:: ; ceec
  949. ds 1
  950. wNamingScreenLetter:: ; ceed
  951. wHPBarNewHP:: ; ceed
  952. ds 2
  953. wHPBarDelta:: ; ceef
  954. ds 1
  955. wHPBarTempHP:: ; cef0
  956. ds 2
  957. ds 11
  958. wHPBarHPDifference:: ; cefd
  959. ds 1
  960. ds 7
  961. wAIItem:: ; cf05
  962. ; the item that the AI used
  963. ds 1
  964. wUsedItemOnWhichPokemon:: ; cf05
  965. ds 1
  966. wAnimSoundID:: ; cf07
  967. ; sound ID during battle animations
  968. ds 1
  969. wBankswitchHomeSavedROMBank:: ; cf08
  970. ; used as a storage value for the bank to return to after a BankswitchHome (bankswitch in homebank)
  971. ds 1
  972. wBankswitchHomeTemp:: ; cf09
  973. ; used as a temp storage value for the bank to switch to
  974. ds 1
  975. wBoughtOrSoldItemInMart:: ; cf0a
  976. ; 0 = nothing bought or sold in pokemart
  977. ; 1 = bought or sold something in pokemart
  978. ; this value is not used for anything
  979. ds 1
  980. wBattleResult:: ; cf0b
  981. ; $00 - win
  982. ; $01 - lose
  983. ; $02 - draw
  984. ds 1
  985. wAutoTextBoxDrawingControl:: ; cf0c
  986. ; bit 0: if set, DisplayTextID automatically draws a text box
  987. ds 1
  988. wcf0d:: ds 1 ; used with some overworld scripts (not exactly sure what it's used for)
  989. wTilePlayerStandingOn:: ; cf0e
  990. ; used in CheckForTilePairCollisions2 to store the tile the player is on
  991. ds 1
  992. wNPCNumScriptedSteps:: ds 1 ; cf0f
  993. wNPCMovementScriptFunctionNum:: ; cf10
  994. ; which script function within the pointer table indicated by
  995. ; wNPCMovementScriptPointerTableNum
  996. ds 1
  997. wTextPredefFlag:: ; cf11
  998. ; bit 0: set when printing a text predef so that DisplayTextID doesn't switch
  999. ; to the current map's bank
  1000. ds 1
  1001. wPredefParentBank:: ; cf12
  1002. ds 1
  1003. wSpriteIndex:: ds 1
  1004. wCurSpriteMovement2:: ; cf14
  1005. ; movement byte 2 of current sprite
  1006. ds 1
  1007. ds 2
  1008. wNPCMovementScriptSpriteOffset:: ; cf17
  1009. ; sprite offset of sprite being controlled by NPC movement script
  1010. ds 1
  1011. wScriptedNPCWalkCounter:: ; cf18
  1012. ds 1
  1013. ds 1
  1014. wGBC:: ; cf1a
  1015. ds 1
  1016. wOnSGB:: ; cf1b
  1017. ; if running on SGB, it's 1, else it's 0
  1018. ds 1
  1019. wDefaultPaletteCommand:: ; cf1c
  1020. ds 1
  1021. wPlayerHPBarColor:: ; cf1d
  1022. wWholeScreenPaletteMonSpecies:: ; cf1d
  1023. ; species of the mon whose palette is used for the whole screen
  1024. ds 1
  1025. wEnemyHPBarColor:: ; cf1e
  1026. ds 1
  1027. ; 0: green
  1028. ; 1: yellow
  1029. ; 2: red
  1030. wPartyMenuHPBarColors:: ; cf1f
  1031. ds 6
  1032. wStatusScreenHPBarColor:: ; cf25
  1033. ds 1
  1034. ds 7
  1035. wCopyingSGBTileData:: ; cf2d
  1036. wWhichPartyMenuHPBar:: ; cf2d
  1037. wPalPacket:: ; cf2d
  1038. ds 1
  1039. wPartyMenuBlkPacket:: ; cf2e
  1040. ; $30 bytes
  1041. ds 29
  1042. wExpAmountGained:: ; cf4b
  1043. ; 2-byte big-endian number
  1044. ; the total amount of exp a mon gained
  1045. wcf4b:: ds 2 ; storage buffer for various strings
  1046. wGainBoostedExp:: ; cf4d
  1047. ds 1
  1048. ds 17
  1049. wGymCityName:: ; cf5f
  1050. ds 17
  1051. wGymLeaderName:: ; cf70
  1052. ds NAME_LENGTH
  1053. wItemList:: ; cf7b
  1054. ds 16
  1055. wListPointer:: ; cf8b
  1056. ds 2
  1057. wUnusedCF8D:: ; cf8d
  1058. ; 2 bytes
  1059. ; used to store pointers, but never read
  1060. ds 2
  1061. wItemPrices:: ; cf8f
  1062. ds 2
  1063. wcf91:: ds 1 ; used with a lot of things (too much to list here)
  1064. wWhichPokemon:: ; cf92
  1065. ; which pokemon you selected
  1066. ds 1
  1067. wPrintItemPrices:: ; cf93
  1068. ; if non-zero, then print item prices when displaying lists
  1069. ds 1
  1070. wHPBarType:: ; cf94
  1071. ; type of HP bar
  1072. ; $00 = enemy HUD in battle
  1073. ; $01 = player HUD in battle / status screen
  1074. ; $02 = party menu
  1075. wListMenuID:: ; cf94
  1076. ; ID used by DisplayListMenuID
  1077. ds 1
  1078. wRemoveMonFromBox:: ; cf95
  1079. ; if non-zero, RemovePokemon will remove the mon from the current box,
  1080. ; else it will remove the mon from the party
  1081. wMoveMonType:: ; cf95
  1082. ; 0 = move from box to party
  1083. ; 1 = move from party to box
  1084. ; 2 = move from daycare to party
  1085. ; 3 = move from party to daycare
  1086. ds 1
  1087. wItemQuantity:: ; cf96
  1088. ds 1
  1089. wMaxItemQuantity:: ; cf97
  1090. ds 1
  1091. ; LoadMonData copies mon data here
  1092. wLoadedMon:: party_struct wLoadedMon ; cf98
  1093. wFontLoaded:: ; cfc4
  1094. ; bit 0: The space in VRAM that is used to store walk animation tile patterns
  1095. ; for the player and NPCs is in use for font tile patterns.
  1096. ; This means that NPC movement must be disabled.
  1097. ; The other bits are unused.
  1098. ds 1
  1099. wWalkCounter:: ; cfc5
  1100. ; walk animation counter
  1101. ds 1
  1102. wTileInFrontOfPlayer:: ; cfc6
  1103. ; background tile number in front of the player (either 1 or 2 steps ahead)
  1104. ds 1
  1105. wAudioFadeOutControl:: ; cfc7
  1106. ; The desired fade counter reload value is stored here prior to calling
  1107. ; PlaySound in order to cause the current music to fade out before the new
  1108. ; music begins playing. Storing 0 causes no fade out to occur and the new music
  1109. ; to begin immediately.
  1110. ; This variable has another use related to fade-out, as well. PlaySound stores
  1111. ; the sound ID of the music that should be played after the fade-out is finished
  1112. ; in this variable. FadeOutAudio checks if it's non-zero every V-Blank and
  1113. ; fades out the current audio if it is. Once it has finished fading out the
  1114. ; audio, it zeroes this variable and starts playing the sound ID stored in it.
  1115. ds 1
  1116. wAudioFadeOutCounterReloadValue:: ; cfc8
  1117. ds 1
  1118. wAudioFadeOutCounter:: ; cfc9
  1119. ds 1
  1120. wLastMusicSoundID:: ; cfca
  1121. ; This is used to determine whether the default music is already playing when
  1122. ; attempting to play the default music (in order to avoid restarting the same
  1123. ; music) and whether the music has already been stopped when attempting to
  1124. ; fade out the current music (so that the new music can be begin immediately
  1125. ; instead of waiting).
  1126. ; It sometimes contains the sound ID of the last music played, but it may also
  1127. ; contain $ff (if the music has been stopped) or 0 (because some routines zero
  1128. ; it in order to prevent assumptions from being made about the current state of
  1129. ; the music).
  1130. ds 1
  1131. wUpdateSpritesEnabled:: ; cfcb
  1132. ; $00 = causes sprites to be hidden and the value to change to $ff
  1133. ; $01 = enabled
  1134. ; $ff = disabled
  1135. ; other values aren't used
  1136. ds 1
  1137. wEnemyMoveNum:: ; cfcc
  1138. ds 1
  1139. wEnemyMoveEffect:: ; cfcd
  1140. ds 1
  1141. wEnemyMovePower:: ; cfce
  1142. ds 1
  1143. wEnemyMoveType:: ; cfcf
  1144. ds 1
  1145. wEnemyMoveAccuracy:: ; cfd0
  1146. ds 1
  1147. wEnemyMoveMaxPP:: ; cfd1
  1148. ds 1
  1149. wPlayerMoveNum:: ; cfd2
  1150. ds 1
  1151. wPlayerMoveEffect:: ; cfd3
  1152. ds 1
  1153. wPlayerMovePower:: ; cfd4
  1154. ds 1
  1155. wPlayerMoveType:: ; cfd5
  1156. ds 1
  1157. wPlayerMoveAccuracy:: ; cfd6
  1158. ds 1
  1159. wPlayerMoveMaxPP:: ; cfd7
  1160. ds 1
  1161. wEnemyMonSpecies2:: ; cfd8
  1162. ds 1
  1163. wBattleMonSpecies2:: ; cfd9
  1164. ds 1
  1165. wEnemyMonNick:: ds NAME_LENGTH ; cfda
  1166. wEnemyMon:: battle_struct wEnemyMon ; cfe5
  1167. wEnemyMonBaseStats:: ds 5
  1168. wEnemyMonActualCatchRate:: ds 1
  1169. wEnemyMonBaseExp:: ds 1
  1170. wBattleMonNick:: ds NAME_LENGTH ; d009
  1171. wBattleMon:: battle_struct wBattleMon ; d014
  1172. wTrainerClass:: ; d031
  1173. ds 1
  1174. ds 1
  1175. wTrainerPicPointer:: ; d033
  1176. ds 2
  1177. ds 1
  1178. wTempMoveNameBuffer:: ; d036
  1179. wLearnMoveMonName:: ; d036
  1180. ; The name of the mon that is learning a move.
  1181. ds 16
  1182. wTrainerBaseMoney:: ; d046
  1183. ; 2-byte BCD number
  1184. ; money received after battle = base money × level of highest-level enemy mon
  1185. ds 2
  1186. wMissableObjectCounter:: ; d048
  1187. ds 1
  1188. ds 1
  1189. wTrainerName:: ; d04a
  1190. ; 13 bytes for the letters of the opposing trainer
  1191. ; the name is terminated with $50 with possible
  1192. ; unused trailing letters
  1193. ds 13
  1194. wIsInBattle:: ; d057
  1195. ; lost battle, this is -1
  1196. ; no battle, this is 0
  1197. ; wild battle, this is 1
  1198. ; trainer battle, this is 2
  1199. ds 1
  1200. wPartyGainExpFlags:: ; d058
  1201. ; flags that indicate which party members should be be given exp when GainExperience is called
  1202. flag_array 6
  1203. wCurOpponent:: ; d059
  1204. ; in a wild battle, this is the species of pokemon
  1205. ; in a trainer battle, this is the trainer class + 200
  1206. ds 1
  1207. wBattleType:: ; d05a
  1208. ; in normal battle, this is 0
  1209. ; in old man battle, this is 1
  1210. ; in safari battle, this is 2
  1211. ds 1
  1212. wDamageMultipliers:: ; d05b
  1213. ; bits 0-6: Effectiveness
  1214. ; $0 = immune
  1215. ; $5 = not very effective
  1216. ; $a = neutral
  1217. ; $14 = super-effective
  1218. ; bit 7: STAB
  1219. ds 1
  1220. wLoneAttackNo:: ; d05c
  1221. ; which entry in LoneAttacks to use
  1222. wGymLeaderNo:: ; d05c
  1223. ; it's actually the same thing as ^
  1224. ds 1
  1225. wTrainerNo:: ; d05d
  1226. ; which instance of [youngster, lass, etc] is this?
  1227. ds 1
  1228. wCriticalHitOrOHKO:: ; d05e
  1229. ; $00 = normal attack
  1230. ; $01 = critical hit
  1231. ; $02 = successful OHKO
  1232. ; $ff = failed OHKO
  1233. ds 1
  1234. wMoveMissed:: ; d05f
  1235. ds 1
  1236. wPlayerStatsToDouble:: ; d060
  1237. ; always 0
  1238. ds 1
  1239. wPlayerStatsToHalve:: ; d061
  1240. ; always 0
  1241. ds 1
  1242. wPlayerBattleStatus1:: ; d062
  1243. ; bit 0 - bide
  1244. ; bit 1 - thrash / petal dance
  1245. ; bit 2 - attacking multiple times (e.g. double kick)
  1246. ; bit 3 - flinch
  1247. ; bit 4 - charging up for attack
  1248. ; bit 5 - using multi-turn move (e.g. wrap)
  1249. ; bit 6 - invulnerable to normal attack (using fly/dig)
  1250. ; bit 7 - confusion
  1251. ds 1
  1252. wPlayerBattleStatus2:: ; d063
  1253. ; bit 0 - X Accuracy effect
  1254. ; bit 1 - protected by "mist"
  1255. ; bit 2 - focus energy effect
  1256. ; bit 4 - has a substitute
  1257. ; bit 5 - need to recharge
  1258. ; bit 6 - rage
  1259. ; bit 7 - leech seeded
  1260. ds 1
  1261. wPlayerBattleStatus3:: ; d064
  1262. ; bit 0 - toxic
  1263. ; bit 1 - light screen
  1264. ; bit 2 - reflect
  1265. ; bit 3 - transformed
  1266. ds 1
  1267. wEnemyStatsToDouble:: ; d065
  1268. ; always 0
  1269. ds 1
  1270. wEnemyStatsToHalve:: ; d066
  1271. ; always 0
  1272. ds 1
  1273. wEnemyBattleStatus1:: ; d067
  1274. ds 1
  1275. wEnemyBattleStatus2:: ; d068
  1276. ds 1
  1277. wEnemyBattleStatus3:: ; d069
  1278. ds 1
  1279. wPlayerNumAttacksLeft::
  1280. ; when the player is attacking multiple times, the number of attacks left
  1281. ds 1
  1282. wPlayerConfusedCounter:: ; d06b
  1283. ds 1
  1284. wPlayerToxicCounter:: ; d06c
  1285. ds 1
  1286. wPlayerDisabledMove:: ; d06d
  1287. ; high nibble: which move is disabled (1-4)
  1288. ; low nibble: disable turns left
  1289. ds 1
  1290. ds 1
  1291. wEnemyNumAttacksLeft:: ; d06f
  1292. ; when the enemy is attacking multiple times, the number of attacks left
  1293. ds 1
  1294. wEnemyConfusedCounter:: ; d070
  1295. ds 1
  1296. wEnemyToxicCounter:: ; d071
  1297. ds 1
  1298. wEnemyDisabledMove:: ; d072
  1299. ; high nibble: which move is disabled (1-4)
  1300. ; low nibble: disable turns left
  1301. ds 1
  1302. ds 1
  1303. wPlayerNumHits:: ; d074
  1304. ; number of hits by player in attacks like Double Slap, etc.
  1305. wPlayerBideAccumulatedDamage:: ; d074
  1306. ; the amount of damage accumulated by the player while biding (2 bytes)
  1307. wUnknownSerialCounter2:: ; d075
  1308. ; 2 bytes
  1309. ds 4
  1310. wEscapedFromBattle::
  1311. ; non-zero when an item or move that allows escape from battle was used
  1312. ds 1
  1313. wAmountMoneyWon:: ; d079
  1314. ; 3-byte BCD number
  1315. wObjectToHide:: ; d079
  1316. ds 1
  1317. wObjectToShow:: ; d07a
  1318. ds 1
  1319. ds 1
  1320. wDefaultMap:: ; d07c
  1321. ; the map you will start at when the debug bit is set
  1322. wMenuItemOffset:: ; d07c
  1323. wAnimationID:: ; d07c
  1324. ; ID number of the current battle animation
  1325. ds 1
  1326. wNamingScreenType:: ; d07d
  1327. wPartyMenuTypeOrMessageID:: ; d07d
  1328. wTempTilesetNumTiles:: ; d07d
  1329. ; temporary storage for the number of tiles in a tileset
  1330. ds 1
  1331. wSavedListScrollOffset:: ; d07e
  1332. ; used by the pokemart code to save the existing value of wListScrollOffset
  1333. ; so that it can be restored when the player is done with the pokemart NPC
  1334. ds 1
  1335. ds 2
  1336. ; base coordinates of frame block
  1337. wBaseCoordX:: ; d081
  1338. ds 1
  1339. wBaseCoordY:: ; d082
  1340. ds 1
  1341. ; low health alarm counter/enable
  1342. ; high bit = enable, others = timer to cycle frequencies
  1343. wLowHealthAlarm:: ds 1 ; d083
  1344. wFBTileCounter:: ; d084
  1345. ; counts how many tiles of the current frame block have been drawn
  1346. ds 1
  1347. wMovingBGTilesCounter2:: ; d085
  1348. ds 1
  1349. wSubAnimFrameDelay:: ; d086
  1350. ; duration of each frame of the current subanimation in terms of screen refreshes
  1351. ds 1
  1352. wSubAnimCounter:: ; d087
  1353. ; counts the number of subentries left in the current subanimation
  1354. ds 1
  1355. wSaveFileStatus:: ; d088
  1356. ; 1 = no save file or save file is corrupted
  1357. ; 2 = save file exists and no corruption has been detected
  1358. ds 1
  1359. wNumFBTiles:: ; d089
  1360. ; number of tiles in current battle animation frame block
  1361. ds 1
  1362. wFlashScreenLongCounter:: ; d08a
  1363. wSpiralBallsBaseY:: ; d08a
  1364. wFallingObjectMovementByte:: ; d08a
  1365. ; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8)
  1366. ; bit 7: direction; 0 = right, 1 = left
  1367. wNumShootingBalls:: ; d08a
  1368. wTradedMonMovingRight:: ; d08a
  1369. ; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
  1370. wOptionsInitialized:: ; d08a
  1371. wNewSlotMachineBallTile:: ; d08a
  1372. wCoordAdjustmentAmount:: ; d08a
  1373. ; how much to add to the X/Y coord
  1374. wUnusedD08A:: ; d08a
  1375. ds 1
  1376. wSpiralBallsBaseX:: ; d08b
  1377. wNumFallingObjects:: ; d08b
  1378. wSlideMonDelay:: ; d08b
  1379. wAnimCounter:: ; d08b
  1380. ; generic counter variable for various animations
  1381. wSubAnimTransform:: ; d08b
  1382. ; controls what transformations are applied to the subanimation
  1383. ; 01: flip horizontally and vertically
  1384. ; 02: flip horizontally and translate downwards 40 pixels
  1385. ; 03: translate base coordinates of frame blocks, but don't change their internal coordinates or flip their tiles
  1386. ; 04: reverse the subanimation
  1387. ds 1
  1388. wEndBattleWinTextPointer:: ; d08c
  1389. ds 2
  1390. wEndBattleLoseTextPointer:: ; d08e
  1391. ds 2
  1392. ds 2
  1393. wEndBattleTextRomBank:: ; d092
  1394. ds 1
  1395. ds 1
  1396. wSubAnimAddrPtr:: ; d094
  1397. ; the address _of the address_ of the current subanimation entry
  1398. ds 2
  1399. wSlotMachineAllowMatchesCounter:: ; d096
  1400. ; If non-zero, the allow matches flag is always set.
  1401. ; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is
  1402. ; the only way it can increase. Winning certain payout amounts will decrement it
  1403. ; or zero it.
  1404. wSubAnimSubEntryAddr:: ; d096
  1405. ; the address of the current subentry of the current subanimation
  1406. ds 2
  1407. ds 2
  1408. wOutwardSpiralTileMapPointer:: ; d09a
  1409. ds 1
  1410. wPartyMenuAnimMonEnabled:: ; d09b
  1411. wTownMapSpriteBlinkingEnabled:: ; d09b
  1412. ; non-zero when enabled. causes nest locations to blink on and off.
  1413. ; the town selection cursor will blink regardless of what this value is
  1414. wUnusedD09B:: ; d09b
  1415. ds 1
  1416. wFBDestAddr:: ; d09c
  1417. ; current destination address in OAM for frame blocks (big endian)
  1418. ds 2
  1419. wFBMode:: ; d09e
  1420. ; controls how the frame blocks are put together to form frames
  1421. ; specifically, after finishing drawing the frame block, the frame block's mode determines what happens
  1422. ; 00: clean OAM buffer and delay
  1423. ; 02: move onto the next frame block with no delay and no cleaning OAM buffer
  1424. ; 03: delay, but don't clean OAM buffer
  1425. ; 04: delay, without cleaning OAM buffer, and do not advance [wFBDestAddr], so that the next frame block will overwrite this one
  1426. ds 1
  1427. wLinkCableAnimBulgeToggle:: ; d09f
  1428. ; 0 = small
  1429. ; 1 = big
  1430. wIntroNidorinoBaseTile:: ; d09f
  1431. wOutwardSpiralCurrentDirection:: ; d09f
  1432. wDropletTile:: ; d09f
  1433. wNewTileBlockID:: ; d09f
  1434. wWhichBattleAnimTileset:: ; d09f
  1435. wSquishMonCurrentDirection:: ; d09f
  1436. ; 0 = left
  1437. ; 1 = right
  1438. wSlideMonUpBottomRowLeftTile:: ; d09f
  1439. ; the tile ID of the leftmost tile in the bottom row in AnimationSlideMonUp_
  1440. ds 1
  1441. wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank
  1442. wSpriteCurPosX:: ; d0a1
  1443. ds 1
  1444. wSpriteCurPosY:: ; d0a2
  1445. ds 1
  1446. wSpriteWidth:: ; d0a3
  1447. ds 1
  1448. wSpriteHeight:: ; d0a4
  1449. ds 1
  1450. wSpriteInputCurByte:: ; d0a5
  1451. ; current input byte
  1452. ds 1
  1453. wSpriteInputBitCounter:: ; d0a6
  1454. ; bit offset of last read input bit
  1455. ds 1
  1456. wSpriteOutputBitOffset:: ; d0a7; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
  1457. ; 3 -> XX000000 1st column
  1458. ; 2 -> 00XX0000 2nd column
  1459. ; 1 -> 0000XX00 3rd column
  1460. ; 0 -> 000000XX 4th column
  1461. ds 1
  1462. wSpriteLoadFlags:: ; d0a8
  1463. ; bit 0 determines used buffer (0 -> $a188, 1 -> $a310)
  1464. ; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation)
  1465. ds 1
  1466. wSpriteUnpackMode:: ; d0a9
  1467. ds 1
  1468. wSpriteFlipped:: ; d0aa
  1469. ds 1
  1470. wSpriteInputPtr:: ; d0ab
  1471. ; pointer to next input byte
  1472. ds 2
  1473. wSpriteOutputPtr:: ; d0ad
  1474. ; pointer to current output byte
  1475. ds 2
  1476. wSpriteOutputPtrCached:: ; d0af
  1477. ; used to revert pointer for different bit offsets
  1478. ds 2
  1479. wSpriteDecodeTable0Ptr:: ; d0b1
  1480. ; pointer to differential decoding table (assuming initial value 0)
  1481. ds 2
  1482. wSpriteDecodeTable1Ptr:: ; d0b3
  1483. ; pointer to differential decoding table (assuming initial value 1)
  1484. ds 2
  1485. wd0b5:: ds 1 ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things
  1486. wNameListType:: ; d0b6
  1487. ds 1
  1488. wPredefBank:: ; d0b7
  1489. ds 1
  1490. wMonHeader:: ; d0b8
  1491. wMonHIndex:: ; d0b8
  1492. ; In the ROM base stats data structure, this is the dex number, but it is
  1493. ; overwritten with the internal index number after the header is copied to WRAM.
  1494. ds 1
  1495. wMonHBaseStats:: ; d0b9
  1496. wMonHBaseHP:: ; d0b9
  1497. ds 1
  1498. wMonHBaseAttack:: ; d0ba
  1499. ds 1
  1500. wMonHBaseDefense:: ; d0bb
  1501. ds 1
  1502. wMonHBaseSpeed:: ; d0bc
  1503. ds 1
  1504. wMonHBaseSpecial:: ; d0bd
  1505. ds 1
  1506. wMonHTypes:: ; d0be
  1507. wMonHType1:: ; d0be
  1508. ds 1
  1509. wMonHType2:: ; d0bf
  1510. ds 1
  1511. wMonHCatchRate:: ; d0c0
  1512. ds 1
  1513. wMonHBaseEXP:: ; d0c1
  1514. ds 1
  1515. wMonHSpriteDim:: ; d0c2
  1516. ds 1
  1517. wMonHFrontSprite:: ; d0c3
  1518. ds 2
  1519. wMonHBackSprite:: ; d0c5
  1520. ds 2
  1521. wMonHMoves:: ; d0c7
  1522. ds NUM_MOVES
  1523. wMonHGrowthRate:: ; d0cb
  1524. ds 1
  1525. wMonHLearnset:: ; d0cc
  1526. ; bit field
  1527. flag_array 50 + 5
  1528. ds 1
  1529. wSavedTilesetType:: ; d0d4
  1530. ; saved at the start of a battle and then written back at the end of the battle
  1531. ds 1
  1532. ds 2
  1533. wDamage:: ; d0d7
  1534. ds 2
  1535. ds 2
  1536. wRepelRemainingSteps:: ; d0db
  1537. ds 1
  1538. wMoves:: ; d0dc
  1539. ; list of moves for FormatMovesString
  1540. ds 4
  1541. wMoveNum:: ; d0e0
  1542. ds 1
  1543. wMovesString:: ; d0e1
  1544. ds 56
  1545. wUnusedD119:: ; d119
  1546. ds 1
  1547. wWalkBikeSurfStateCopy:: ; d11a
  1548. ; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything
  1549. ds 1
  1550. wInitListType:: ; d11b
  1551. ; the type of list for InitList to init
  1552. ds 1
  1553. wCapturedMonSpecies:: ; d11c
  1554. ; 0 if no mon was captured
  1555. ds 1
  1556. wFirstMonsNotOutYet:: ; d11d
  1557. ; Non-zero when the first player mon and enemy mon haven't been sent out yet.
  1558. ; It prevents the game from asking if the player wants to choose another mon
  1559. ; when the enemy sends out their first mon and suppresses the "no will to fight"
  1560. ; message when the game searches for the first non-fainted mon in the party,
  1561. ; which will be the first mon sent out.
  1562. ds 1
  1563. wPokeBallCaptureCalcTemp:: ; d11e
  1564. ; lower nybble: number of shakes
  1565. ; upper nybble: number of animations to play
  1566. wPokeBallAnimData:: ; d11e
  1567. wUsingPPUp:: ; d11e
  1568. wMaxPP:: ; d11e
  1569. ; 0 for player, non-zero for enemy
  1570. wCalculateWhoseStats:: ; d11e
  1571. wTypeEffectiveness:: ; d11e
  1572. wMoveType:: ; d11e
  1573. wNumSetBits:: ; d11e
  1574. wd11e:: ds 1 ; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits
  1575. wForcePlayerToChooseMon:: ; d11f
  1576. ; When this value is non-zero, the player isn't allowed to exit the party menu
  1577. ; by pressing B and not choosing a mon.
  1578. ds 1
  1579. wNumRunAttempts::
  1580. ; number of times the player has tried to run from battle
  1581. ds 1
  1582. wEvolutionOccurred:: ; d121
  1583. ds 1
  1584. wVBlankSavedROMBank:: ; d122
  1585. ds 1
  1586. ds 1
  1587. wIsKeyItem:: ; d124
  1588. ds 1
  1589. wTextBoxID:: ; d125
  1590. ds 1
  1591. wCurrentMapScriptFlags:: ds 1 ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value
  1592. wCurEnemyLVL:: ; d127
  1593. ds 1
  1594. wItemListPointer:: ; d128
  1595. ; pointer to list of items terminated by $FF
  1596. ds 2
  1597. wListCount::
  1598. ; number of entries in a list
  1599. ds 1
  1600. wLinkState:: ; d12b
  1601. ds 1
  1602. wTwoOptionMenuID:: ; d12c
  1603. ds 1
  1604. wChosenMenuItem:: ; d12d
  1605. ; the id of the menu item the player ultimately chose
  1606. wOutOfBattleBlackout:: ; d12d
  1607. ; non-zero when the whole party has fainted due to out-of-battle poison damage
  1608. ds 1
  1609. wMenuExitMethod:: ; d12e
  1610. ; the way the user exited a menu
  1611. ; for list menus and the buy/sell/quit menu:
  1612. ; $01 = the user pressed A to choose a menu item
  1613. ; $02 = the user pressed B to cancel
  1614. ; for two-option menus:
  1615. ; $01 = the user pressed A with the first menu item selected
  1616. ; $02 = the user pressed B or pressed A with the second menu item selected
  1617. ds 1
  1618. wDungeonWarpDataEntrySize:: ; d12f
  1619. ; the size is always 6, so they didn't need a variable in RAM for this
  1620. wWhichPewterGuy:: ; d12f
  1621. ; 0 = museum guy
  1622. ; 1 = gym guy
  1623. wWhichPrizeWindow:: ; d12f
  1624. ; there are 3 windows, from 0 to 2
  1625. wGymGateTileBlock:: ; d12f
  1626. ; a horizontal or vertical gate block
  1627. ds 1
  1628. wSavedSpriteScreenY:: ; d130
  1629. ds 1
  1630. wSavedSpriteScreenX:: ; d131
  1631. ds 1
  1632. wSavedSpriteMapY:: ; d132
  1633. ds 1
  1634. wSavedSpriteMapX:: ; d133
  1635. ds 1
  1636. ds 5
  1637. wWhichPrize:: ; d139
  1638. ds 1
  1639. wIgnoreInputCounter:: ; d13a
  1640. ; counts downward each frame
  1641. ; when it hits 0, bit 5 (ignore input bit) of wd730 is reset
  1642. ds 1
  1643. wStepCounter:: ; d13b
  1644. ; counts down once every step
  1645. ds 1
  1646. wNumberOfNoRandomBattleStepsLeft:: ; d13c
  1647. ; after a battle, you have at least 3 steps before a random battle can occur
  1648. ds 1
  1649. wPrize1:: ; d13d
  1650. ds 1
  1651. wPrize2:: ; d13e
  1652. ds 1
  1653. wPrize3:: ; d13f
  1654. ds 1
  1655. ds 1
  1656. wSerialRandomNumberListBlock:: ; d141
  1657. ; the first 7 bytes are the preamble
  1658. wPrize1Price:: ; d141
  1659. ds 2
  1660. wPrize2Price:: ; d143
  1661. ds 2
  1662. wPrize3Price:: ; d145
  1663. ds 2
  1664. ds 1
  1665. wLinkBattleRandomNumberList:: ; d148
  1666. ; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex
  1667. ds 10
  1668. wSerialPlayerDataBlock:: ; d152
  1669. ; the first 6 bytes are the preamble
  1670. wPseudoItemID:: ; d152
  1671. ; When a real item is being used, this is 0.
  1672. ; When a move is acting as an item, this is the ID of the item it's acting as.
  1673. ; For example, out-of-battle Dig is executed using a fake Escape Rope item. In
  1674. ; that case, this would be ESCAPE_ROPE.
  1675. ds 1
  1676. wUnusedD153:: ; d153
  1677. ds 1
  1678. ds 2
  1679. wEvoStoneItemID:: ; d156
  1680. ds 1
  1681. wSavedNPCMovementDirections2Index:: ; d157
  1682. ds 1
  1683. wPlayerName:: ; d158
  1684. ds NAME_LENGTH
  1685. wPartyDataStart::
  1686. wPartyCount:: ds 1 ; d163
  1687. wPartySpecies:: ds PARTY_LENGTH ; d164
  1688. wPartyEnd:: ds 1 ; d16a
  1689. wPartyMons::
  1690. wPartyMon1:: party_struct wPartyMon1 ; d16b
  1691. wPartyMon2:: party_struct wPartyMon2 ; d197
  1692. wPartyMon3:: party_struct wPartyMon3 ; d1c3
  1693. wPartyMon4:: party_struct wPartyMon4 ; d1ef
  1694. wPartyMon5:: party_struct wPartyMon5 ; d21b
  1695. wPartyMon6:: party_struct wPartyMon6 ; d247
  1696. wPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d273
  1697. wPartyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d2b5
  1698. wPartyDataEnd::
  1699. wMainDataStart::
  1700. wPokedexOwned:: ; d2f7
  1701. flag_array NUM_POKEMON
  1702. wPokedexOwnedEnd::
  1703. wPokedexSeen:: ; d30a
  1704. flag_array NUM_POKEMON
  1705. wPokedexSeenEnd::
  1706. wNumBagItems:: ; d31d
  1707. ds 1
  1708. wBagItems:: ; d31e
  1709. ; item, quantity
  1710. ds BAG_ITEM_CAPACITY * 2
  1711. ds 1 ; end
  1712. wPlayerMoney:: ; d347
  1713. ds 3 ; BCD
  1714. wRivalName:: ; d34a
  1715. ds NAME_LENGTH
  1716. wOptions:: ; d355
  1717. ; bit 7 = battle animation
  1718. ; 0: On
  1719. ; 1: Off
  1720. ; bit 6 = battle style
  1721. ; 0: Shift
  1722. ; 1: Set
  1723. ; bits 0-3 = text speed (number of frames to delay after printing a letter)
  1724. ; 1: Fast
  1725. ; 3: Medium
  1726. ; 5: Slow
  1727. ds 1
  1728. wObtainedBadges:: ; d356
  1729. flag_array 8
  1730. ds 1
  1731. wLetterPrintingDelayFlags:: ; d358
  1732. ; bit 0: If 0, limit the delay to 1 frame. Note that this has no effect if
  1733. ; the delay has been disabled entirely through bit 1 of this variable
  1734. ; or bit 6 of wd730.
  1735. ; bit 1: If 0, no delay.
  1736. ds 1
  1737. wPlayerID:: ; d359
  1738. ds 2
  1739. wMapMusicSoundID:: ; d35b
  1740. ds 1
  1741. wMapMusicROMBank:: ; d35c
  1742. ds 1
  1743. wMapPalOffset:: ; d35d
  1744. ; offset subtracted from FadePal4 to get the background and object palettes for the current map
  1745. ; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4
  1746. ds 1
  1747. wCurMap:: ; d35e
  1748. ds 1
  1749. wCurrentTileBlockMapViewPointer:: ; d35f
  1750. ; pointer to the upper left corner of the current view in the tile block map
  1751. ds 2
  1752. wYCoord:: ; d361
  1753. ; player’s position on the current map
  1754. ds 1
  1755. wXCoord:: ; d362
  1756. ds 1
  1757. wYBlockCoord:: ; d363
  1758. ; player's y position (by block)
  1759. ds 1
  1760. wXBlockCoord:: ; d364
  1761. ds 1
  1762. wLastMap:: ; d365
  1763. ds 1
  1764. wUnusedD366:: ; d366
  1765. ds 1
  1766. wCurMapTileset:: ; d367
  1767. ds 1
  1768. wCurMapHeight:: ; d368
  1769. ; blocks
  1770. ds 1
  1771. wCurMapWidth:: ; d369
  1772. ; blocks
  1773. ds 1
  1774. wMapDataPtr:: ; d36a
  1775. ds 2
  1776. wMapTextPtr:: ; d36c
  1777. ds 2
  1778. wMapScriptPtr:: ; d36e
  1779. ds 2
  1780. wMapConnections:: ; d370
  1781. ; connection byte
  1782. ds 1
  1783. wMapConn1Ptr:: ; d371
  1784. ds 1
  1785. wNorthConnectionStripSrc:: ; d372
  1786. ds 2
  1787. wNorthConnectionStripDest:: ; d374
  1788. ds 2
  1789. wNorthConnectionStripWidth:: ; d376
  1790. ds 1
  1791. wNorthConnectedMapWidth:: ; d377
  1792. ds 1
  1793. wNorthConnectedMapYAlignment:: ; d378
  1794. ds 1
  1795. wNorthConnectedMapXAlignment:: ; d379
  1796. ds 1
  1797. wNorthConnectedMapViewPointer:: ; d37a
  1798. ds 2
  1799. wMapConn2Ptr:: ; d37c
  1800. ds 1
  1801. wSouthConnectionStripSrc:: ; d37d
  1802. ds 2
  1803. wSouthConnectionStripDest:: ; d37f:
  1804. ds 2
  1805. wSouthConnectionStripWidth:: ; d381
  1806. ds 1
  1807. wSouthConnectedMapWidth:: ; d382
  1808. ds 1
  1809. wSouthConnectedMapYAlignment:: ; d383
  1810. ds 1
  1811. wSouthConnectedMapXAlignment:: ; d384
  1812. ds 1
  1813. wSouthConnectedMapViewPointer:: ; d385
  1814. ds 2
  1815. wMapConn3Ptr:: ; d387
  1816. ds 1
  1817. wWestConnectionStripSrc:: ; d388
  1818. ds 2
  1819. wWestConnectionStripDest:: ; d38a
  1820. ds 2
  1821. wWestConnectionStripHeight:: ; d38c
  1822. ds 1
  1823. wWestConnectedMapWidth:: ; d38d
  1824. ds 1
  1825. wWestConnectedMapYAlignment:: ; d38e
  1826. ds 1
  1827. wWestConnectedMapXAlignment:: ; d38f
  1828. ds 1
  1829. wWestConnectedMapViewPointer:: ; d390
  1830. ds 2
  1831. wMapConn4Ptr:: ; d392
  1832. ds 1
  1833. wEastConnectionStripSrc:: ; d393
  1834. ds 2
  1835. wEastConnectionStripDest:: ; d395
  1836. ds 2
  1837. wEastConnectionStripHeight:: ; d397
  1838. ds 1
  1839. wEastConnectedMapWidth:: ; d398
  1840. ds 1
  1841. wEastConnectedMapYAlignment:: ; d399
  1842. ds 1
  1843. wEastConnectedMapXAlignment:: ; d39a
  1844. ds 1
  1845. wEastConnectedMapViewPointer:: ; d39b
  1846. ds 2
  1847. wSpriteSet:: ; d39d
  1848. ; sprite set for the current map (11 sprite picture ID's)
  1849. ds 11
  1850. wSpriteSetID:: ; d3a8
  1851. ; sprite set ID for the current map
  1852. ds 1
  1853. wObjectDataPointerTemp:: ; d3a9
  1854. ds 2
  1855. ds 2
  1856. wMapBackgroundTile:: ; d3ad
  1857. ; the tile shown outside the boundaries of the map
  1858. ds 1
  1859. wNumberOfWarps:: ; d3ae
  1860. ; number of warps in current map
  1861. ds 1
  1862. wWarpEntries:: ; d3af
  1863. ; current map warp entries
  1864. ds 128
  1865. wDestinationWarpID:: ; d42f
  1866. ; if $ff, the player's coordinates are not updated when entering the map
  1867. ds 1
  1868. ds 128
  1869. wNumSigns:: ; d4b0
  1870. ; number of signs in the current map (up to 16)
  1871. ds 1
  1872. wSignCoords:: ; d4b1
  1873. ; 2 bytes each
  1874. ; Y, X
  1875. ds 32
  1876. wSignTextIDs:: ; d4d1
  1877. ds 16
  1878. wNumSprites:: ; d4e1
  1879. ; number of sprites on the current map
  1880. ds 1
  1881. ; these two variables track the X and Y offset in blocks from the last special warp used
  1882. ; they don't seem to be used for anything
  1883. wYOffsetSinceLastSpecialWarp:: ; d4e2
  1884. ds 1
  1885. wXOffsetSinceLastSpecialWarp:: ; d4e3
  1886. ds 1
  1887. wMapSpriteData:: ; d4e4
  1888. ; two bytes per sprite (movement byte 2, text ID)
  1889. ds 32
  1890. wMapSpriteExtraData:: ; d504
  1891. ; two bytes per sprite (trainer class/item ID, trainer set ID)
  1892. ds 32
  1893. wCurrentMapHeight2:: ; d524
  1894. ; map height in 2x2 meta-tiles
  1895. ds 1
  1896. wCurrentMapWidth2:: ; d525
  1897. ; map width in 2x2 meta-tiles
  1898. ds 1
  1899. wMapViewVRAMPointer:: ; d526
  1900. ; the address of the upper left corner of the visible portion of the BG tile map in VRAM
  1901. ds 2
  1902. ; In the comments for the player direction variables below, "moving" refers to
  1903. ; both walking and changing facing direction without taking a step.
  1904. wPlayerMovingDirection:: ; d528
  1905. ; if the player is moving, the current direction
  1906. ; if the player is not moving, zero
  1907. ; map scripts write to this in order to change the player's facing direction
  1908. ds 1
  1909. wPlayerLastStopDirection:: ; d529
  1910. ; the direction in which the player was moving before the player last stopped
  1911. ds 1
  1912. wPlayerDirection:: ; d52a
  1913. ; if the player is moving, the current direction
  1914. ; if the player is not moving, the last the direction in which the player moved
  1915. ds 1
  1916. wTilesetBank:: ; d52b
  1917. ds 1
  1918. wTilesetBlocksPtr:: ; d52c
  1919. ; maps blocks (4x4 tiles) to tiles
  1920. ds 2
  1921. wTilesetGfxPtr:: ; d52e
  1922. ds 2
  1923. wTilesetCollisionPtr:: ; d530
  1924. ; list of all walkable tiles
  1925. ds 2
  1926. wTilesetTalkingOverTiles:: ; d532
  1927. ds 3
  1928. wGrassTile:: ; d535
  1929. ds 1
  1930. ds 4
  1931. wNumBoxItems:: ; d53a
  1932. ds 1
  1933. wBoxItems:: ; d53b
  1934. ; item, quantity
  1935. ds PC_ITEM_CAPACITY * 2
  1936. ds 1 ; end
  1937. wCurrentBoxNum:: ; d5a0
  1938. ; bits 0-6: box number
  1939. ; bit 7: whether the player has changed boxes before
  1940. ds 2
  1941. wNumHoFTeams:: ; d5a2
  1942. ; number of HOF teams
  1943. ds 1
  1944. wUnusedD5A3:: ; d5a3
  1945. ds 1
  1946. wPlayerCoins:: ; d5a4
  1947. ds 2 ; BCD
  1948. wMissableObjectFlags:: ; d5a6
  1949. ; bit array of missable objects. set = removed
  1950. ds 32
  1951. wMissableObjectFlagsEnd::
  1952. ds 7
  1953. wd5cd:: ds 1 ; temp copy of c1x2 (sprite facing/anim)
  1954. wMissableObjectList:: ; d5ce
  1955. ; each entry consists of 2 bytes
  1956. ; * the sprite ID (depending on the current map)
  1957. ; * the missable object index (global, used for wMissableObjectFlags)
  1958. ; terminated with $FF
  1959. ds 17 * 2
  1960. wGameProgressFlags:: ; d5f0
  1961. ; $c8 bytes
  1962. ds 0
  1963. wOaksLabCurScript:: ; d5f0
  1964. ds 1
  1965. wPalletTownCurScript:: ; d5f1
  1966. ds 1
  1967. ds 1
  1968. wBluesHouseCurScript:: ; d5f3
  1969. ds 1
  1970. wViridianCityCurScript:: ; d5f4
  1971. ds 1
  1972. ds 2
  1973. wPewterCityCurScript:: ; d5f7
  1974. ds 1
  1975. wRoute3CurScript:: ; d5f8
  1976. ds 1
  1977. wRoute4CurScript:: ; d5f9
  1978. ds 1
  1979. ds 1
  1980. wViridianGymCurScript:: ; d5fb
  1981. ds 1
  1982. wPewterGymCurScript:: ; d5fc
  1983. ds 1
  1984. wCeruleanGymCurScript:: ; d5fd
  1985. ds 1
  1986. wVermilionGymCurScript:: ; d5fe
  1987. ds 1
  1988. wCeladonGymCurScript:: ; d5ff
  1989. ds 1
  1990. wRoute6CurScript:: ; d600
  1991. ds 1
  1992. wRoute8CurScript:: ; d601
  1993. ds 1
  1994. wRoute24CurScript:: ; d602
  1995. ds 1
  1996. wRoute25CurScript:: ; d603
  1997. ds 1
  1998. wRoute9CurScript:: ; d604
  1999. ds 1
  2000. wRoute10CurScript:: ; d605
  2001. ds 1
  2002. wMtMoon1CurScript:: ; d606
  2003. ds 1
  2004. wMtMoon3CurScript:: ; d607
  2005. ds 1
  2006. wSSAnne8CurScript:: ; d608
  2007. ds 1
  2008. wSSAnne9CurScript:: ; d609
  2009. ds 1
  2010. wRoute22CurScript:: ; d60a
  2011. ds 1
  2012. ds 1
  2013. wRedsHouse2CurScript:: ; d60c
  2014. ds 1
  2015. wViridianMarketCurScript:: ; d60d
  2016. ds 1
  2017. wRoute22GateCurScript:: ; d60e
  2018. ds 1
  2019. wCeruleanCityCurScript:: ; d60f
  2020. ds 1
  2021. ds 7
  2022. wSSAnne5CurScript:: ; d617
  2023. ds 1
  2024. wViridianForestCurScript:: ; d618
  2025. ds 1
  2026. wMuseum1fCurScript:: ; d619
  2027. ds 1
  2028. wRoute13CurScript:: ; d61a
  2029. ds 1
  2030. wRoute14CurScript:: ; d61b
  2031. ds 1
  2032. wRoute17CurScript:: ; d61c
  2033. ds 1
  2034. wRoute19CurScript:: ; d61d
  2035. ds 1
  2036. wRoute21CurScript:: ; d61e
  2037. ds 1
  2038. wSafariZoneEntranceCurScript:: ; d61f
  2039. ds 1
  2040. wRockTunnel2CurScript:: ; d620
  2041. ds 1
  2042. wRockTunnel1CurScript:: ; d621
  2043. ds 1
  2044. ds 1
  2045. wRoute11CurScript:: ; d623
  2046. ds 1
  2047. wRoute12CurScript:: ; d624
  2048. ds 1
  2049. wRoute15CurScript:: ; d625
  2050. ds 1
  2051. wRoute16CurScript:: ; d626
  2052. ds 1
  2053. wRoute18CurScript:: ; d627
  2054. ds 1
  2055. wRoute20CurScript:: ; d628
  2056. ds 1
  2057. wSSAnne10CurScript:: ; d629
  2058. ds 1
  2059. wVermilionCityCurScript:: ; d62a
  2060. ds 1
  2061. wPokemonTower2CurScript:: ; d62b
  2062. ds 1
  2063. wPokemonTower3CurScript:: ; d62c
  2064. ds 1
  2065. wPokemonTower4CurScript:: ; d62d
  2066. ds 1
  2067. wPokemonTower5CurScript:: ; d62e
  2068. ds 1
  2069. wPokemonTower6CurScript:: ; d62f
  2070. ds 1
  2071. wPokemonTower7CurScript:: ; d630
  2072. ds 1
  2073. wRocketHideout1CurScript:: ; d631
  2074. ds 1
  2075. wRocketHideout2CurScript:: ; d632
  2076. ds 1
  2077. wRocketHideout3CurScript:: ; d633
  2078. ds 1
  2079. wRocketHideout4CurScript:: ; d634
  2080. ds 2
  2081. wRoute6GateCurScript:: ; d636
  2082. ds 1
  2083. wRoute8GateCurScript:: ; d637
  2084. ds 2
  2085. wCinnabarIslandCurScript:: ; d639
  2086. ds 1
  2087. wMansion1CurScript:: ; d63a
  2088. ds 2
  2089. wMansion2CurScript:: ; d63c
  2090. ds 1
  2091. wMansion3CurScript:: ; d63d
  2092. ds 1
  2093. wMansion4CurScript:: ; d63e
  2094. ds 1
  2095. wVictoryRoad2CurScript:: ; d63f
  2096. ds 1
  2097. wVictoryRoad3CurScript:: ; d640
  2098. ds 2
  2099. wFightingDojoCurScript:: ; d642
  2100. ds 1
  2101. wSilphCo2CurScript:: ; d643
  2102. ds 1
  2103. wSilphCo3CurScript:: ; d644
  2104. ds 1
  2105. wSilphCo4CurScript:: ; d645
  2106. ds 1
  2107. wSilphCo5CurScript:: ; d646
  2108. ds 1
  2109. wSilphCo6CurScript:: ; d647
  2110. ds 1
  2111. wSilphCo7CurScript:: ; d648
  2112. ds 1
  2113. wSilphCo8CurScript:: ; d649
  2114. ds 1
  2115. wSilphCo9CurScript:: ; d64a
  2116. ds 1
  2117. wHallOfFameRoomCurScript:: ; d64b
  2118. ds 1
  2119. wGaryCurScript:: ; d64c
  2120. ds 1
  2121. wLoreleiCurScript:: ; d64d
  2122. ds 1
  2123. wBrunoCurScript:: ; d64e
  2124. ds 1
  2125. wAgathaCurScript:: ; d64f
  2126. ds 1
  2127. wUnknownDungeon3CurScript:: ; d650
  2128. ds 1
  2129. wVictoryRoad1CurScript:: ; d651
  2130. ds 1
  2131. ds 1
  2132. wLanceCurScript:: ; d653
  2133. ds 1
  2134. ds 4
  2135. wSilphCo10CurScript:: ; d658
  2136. ds 1
  2137. wSilphCo11CurScript:: ; d659
  2138. ds 1
  2139. ds 1
  2140. wFuchsiaGymCurScript:: ; d65b
  2141. ds 1
  2142. wSaffronGymCurScript:: ; d65c
  2143. ds 1
  2144. ds 1
  2145. wCinnabarGymCurScript:: ; d65e
  2146. ds 1
  2147. wCeladonGameCornerCurScript:: ; d65f
  2148. ds 1
  2149. wRoute16GateCurScript:: ; d660
  2150. ds 1
  2151. wBillsHouseCurScript:: ; d661
  2152. ds 1
  2153. wRoute5GateCurScript:: ; d662
  2154. ds 1
  2155. wPowerPlantCurScript:: ; d663
  2156. ; overload
  2157. ds 0
  2158. wRoute7GateCurScript:: ; d663
  2159. ; overload
  2160. ds 1
  2161. ds 1
  2162. wSSAnne2CurScript:: ; d665
  2163. ds 1
  2164. wSeafoamIslands4CurScript:: ; d666
  2165. ds 1
  2166. wRoute23CurScript:: ; d667
  2167. ds 1
  2168. wSeafoamIslands5CurScript:: ; d668
  2169. ds 1
  2170. wRoute18GateCurScript:: ; d669
  2171. ds 1
  2172. ds 78
  2173. wGameProgressFlagsEnd::
  2174. ds 56
  2175. wObtainedHiddenItemsFlags::
  2176. ds 14
  2177. wObtainedHiddenCoinsFlags::
  2178. ds 2
  2179. wWalkBikeSurfState:: ; d700
  2180. ; $00 = walking
  2181. ; $01 = biking
  2182. ; $02 = surfing
  2183. ds 1
  2184. ds 10
  2185. wTownVisitedFlag:: ; d70b
  2186. flag_array 13
  2187. wSafariSteps:: ; d70d
  2188. ; starts at 502
  2189. ds 2
  2190. wFossilItem:: ; d70f
  2191. ; item given to cinnabar lab
  2192. ds 1
  2193. wFossilMon:: ; d710
  2194. ; mon that will result from the item
  2195. ds 1
  2196. ds 2
  2197. wEnemyMonOrTrainerClass:: ; d713
  2198. ; trainer classes start at 200
  2199. ds 1
  2200. wPlayerJumpingYScreenCoordsIndex:: ; d714
  2201. ds 1
  2202. wRivalStarter:: ; d715
  2203. ds 1
  2204. ds 1
  2205. wPlayerStarter:: ; d717
  2206. ds 1
  2207. wBoulderSpriteIndex:: ; d718
  2208. ; sprite index of the boulder the player is trying to push
  2209. ds 1
  2210. wLastBlackoutMap:: ; d719
  2211. ds 1
  2212. wDestinationMap:: ; d71a
  2213. ; destination map (for certain types of special warps, not ordinary walking)
  2214. ds 1
  2215. wUnusedD71B:: ; d71b
  2216. ds 1
  2217. wTileInFrontOfBoulderAndBoulderCollisionResult:: ; d71c
  2218. ; used to store the tile in front of the boulder when trying to push a boulder
  2219. ; also used to store the result of the collision check ($ff for a collision and $00 for no collision)
  2220. ds 1
  2221. wDungeonWarpDestinationMap:: ; d71d
  2222. ; destination map for dungeon warps
  2223. ds 1
  2224. wWhichDungeonWarp:: ; d71e
  2225. ; which dungeon warp within the source map was used
  2226. ds 1
  2227. wUnusedD71F:: ; d71f
  2228. ds 1
  2229. ds 8
  2230. wd728:: ; d728
  2231. ; bit 0: using Strength outside of battle
  2232. ; bit 1: set by IsSurfingAllowed when surfing's allowed, but the caller resets it after checking the result
  2233. ; bit 3: received Old Rod
  2234. ; bit 4: received Good Rod
  2235. ; bit 5: received Super Rod
  2236. ; bit 6: gave one of the Saffron guards a drink
  2237. ; bit 7: set by ItemUseCardKey, which is leftover code from a previous implementation of the Card Key
  2238. ds 1
  2239. ds 1
  2240. wBeatGymFlags:: ; d72a
  2241. ; redundant because it matches wObtainedBadges
  2242. ; used to determine whether to show name on statue and in two NPC text scripts
  2243. ds 1
  2244. ds 1
  2245. wd72c:: ; d72c
  2246. ; bit 0: if not set, the 3 minimum steps between random battles have passed
  2247. ; bit 1: prevent audio fade out
  2248. ds 1
  2249. wd72d:: ; d72d
  2250. ; This variable is used for temporary flags and as the destination map when
  2251. ; warping to the Trade Center or Colosseum.
  2252. ; bit 0: sprite facing directions have been initialised in the Trade Center
  2253. ; bit 3: do scripted warp (used to warp back to Lavender Town from the top of the pokemon tower)
  2254. ; bit 4: on a dungeon warp
  2255. ; bit 5: don't make NPCs face the player when spoken to
  2256. ; Bits 6 and 7 are set by scripts when starting major battles in the storyline,
  2257. ; but they do not appear to affect anything. Bit 6 is reset after all battles
  2258. ; and bit 7 is reset after trainer battles (but it's only set before trainer
  2259. ; battles anyway).
  2260. ds 1
  2261. wd72e:: ; d72e
  2262. ; bit 0: the player has received Lapras in the Silph Co. building
  2263. ; bit 1: set in various places, but doesn't appear to have an effect
  2264. ; bit 2: the player has healed pokemon at a pokemon center at least once
  2265. ; bit 3: the player has a received a pokemon from Prof. Oak
  2266. ; bit 4: disable battles
  2267. ; bit 5: set when a battle ends and when the player blacks out in the overworld due to poison
  2268. ; bit 6: using the link feature
  2269. ; bit 7: set if scripted NPC movement has been initialised
  2270. ds 1
  2271. ds 1
  2272. wd730:: ; d730
  2273. ; bit 0: NPC sprite being moved by script
  2274. ; bit 5: ignore joypad input
  2275. ; bit 6: print text with no delay between each letter
  2276. ; bit 7: set if joypad states are being simulated in the overworld or an NPC's movement is being scripted
  2277. ds 1
  2278. ds 1
  2279. wd732:: ; d732
  2280. ; bit 0: play time being counted
  2281. ; bit 1: remnant of debug mode? not set by the game code.
  2282. ; if it is set
  2283. ; 1. skips most of Prof. Oak's speech, and uses NINTEN as the player's name and SONY as the rival's name
  2284. ; 2. does not have the player start in floor two of the player's house (instead sending them to [wLastMap])
  2285. ; 3. allows wild battles to be avoided by holding down B
  2286. ; bit 2: the target warp is a fly warp (bit 3 set or blacked out) or a dungeon warp (bit 4 set)
  2287. ; bit 3: used warp pad, escape rope, dig, teleport, or fly, so the target warp is a "fly warp"
  2288. ; bit 4: jumped into hole (Pokemon Mansion, Seafoam Islands, Victory Road) or went down waterfall (Seafoam Islands), so the target warp is a "dungeon warp"
  2289. ; bit 5: currently being forced to ride bike (cycling road)
  2290. ; bit 6: map destination is [wLastBlackoutMap] (usually the last used pokemon center, but could be the player's house)
  2291. ds 1
  2292. wFlags_D733:: ; d733
  2293. ; bit 0: running a test battle
  2294. ; bit 1: prevent music from changing when entering new map
  2295. ; bit 2: skip the joypad check in CheckWarpsNoCollision (used for the forced warp down the waterfall in the Seafoam Islands)
  2296. ; bit 3: trainer wants to battle
  2297. ; bit 4: use variable [wCurMapScript] instead of the provided index for next frame's map script (used to start battle when talking to trainers)
  2298. ; bit 7: used fly out of battle
  2299. ds 1
  2300. wBeatLorelei:: ; d734
  2301. ; bit 1: set when you beat Lorelei and reset in Indigo Plateau lobby
  2302. ; the game uses this to tell when Elite 4 events need to be reset
  2303. ds 2
  2304. wd736:: ; d736
  2305. ; bit 0: check if the player is standing on a door and make him walk down a step if so
  2306. ; bit 1: the player is currently stepping down from a door
  2307. ; bit 2: standing on a warp
  2308. ; bit 6: jumping down a ledge / fishing animation
  2309. ; bit 7: player sprite spinning due to spin tiles (Rocket hideout / Viridian Gym)
  2310. ds 1
  2311. wCompletedInGameTradeFlags:: ; d737
  2312. ds 2
  2313. ds 2
  2314. wWarpedFromWhichWarp:: ; d73b
  2315. ds 1
  2316. wWarpedFromWhichMap:: ; d73c
  2317. ds 1
  2318. ds 2
  2319. wCardKeyDoorY:: ; d73f
  2320. ds 1
  2321. wCardKeyDoorX:: ; d740
  2322. ds 1
  2323. ds 2
  2324. wFirstLockTrashCanIndex:: ; d743
  2325. ds 1
  2326. wSecondLockTrashCanIndex:: ; d743
  2327. ds 1
  2328. ds 2
  2329. wEventFlags:: ; d747
  2330. ds 320
  2331. wLinkEnemyTrainerName:: ; d887
  2332. ; linked game's trainer name
  2333. wGrassRate:: ; d887
  2334. ds 1
  2335. wGrassMons:: ; d888
  2336. ;ds 20
  2337. ds 11
  2338. ; Overload wGrassMons
  2339. wSerialEnemyDataBlock:: ; d893
  2340. ds 9
  2341. wEnemyPartyCount:: ds 1 ; d89c
  2342. wEnemyPartyMons:: ds PARTY_LENGTH + 1 ; d89d
  2343. ; Overload enemy party data
  2344. UNION
  2345. wWaterRate:: db ; d8a4
  2346. wWaterMons:: db ; d8a5
  2347. NEXTU
  2348. wEnemyMons:: ; d8a4
  2349. wEnemyMon1:: party_struct wEnemyMon1
  2350. wEnemyMon2:: party_struct wEnemyMon2
  2351. wEnemyMon3:: party_struct wEnemyMon3
  2352. wEnemyMon4:: party_struct wEnemyMon4
  2353. wEnemyMon5:: party_struct wEnemyMon5
  2354. wEnemyMon6:: party_struct wEnemyMon6
  2355. wEnemyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d9ac
  2356. wEnemyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d9ee
  2357. ENDU
  2358. wTrainerHeaderPtr:: ; da30
  2359. ds 2
  2360. ds 6
  2361. wOpponentAfterWrongAnswer:: ; da38
  2362. ; the trainer the player must face after getting a wrong answer in the Cinnabar
  2363. ; gym quiz
  2364. wUnusedDA38:: ; da38
  2365. ds 1
  2366. wCurMapScript:: ; da39
  2367. ; index of current map script, mostly used as index for function pointer array
  2368. ; mostly copied from map-specific map script pointer and written back later
  2369. ds 1
  2370. ds 7
  2371. wPlayTimeHours:: ; da41
  2372. ds 1
  2373. wPlayTimeMaxed:: ; da42
  2374. ds 1
  2375. wPlayTimeMinutes:: ; da43
  2376. ds 1
  2377. wPlayTimeSeconds:: ; da44
  2378. ds 1
  2379. wPlayTimeFrames:: ; da45
  2380. ds 1
  2381. wSafariZoneGameOver:: ; da46
  2382. ds 1
  2383. wNumSafariBalls:: ; da47
  2384. ds 1
  2385. wDayCareInUse:: ; da48
  2386. ; 0 if no pokemon is in the daycare
  2387. ; 1 if pokemon is in the daycare
  2388. ds 1
  2389. wDayCareMonName:: ds NAME_LENGTH ; da49
  2390. wDayCareMonOT:: ds NAME_LENGTH ; da54
  2391. wDayCareMon:: box_struct wDayCareMon ; da5f
  2392. wMainDataEnd::
  2393. wBoxDataStart::
  2394. wNumInBox:: ds 1 ; da80
  2395. wBoxSpecies:: ds MONS_PER_BOX + 1
  2396. wBoxMons::
  2397. wBoxMon1:: box_struct wBoxMon1 ; da96
  2398. wBoxMon2:: ds box_struct_length * (MONS_PER_BOX + -1) ; dab7
  2399. wBoxMonOT:: ds NAME_LENGTH * MONS_PER_BOX ; dd2a
  2400. wBoxMonNicks:: ds NAME_LENGTH * MONS_PER_BOX ; de06
  2401. wBoxMonNicksEnd:: ; dee2
  2402. wBoxDataEnd::
  2403. SECTION "Stack", WRAM0[$df00]
  2404. ds $ff
  2405. wStack:: ; dfff
  2406. INCLUDE "sram.asm"