$80:8248

From ZAMN Hacking
Revision as of 16:01, 15 June 2024 by Piranhaplant (talk | contribs) (Created page with "{{Infobox ROM address|length=0x16|type=Code|name=createPlayerEntity|description=Creates an entity for a player|args=Y+A = Entity pointer|ret_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 fa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
ROM address data
Length 0x16
Type Code
Name createPlayerEntity
Description Creates an entity for a player
Arguments/Return value Y+A = Entity pointer
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.