-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobals.inc
343 lines (322 loc) · 14.3 KB
/
globals.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
TempPtr00_lo = $00 ; $00
TempPtr00_hi = $01 ; $01
TempPtr02_lo = $02 ; $02
TempPtr02_hi = $03 ; $03
Temp07 = $07 ; $07
TempPtr08_lo = $08 ; $08
TempPtr08_hi = $09 ; $09
ObstaclePointerLo = $0A ; $0A
ObstaclePointerHi = $0B ; $0B
Unknown10_CollisionAndScrollingTemp = $10 ; $10
Unknown11_CollisionAndScrollingTemp = $11 ; $11
Unknown12_CollisionAndScrollingTemp = $12 ; $12
Unknown13_Horizontal_32pixelUnitForObject = $13 ; $13
Unknown14_Horizontal_256pixelUnitForObject = $14 ; $14
CurrentPlotAction = $18 ; $18
CurrentPlotAction_StateWithin = $19 ; $19
NMI_InProgress = $1A ; $1A
InSoundCode = $1B ; $1B
Mapper1reg_reg3 = $1C ; $1C
FrameCounter = $1D ; $1D
ScreenBlankingCounter = $21 ; $21
PPUsendQueueHead = $22 ; $22
MainMenuOptionIndex = $23 ; $23
GamePaused = $26 ; $26
GameInDeathState = $27 ; $27
MerchantDealCost0011 = $28 ; $28
MerchantDealCost1100 = $29 ; $29
TimeRelated2A = $2A ; $2A
TimeRelated2B = $2B ; $2B
PlotAction05_GameLoop_WhichAction = $2C ; $2C
RandomSeed = $2E ; $2E
CurrentLevelMapType = $30 ; $30
RemainingLives = $31 ; $31
InventoryCursorCompartmentSelection = $33 ; $33
DeathStateRelatedFlagMaybe = $34 ; $34
Unknown39_From_XscrollingPositionDividedBy16 = $39 ; $39
Unknown3B_From_8C8D_dividedBy16 = $3B ; $3B
ActorSpawnControlUnknown3C = $3C ; $3C
CurrentLevelData_Actors_PointerLo = $3D ; $3D
CurrentLevelData_Actors_PointerHi = $3E ; $3E
TimeRelated3F = $3F ; $3F
DialogActivationState = $40 ; $40
Unknown41 = $41 ; $41
Unknown42 = $42 ; $42
Unknown43 = $43 ; $43
Unknown45 = $45 ; $45
Edigits0011 = $46 ; $46
Edigits1100 = $47 ; $47
HeartsDigits0011 = $48 ; $48
HeartsDigits1100 = $49 ; $49
InventoryMiscItems2 = $4A ; $4A
ScrollingIsLocked = $4B ; $4B
InventoryNumLaurels = $4C ; $4C
InventoryNumGarlics = $4D ; $4D
CurrentLevelSceneNumber_BackupForExitRoom = $4E ; $4E
InventoryBodyPartSelection = $4F ; $4F
CurrentLevelSceneNumber = $50 ; $50
CurrentLevelSubRoomNumber = $51 ; $51
CurrentXScrollingPositionPixels = $53 ; $53
CurrentXScrollingPositionScreens = $54 ; $54
CurrentYScrollingPositionPixels_Mod240 = $56 ; $56
Current_WhatUnknown57 = $57 ; $57
CurrentYScrollingPosition_SomeOtherUnit = $5C ; $5C
CurrentYScrollingPosition_Related = $5D ; $5D
NameTableAddressLo = $5E ; $5E
NameTableAddressHi = $5F ; $5F
Unknown60_ScrollingRelated = $60 ; $60
AttributeTableAddressHi = $61 ; $61
LevelData_MetaTiles_pointerLo = $63 ; $63
LevelData_MetaTiles_pointerHi = $64 ; $64
Unknown6A_ScrollingRelated = $6A ; $6A
LevelData_CategoryThresholds_pointerLo = $6E ; $6E
LevelData_CategoryThresholds_pointerHi = $6F ; $6F
LevelData_Screens_pointerLo = $70 ; $70
LevelData_Screens_pointerHi = $71 ; $71
LevelData_Stairs_pointerLo = $72 ; $72
LevelData_Stairs_pointerHi = $73 ; $73
DialogText_Ycoord = $77 ; $77
DialogText_Xcoord = $78 ; $78
DialogText_Saved_ID = $79 ; $79
DialogActionState = $7A ; $7A
DialogText_RemainingPerCharacterDelay = $7B ; $7B
DialogText_CharacterIndex = $7C ; $7C
DialogText_BeginX = $7D ; $7D
DialogText_Saved_CharacterIndex = $7E ; $7E
DialogTextID = $7F ; $7F
CurrentHP = $80 ; $80
CurrentMaxHP = $81 ; $81
IsNightTime = $82 ; $82
CurrentDayBCD = $83 ; $83
CurrentTimeWaitCounter = $84 ; $84
CurrentMinuteBCD = $85 ; $85
CurrentHourBCD = $86 ; $86
DayNightTransition_PaletteBitmask = $87 ; $87
DayNightTransitionDelayCounter = $88 ; $88
CurrentLevel = $8B ; $8B
CurrentYScrollingPositionPixels_Mod256 = $8C ; $8C
CurrentYScrollingPositionScreens_maybe = $8D ; $8D
TimeFlag8F_TimeIsStopped = $8F ; $8F
InventoryCursorSelected1 = $90 ; $90
InventoryBodyParts1 = $91 ; $91
InventoryMiscItems1 = $92 ; $92
Temp93 = $93 ; $93
Temp94 = $94 ; $94
Temp95 = $95 ; $95
Temp96 = $96 ; $96
Temp97 = $97 ; $97
SoundEnvelopePtrLo = $99 ; $99
SoundEnvelopePtrHi = $9A ; $9A
Sound_CalcPeriod_Lo = $9B ; $9B Calculated period value after slide/tremolo
Sound_CalcPeriod_Hi = $9C ; $9C Calculated period value after slide/tremolo
Sound_StartSong_TrackDataPtr_Lo = $9D ; $9D
Sound_StartSong_TrackDataPtr_Hi = $9E ; $9E
SoundTrackPtrLo = $A1 ; $A1
SoundTrackPtrHi = $A2 ; $A2
Sound_RecordPtrLo = $A3 ; $A3
Sound_RecordPtrHi = $A4 ; $A4
Sound_TempA5 = $A5 ; $A5
Sound_TempPtrA7_lo = $A7 ; $A7
Sound_TempPtrA7_hi = $A8 ; $A8
Sound_FadeCounter = $A9 ; $A9
Sound_FadeValue = $AA ; $AA
Sound_NoteTicksLeft_Channel0_square0 = $AB ; $AB-$B0 one byte per logical channel
Sound_CurrentSongNumber_Channel0_square0 = $B1 ; $B1-$B2
Sound_CurrentSongNumber_Channel2_triangle = $B3 ; $B3
Sound_CurrentSongNumber_Channel3_effectsquare = $B4 ; $B4-$B5
Sound_CUrrentSongNumber_Channel5_Percussion = $B6 ; $B6
Sound_TrackDataPointer1Lo_Channel0_square0 = $B7 ; $B7-$BC
Sound_TrackDataPointer1Hi_Channel0_square0 = $BD ; $BD-$C2
; Bit 0: set if SFX, clear if Music
; Bit 1: set during a "gosub" call, gets cleared upon "return"
; Bit 6: Rest?
; Bit 7: Mute channel?
Sound_SoundFlags = $C3 ; $C3-$C8 one byte per logical channel
Sound_ChannelTempo_Channel0_square0 = $C9 ; $C9-$CE one byte per logical channel
Sound_ChannelTempo_Channel1_square1 = $CA ; $CA
Sound_ChannelTempo_Channel2_triangle = $CB ; $CB
Sound_ChannelTempo_Channel3_square0 = $CC ; $CC
Sound_ChannelTempo_Channel4_noise = $CD ; $CD
Sound_ChannelTempo_Channel5_noise = $CE ; $CE also used for percussions/DPCM
Sound_ReturnPointerLo_Channel0_square0 = $CF ; $CF-$D4 one byte per logical channel
Sound_ReturnPointerHi_Channel0_square0 = $D5 ; $D5-$DA one byte per logical channel
Sound_LoopCounter_Channel0_square0 = $DB ; $DB-$E0 one byte per logical channel
Sound_LoopBeginPointerLo_Channel0_square0 = $E1 ; $E1-$E6
Sound_LoopBeginPointerHi_Channel0_square0 = $E7 ; $E7-$EC
Input_CurrentJoyButtonsOrig = $F1 ; $F1
Input_NewJoyButtonsOrig = $F3 ; $F3
Input_NewJoyButtonsOrig_Player2 = $F4 ; $F4
Input_NewJoyButtonsWork = $F5 ; $F5
Input_NewJoyButtonsWork_Player2 = $F6 ; $F6
Input_CurrentJoyButtonsWork = $F7 ; $F7
PPUscrollingPositionHi = $FC ; $FC
PPUscrollingPositionLo = $FD ; $FD
PPUdesiredRegister2001 = $FE ; $FE
PPUdesiredRegister2000 = $FF ; $FF
Mapper1reg_reg0 = $0100 ; $0100
Mapper1reg_reg1 = $0101 ; $0101
Mapper1reg_reg2 = $0102 ; $0102
ProgrammingMapper = $0103 ; $0103
Sound_CurrentPeriodLo = $0110 ; $0110
Sound_CurrentPeriodHi = $0115 ; $0115
Sound_CacheAPUreg3 = $011A ; $011A
Sound_CacheAPUreg3_Channel2_Triangle = $011C ; $011C
Sound_CacheAPUreg2 = $011F ; $011F
Sound_Env1_Volume = $0124 ; $0124-$0128 Low nibble of envelope 1 value
Sound_CacheAPUreg0and1_twonibbles = $0129 ; $0129
Sound_FreqDividerExp = $012E ; $012E-$0130 All frequencies will be divided by 2^(value)
; Signed value to be added/subtracted from note index (all notes in the channel)
Sound_0131_IntervalShift = $0131 ; $0131-$0133 Interval shift
; Low nibble = flags
; bit 0: high nibble = duty for new notes
; bit 1: high nibble = duty for release
; bit 2: don't use release, set volume to 2 after sustain instead
; bit 3: unused
Sound_0134_Env1_Flags = $0134 ; $0134-$0135
Sound_CurrentEnvelopeIndex_1 = $0136 ; $0136-$0137
; High nibble = ticks between release attenuations
; Low nibble = sustain ticks multiplier
Sound_0138_SustainReleaseSpeed = $0138 ; $0138-$0139
; How many ticks before release attenuation starts for the current note
; Calculated using note ticks (tempo * duration) and SustainReleaseSpeed
Sound_NoteSustainTicks = $013A ; $013A-$013B
Sound_013C_Env1_ReleaseTicksLeft = $013C ; $013C-$013D How many ticks before the next release attenuation is applied
Sound_013E_Env1_Attenuation = $013E ; $013E-$013F Volume attenuation? Works as "reverse" channel volume
Sound_0140_Env1_ReleaseAttenuation = $0140 ; $0140-$0141 Attenuation value used in envelope release
Sound_0146_Env2_Multiplier = $0146 ; $0146-$0147 Pitch envelope value multiplier
Sound_0148_Env2_Duration = $0148 ; $0148-$0149 How many ticks to wait before starting the pitch envelope
Sound_CurrentEnvelopeIndex_2 = $014A ; $014A-$014B
Sound_Env1_TicksLeft = $014C ; $014C-$014D Current envelope value duration (ticks left for this envelope value)
Sound_Env2_TicksLeft = $014E ; $014E-$014F Current envelope value duration (ticks left for this envelope value)
Sound_Env1_BytesRead = $0150 ; $0150-$0151
Sound_Env2_BytesRead = $0152 ; $0152-$0153
Sound_Env1_BytesRead_Copy = $0154 ; $0154-$0155
Sound_Env2_BytesRead_Copy = $0156 ; $0156-$0157
Sound_Env1_LoopCounter = $0158 ; $0158-$0159
Sound_Env2_LoopCounter = $015A ; $015A-$015B
Sound_TempPtr015C_lo = $015C ; $015C
Sound_TempPtr015C_hi = $015D ; $015D
Sound_CurrentLogicalChannel = $0164 ; $0164
Sound_StartSong_MainPtrOffset = $0168 ; $0168
Sound_StartSong_LatestSongIndex = $0169 ; $0169
Sound_StartSong_NumTracksRemaining = $016A ; $016A
Sound_StartSong_CurrentLogicalChannel = $016B ; $016B
Sound_PCMsampleActive = $016C ; $016C
ClearedFakeBlockListY = $0171 ; $0171
ClearedFakeBlockListX = $0172 ; $0172
ClearedFakeBlockListLength = $0185 ; $0185
CurrentXScrollingPositionPixels_BackupForDeath = $0186 ; $0186
CurrentXScrollingPositionScreens_BackupForDeath = $0187 ; $0187
CurrentYScrollingPositionPixels_Mod240_BackupForDeath = $0188 ; $0188
Current_WhatUnknown57_BackupForDeath = $0189 ; $0189
SimonScreenXCoord_BackupForDeath = $018A ; $018A
SimonScreenYCoord_BackupForDeath = $018B ; $018B
CurrentLevelMapType_BackupForDeath = $018C ; $018C
CurrentLevelSceneNumber_BackupForDeath = $018D ; $018D
CurrentLevelSubroomNumber_BackupForDeath = $018E ; $018E
Unknown194_PossiblyScrollingRelated = $0194 ; $0194
Unknown195_PossiblyScrollingRelated = $0195 ; $0195
RemainingLaurelPower = $0197 ; $0197
ObjectCurrentPose1 = $0300 ; $0300
ObjectPaletteIndex = $0312 ; $0312
ObjectScreenYCoord = $0324 ; $0324
ObjectScreenYCoordFrac = $0336 ; $0336
ObjectScreenXCoord = $0348 ; $0348
ObjectScreenXCoordFrac = $035A ; $035A
ObjectYSpeed = $036C ; $036C
ObjectYSpeedFrac = $037E ; $037E
ObjectXSpeed = $0390 ; $0390
ObjectXSpeedFrac = $03A2 ; $03A2
ObjectType = $03B4 ; $03B4
ObjectDialogStatusFlag = $03C6 ; $03C6
ObjectCurrentActionType = $03D8 ; $03D8
ObjectPoseChangeCounter = $03EA ; $03EA
ObjectCurrentPose2 = $03FC ; $03FC
ObjectIndexToAutomaticSpriteDataTable = $040E ; $040E
ObjectFacingLeft = $0420 ; $0420
ObjectUnknown432 = $0432 ; $0432
CurrentWhipLevel = $0434 ; $0434
ObjectAIvar1 = $0444 ; $0444
UnknownFlag0446 = $0446 ; $0446
ObjectAIvar2 = $0456 ; $0456
CurrentXScrollingPositionPixels_BackupForExitRoom = $0458 ; $0458
ObjectAIvar3 = $0468 ; $0468
CurrentXScrollingPositionScreens_BackupForExitRoom = $046A ; $046A
Ending_PrimaryActionIndex = $047A ; $047A
Ending_TypeDependingOnDays = $047B ; $047B
CurrentYScrollingPositionPixels_Mod240_BackupForExitRoom = $047C ; $047C
Ending_CurrentActionType = $047D ; $047D
EndingStringCurrentStringIndex = $047E ; $047E
EndingStringCurrentCharacterIndex = $047F ; $047F
Ending_RemainingDelayBeforeNextEndingActionIstaken = $0480 ; $0480
Ending_Action00_NextSubAction = $0481 ; $0481
Ending_RemainingDelayBeforeDraculaHandScene = $0482 ; $0482
Ending_RemainingDelayInDraculaHandScene = $0483 ; $0483
Ending_Unknown0484 = $0484 ; $0484
ObjectAIvar4 = $048C ; $048C
Current_WhatUnknown57_BackupForExitRoom = $048E ; $048E
ObjectAIvar5 = $049E ; $049E
SimonScreenXCoord_BackupForExitRoom = $04A0 ; $04A0
ObjectAIvar6 = $04B0 ; $04B0
SimonScreenYCoord_BackupForExitRoom = $04B2 ; $04B2
ObjectEnemyRemainingHP = $04C2 ; $04C2
SwampFlashCounter = $04C4 ; $04C4
ObjectDialogTextIndex = $04D4 ; $04D4
UnknownFlag04D6 = $04D6 ; $04D6
;ObjectDialogTextIndex = $04D7 ; $04D7
KneelingCounter = $04EA ; $04EA
Unknown04EC = $04EC ; $04EC
Unknown04ED_finalConfrontationRelated = $04ED ; $04ED
Unknown04EE = $04EE ; $04EE
PasswordActionState = $04EF ; $04EF
Password_CurrentCharacter_PPUmemoryOffset = $04F0 ; $04F0
Password_CurrentCharacterPosition = $04F1 ; $04F1
Password_CurrentCursor_Row = $04F2 ; $04F2
Password_CurrentCursor_Column = $04F3 ; $04F3
Password_CurrentCursorPosition = $04F4 ; $04F4
Password_DelayBeforeContinuing = $04F5 ; $04F5
Password_TempXorValue = $04F6 ; $04F6
Password_TempAddValue = $04F7 ; $04F7
ObjectStunCounter = $04F8 ; $04F8
PasswordLevel = $0520 ; $0520
PasswordCurrentDayBCD = $0521 ; $0521
PasswordLaurelsGarlics = $0522 ; $0522
PasswordBodyparts = $0523 ; $0523
PasswordMiscItems1 = $0524 ; $0524
PasswordMiscItems2 = $0525 ; $0525
PasswordWhipLevel = $0526 ; $0526
PasswordChecksumHi = $0527 ; $0527
PasswordChecksumLo = $0528 ; $0528
PasswordXorAdd = $0529 ; $0529
PasswordCode0 = $0530 ; $0530
PasswordCode1 = $0531 ; $0531
PasswordCode2 = $0532 ; $0532
PasswordCode3 = $0533 ; $0533
PasswordCode4 = $0534 ; $0534
PasswordCode5 = $0535 ; $0535
PasswordCode6 = $0536 ; $0536
PasswordCode7 = $0537 ; $0537
PasswordCode8 = $0538 ; $0538
PasswordCode9 = $0539 ; $0539
PasswordCodeA = $053A ; $053A
PasswordCodeB = $053B ; $053B
PasswordCodeC = $053C ; $053C
PasswordCodeD = $053D ; $053D
PasswordCodeE = $053E ; $053E
PasswordCodeF = $053F ; $053F
PasswordInputtedCode0 = $0540 ; $0540
ObstacleBufferDraculaDoor = $05A0 ; $05A0
PPUsendQueueMinus3 = $06FD ; $06FD
PPUsendQueueMinus2 = $06FE ; $06FE
PPUsendQueueMinus1 = $06FF ; $06FF
PPUsendQueue = $0700 ; $0700
APU_HW__4000_Reg0 = $4000 ; $4000
APU_HW__4001_Reg1_SweepControl = $4001 ; $4001
APU_HW__4002_Reg2_WaveLengthLo = $4002 ; $4002
APU_HW__4003_Reg3_WaveLengthHi = $4003 ; $4003
APU_HW__4004_Reg0_channel1 = $4004 ; $4004
APU_HW__4008_Reg0_channel2 = $4008 ; $4008
APU_HW__400B_Reg3_channel2_WaveLengthHi = $400B ; $400B
APU_HW__400C_Reg0_channel3 = $400C ; $400C
APU_HW__4010_PCM_IRQenableAndWaveLength = $4010 ; $4010
APU_HW__4015_EnableChannelsMask = $4015 ; $4015