$80:8248: Difference between revisions

From ZAMN Hacking
Content added Content deleted
No edit summary
No edit summary
 
Line 5: Line 5:
** This was possibly meant to guarantee player entities get assigned a direct page with a zero low byte for faster RAM access, but for some reason the second player entity has 0x280 for its direct page.
** This was possibly meant to guarantee player entities get assigned a direct page with a zero low byte for faster RAM access, but for some reason the second player entity has 0x280 for its direct page.
* Only searches for an empty entity in the first 0x10 slots (out of 0x18 total slots). This shouldn't matter since this is only used for up to two player entities.
* Only searches for an empty entity in the first 0x10 slots (out of 0x18 total slots). This shouldn't matter since this is only used for up to two player entities.

[[Category:ROM address]]

Latest revision as of 18:39, 22 June 2024

ROM address data
Length 0x16
Type Code
Name createPlayerEntity
Description Creates an entity for a player
Arguments/Return value Y+A = [pointer32] Entity pointer
Returns A = [unit16] Entity ID
Return type RTL

This is the same as $80:825E, but with the following differences:

  • Searches entity slots in forward order instead of reverse. This will guarantee that the two player entities are in the first two slots.
    • This was possibly meant to guarantee player entities get assigned a direct page with a zero low byte for faster RAM access, but for some reason the second player entity has 0x280 for its direct page.
  • Only searches for an empty entity in the first 0x10 slots (out of 0x18 total slots). This shouldn't matter since this is only used for up to two player entities.