Entity: Difference between revisions
Content deleted Content added
Piranhaplant (talk | contribs) No edit summary |
Piranhaplant (talk | contribs) No edit summary |
||
Line 9: | Line 9: | ||
An entity is created by calling [[$80:825E]] and providing a pointer to the start of the entity code in the Y register and accumulator. Upon creation, 10 bytes ($00-$09) are copied from the current direct page to the direct page of the new entity. This can be used to provide various parameters to the entity. |
An entity is created by calling [[$80:825E]] and providing a pointer to the start of the entity code in the Y register and accumulator. Upon creation, 10 bytes ($00-$09) are copied from the current direct page to the direct page of the new entity. This can be used to provide various parameters to the entity. |
||
[[$80:8353]] is called to yield control to other entities. The accumulator contains the number of frames before this entity is resumed. Control resumes immediately following the call to $80:8353. Yielding control will preserve the data bank register, processor status register, and direct page register by pushing them onto the stack in that order. No other registers are preserved. |
[[$80:8353]] is called to yield control to other entities. The accumulator contains the number of frames before this entity is resumed. However, an entity may resume early if its [[Sprite#Collision|sprite collision handler]] forces it to. Control resumes immediately following the call to $80:8353. Yielding control will preserve the data bank register, processor status register, and direct page register by pushing them onto the stack in that order. No other registers are preserved. |