Difference between revisions of "Source code/Technical information"
From Sonic Retro
m (Correct category) |
(Added more global variables and reworded entries related to checkpoints.) |
||
Line 5: | Line 5: | ||
! Name | ! Name | ||
! Description | ! Description | ||
+ | |- | ||
+ | | actwk | ||
+ | | Action object work. An array of sprite status objects. In Sonic the Hedgehog and Sonic CD, it has 128 elements. In Sonic 2, it has 152 elements. In Sonic 3, Sonic & Knuckles, and Sonic 3 & Knuckles, it has 110 elements. | ||
+ | |- | ||
+ | | chibi_flag | ||
+ | | Chibi is Japanese slang for small. Zero when the player is in a normal state. Non-zero when the player has been shrinked by a shrink ray in Metallic Madness. Sonic CD only. | ||
+ | |- | ||
+ | | chibi_s | ||
+ | | Chibi save. Stores the the value of chibi_flag at the time of the last [[Checkpoint|checkpoint]] activation. | ||
+ | |- | ||
+ | | editmode | ||
+ | | Zero when [[Edit_mode|edit mode]] is not enabled. Non-zero if [[Edit_mode|edit mode]] is enabled. | ||
+ | |- | ||
+ | | editno | ||
+ | | Edit numero. When [[Edit_mode|edit mode]] is enabled and the player is cycling through the objects that can be placed, this contains the index of the current object. | ||
+ | |- | ||
+ | | emyscorecnt | ||
+ | | Enemy score count. Stores the number of enemies, multiplied by 2, that the player has destroyed while in the air. When the player lands on the ground, it's reset to zero. | ||
|- | |- | ||
| generate_flag | | generate_flag | ||
Line 25: | Line 43: | ||
|- | |- | ||
| plring_s | | plring_s | ||
− | | Player rings save. Stores the | + | | Player rings save. Stores the value of plring at the time of the last [[Checkpoint|checkpoint]] activation. |
|- | |- | ||
| plscore | | plscore | ||
Line 34: | Line 52: | ||
|- | |- | ||
| pltime_s | | pltime_s | ||
− | | Player time save. | + | | Player time save. Stores the value of pltime at the time of the last [[Checkpoint|checkpoint]] activation. |
|- | |- | ||
| plxposi_s | | plxposi_s | ||
Line 44: | Line 62: | ||
| projector_flag | | projector_flag | ||
| Zero if the Metal Sonic projector hasn't been destroyed (yet). 1 if it has been destroyed. Sonic CD only. | | Zero if the Metal Sonic projector hasn't been destroyed (yet). 1 if it has been destroyed. Sonic CD only. | ||
+ | |- | ||
+ | | ranum | ||
+ | | Random number. The seed for generating the next random number. | ||
+ | |- | ||
+ | | ringbonus | ||
+ | | The bonus score for the amount of rings the player has when finishing the act. | ||
+ | |- | ||
+ | | stageno | ||
+ | | Stage numero. This variable is a combination of two values: the high byte contains the zero-based zone number, and the low byte contains the zero-based act number. | ||
+ | |- | ||
+ | | swdata1 | ||
+ | | This variable is a combination of two values related to controller 1: the low byte contains a bit field of buttons that have been newly pressed this frame, and the high byte contains a bit field of buttons that were already pressed this frame. | ||
+ | |- | ||
+ | | swdata2 | ||
+ | | This variable is a combination of two values related to controller 2: the low byte contains a bit field of buttons that have been newly pressed this frame, and the high byte contains a bit field of buttons that were already pressed this frame. | ||
|- | |- | ||
| ta_flag | | ta_flag | ||
Line 53: | Line 86: | ||
| time_item | | time_item | ||
| Stores the value of the last activated [[Time_Warp_Plate|Time Warp Plate]]. Possible values: 0 for none, 1 for future, and -1 for past. Sonic CD only. | | Stores the value of the last activated [[Time_Warp_Plate|Time Warp Plate]]. Possible values: 0 for none, 1 for future, and -1 for past. Sonic CD only. | ||
+ | |- | ||
+ | | timebonus | ||
+ | | The bonus score for length of time it took the player to finish the act. | ||
|} | |} | ||
[[Category:Technical information]] | [[Category:Technical information]] |
Revision as of 16:25, 14 March 2024
This page contains information about names and labels used in the original source code of the Mega Drive and Mega CD games.
Global variables
Name | Description |
---|---|
actwk | Action object work. An array of sprite status objects. In Sonic the Hedgehog and Sonic CD, it has 128 elements. In Sonic 2, it has 152 elements. In Sonic 3, Sonic & Knuckles, and Sonic 3 & Knuckles, it has 110 elements. |
chibi_flag | Chibi is Japanese slang for small. Zero when the player is in a normal state. Non-zero when the player has been shrinked by a shrink ray in Metallic Madness. Sonic CD only. |
chibi_s | Chibi save. Stores the the value of chibi_flag at the time of the last checkpoint activation. |
editmode | Zero when edit mode is not enabled. Non-zero if edit mode is enabled. |
editno | Edit numero. When edit mode is enabled and the player is cycling through the objects that can be placed, this contains the index of the current object. |
emyscorecnt | Enemy score count. Stores the number of enemies, multiplied by 2, that the player has destroyed while in the air. When the player lands on the ground, it's reset to zero. |
generate_flag | Zero if the robot transporter hasn't been destroyed (yet). 1 if it has been destroyed. Sonic CD only. |
markerno | Marker numero. Stores the identifier of the last activated checkpoint. |
pl_suu | Player lives. suu is the Japanese verb for breathing. |
plpower_b | Player power baria. Baria is the Japanese word for barrier. Zero when the player character doesn't have a shield. 1 when the player character has a shield. |
plpower_m | Player power muteki. Muteki is the Japanese word for invincible. Zero when not invincible. 1 when invincible. |
plring | Player rings. |
plring_s | Player rings save. Stores the value of plring at the time of the last checkpoint activation. |
plscore | Player score. |
pltime | Player time. The duration of time since starting the act. Stored as three bytes: 1/60 seconds, seconds,and minutes. |
pltime_s | Player time save. Stores the value of pltime at the time of the last checkpoint activation. |
plxposi_s | Player x position save. Stores the x position of the last activated checkpoint. |
plyposi_s | Player y position save. Stores the y position of the last activated checkpoint. |
projector_flag | Zero if the Metal Sonic projector hasn't been destroyed (yet). 1 if it has been destroyed. Sonic CD only. |
ranum | Random number. The seed for generating the next random number. |
ringbonus | The bonus score for the amount of rings the player has when finishing the act. |
stageno | Stage numero. This variable is a combination of two values: the high byte contains the zero-based zone number, and the low byte contains the zero-based act number. |
swdata1 | This variable is a combination of two values related to controller 1: the low byte contains a bit field of buttons that have been newly pressed this frame, and the high byte contains a bit field of buttons that were already pressed this frame. |
swdata2 | This variable is a combination of two values related to controller 2: the low byte contains a bit field of buttons that have been newly pressed this frame, and the high byte contains a bit field of buttons that were already pressed this frame. |
ta_flag | Time attack flag. Zero during regular play. Non-zero when in Time Attack mode. Sonic CD only. |
time_flag | This flag is a combination of two values: the most significant bit stores the player currently has the power of time travel, and the rest of the byte stores a time period. If the player doesn't have the power of time travel, the time period is the current time period. If the player has the power of time travel, the time period is the one the player will travel to when time-traveling. The possible time period values are zero for past, 1 for present, and 2 for future. |
time_item | Stores the value of the last activated Time Warp Plate. Possible values: 0 for none, 1 for future, and -1 for past. Sonic CD only. |
timebonus | The bonus score for length of time it took the player to finish the act. |