; --------------------------------------------------------------------------- ; Semantic zero-page aliases (Pass 3) ; ; Every alias below was read out of this dump's own code. The neutral ZpXX ; name stays on the same line so the file keeps both readings. ; ; $02/$03 the 16-bit pointer to the command script: every routine that ; reads the script uses (Zp02),y, and AdvanceScriptPointer at ; $C1D0 increments the pair ; $04 the command-list sync flag: set by FinishCommandList, waited ; on by FinishCommandList_Wait, tested by FlushVramCommandList ; $05/$06 the VRAM write position: BuildVramAddress at $C198 folds ; $06 into the low byte and $05 into the high byte of a ; $2000-based address ; $0A/$0B the 16-bit frame counter: incremented once per NMI at $D791 ; and used by AddToCounter as the value to wait for ; $0C the counter the three draw routines clear before they run ; $27/$28 the pointer to the sound tick script ; $29/$2A the pointer to the first sound player's script ; $2B/$2C the pointer to the second sound player's script ; $2D/$2E the pointer to the third sound player's script ; $3D/$3E the JOY1/JOY2 shift registers, filled by ReadControllers ; $43/$44 the sprite X and Y, written into OAM bytes 3 and 0 ; $4D/$4E/$4F the 24-bit delta the sound engine adds and subtracts ; $50 the per-voice wrap counter of the delta subtraction ; --------------------------------------------------------------------------- ScriptPtrLo = $02 ; semantic alias for Zp02 (the 16-bit command-script pointer) ScriptPtrHi = $03 ; semantic alias for Zp03 (the high byte of that pointer) CommandListFlag = $04 ; semantic alias for Zp04 (the command-list sync flag) VramPosHi = $05 ; semantic alias for Zp05 (the high bits of the VRAM write position) VramPosLo = $06 ; semantic alias for Zp06 (the low bits of the VRAM write position) FrameCounter = $0A ; semantic alias for Zp0A (the 16-bit frame counter) FrameCounterHi = $0B ; semantic alias for Zp0B (the high byte of the frame counter) DrawCounter = $0C ; semantic alias for Zp0C (the counter the draw routines clear) SoundTickScriptLo = $27 ; semantic alias for Zp27 (the sound tick script pointer) SoundTickScriptHi = $28 ; semantic alias for Zp28 (the high byte of that pointer) SoundPlayer1ScriptLo = $29 ; semantic alias for Zp29 (the first sound player's script pointer) SoundPlayer1ScriptHi = $2A ; semantic alias for Zp2A (the high byte of that pointer) SoundPlayer2ScriptLo = $2B ; semantic alias for Zp2B (the second sound player's script pointer) SoundPlayer2ScriptHi = $2C ; semantic alias for Zp2C (the high byte of that pointer) SoundPlayer3ScriptLo = $2D ; semantic alias for Zp2D (the third sound player's script pointer) SoundPlayer3ScriptHi = $2E ; semantic alias for Zp2E (the high byte of that pointer) Player1Input = $3D ; semantic alias for Zp3D (the JOY1 shift register) Player2Input = $3E ; semantic alias for Zp3E (the JOY2 shift register) SpriteX = $43 ; semantic alias for Zp43 (the sprite X, OAM byte 3) SpriteY = $44 ; semantic alias for Zp44 (the sprite Y, OAM byte 0) DeltaLo = $4D ; semantic alias for Zp4D (the 24-bit sound delta) DeltaMid = $4E ; semantic alias for Zp4E (the middle byte of the delta) DeltaHi = $4F ; semantic alias for Zp4F (the high byte of the delta) DeltaWrapCount = $50 ; semantic alias for Zp50 (the per-voice wrap counter) ; --------------------------------------------------------------------------- ; Slots that stay neutral, and why ; ; The aliases above are the ones whose role the ROM proves. Every slot ; below is listed with the reason it keeps its neutral ZpXX name: the role ; is either only visible inside one routine, or the address is reused for ; two different things, so a single name would be a guess. ; ; $00/$01 the two halves of a $20xx VRAM address in the boot and palette ; code, reused as plain scratch elsewhere ; $07/$08 the boot region's frame and state counters ; $09 one read, in a comparison that never leads anywhere ; $0D/$0E a 16-bit counter in one routine and a RAM pointer in another ; $0F a byte the sound player passes around ; $11/$12 the envelope bytes of the sound tick ; $13/$14 the envelope bytes of the first sound player ; $15/$16 the envelope bytes of the second sound player ; $17/$18 the envelope bytes of the third sound player ; $19/$1A the target bytes of the first sound player ; $1B/$1C the target bytes of the second and third sound players ; $1F a flag the sound player clears when it starts ; $20/$21/$22 the "finished" flag of each of the three sound players ; $23-$26 the four voices' envelope bytes, indexed by X ; $2F-$32 the four voices' flag bytes, indexed by X ; $33 the sound effect id and the "a voice is playing" flag ; $34 a counter ; $3F-$42 the 24-bit product accumulator of Multiply16 ; $45/$46 the general-purpose scratch of the shift and arithmetic helpers ; $47 the carry byte of those helpers ; $48/$49 the second and third operand slots of the delta helpers ; $55 one read, as the seed of a delta ; $80 the base of the indexed sound table ; $AC one comparison against a table byte ; $D0-$DE the sound engine's per-voice working bytes ; ---------------------------------------------------------------------------