Explains sprite commands used in the definition.
Sprite
command
The sprite commands are represented by the value bigger than
$8000. These commands alwys works the same regardless of the
sprite.
The assembly of commands is located at $BB:849B
Note: Discrimination of the command is always done with only by
upper byte. Therefore, you can use any value for lower byte but
usually use zero.
$8000
Syntax
Termination command for definition. This command does not accept any
argument.
Sprite definition must be ended with this command.
$8100
Syntax
Load specified animation. The argument is animation ID.
See
Table 1 for animation ID list.
$8200
Syntax
Dummy command. This command requires one argument but does nothing.
$8300
Syntax
Inherit the sprite definition from specified address. Multi-step inheritance
and multiple inheritance are also possible, but when performing
multiple inheritance, pay attention to the order of inheritance.
If there is a conflicting variable call during multiple
inheritance, the latest inherited definition takes precedence.
$8400
Syntax
Load the specified palette. The argument is palette address (Bank $FD).
For normal use, you should use command $8D00 instead, but when
use this command, it works slightly faster than $8D00 because
$8400 does not do table lookup.
$8500
Syntax
0x8500, [flags] ushort oamstate
0x8500, [flags] ushort oamstate
Set sprite state. The argument is OAM state.
Detailed infomation for OAM states, see
Table 2.
$8600
Syntax
0x8600, short xoffset, short yoffset
0x8600, short xoffset, short yoffset
Locate the sprite at specified relative position with respect to current
active Kong's location.
$8700
Syntax
0x8700, ushort valiable, ushort value
0x8700, ushort valiable, ushort value
Conditionally assign the value specified by the second argument to the
variable specified by the first argument.
If the calling
sprite is facing right, this command will assign the raw value.
Otherwise, this command will assign the sign inverted value.
This command assumes that it is used for the sprites generated
by sprite generators.
$8800
Syntax
Get location from $0A3E and $0A40, and set #$00F8 as the depth. This command
does not accept any argument.
$8900
Syntax
0x8900, ushort controlcode, absolute paletteaddress, longaddress imageaddress, byte imagesize
0x8900, ushort controlcode, absolute paletteaddress, longaddress imageaddress, byte imagesize
Set sprite assembly pointer and palette and configure DMA.
Argument 1: Sprite assembly pointer.
Argument 2: Palette address.
Argument 3: Sprite image address. (24 bits)
Argument 4: 1/64 of Sprite image size. (8 bits)
$8A00
Syntax
0x8A00, [flags] ushort cannonmode, (byte, byte) rotaterange, ushort baseposition, ushort distance, ushort unknownparameter,
ushort velocity, ushort returningvelocity, byte launchspeed, byte count, ushort flyingdistance, ushort stiff,
(byte, byte) animalandlevelmove, ushort rotatespeed, ushort cameraposition
0x8A00, [flags] ushort cannonmode, (byte, byte) rotaterange, ushort baseposition, ushort distance, ushort unknownparameter,
ushort velocity, ushort returningvelocity, byte launchspeed, byte count, ushort flyingdistance, ushort stiff,
(byte, byte) animalandlevelmove, ushort rotatespeed, ushort cameraposition
Assign each argument value to 14 variables. They will be assigned to
variable $46, $42, $4C, $4E, $52, $28, $22, $2C, $2D, $20, $24,
$26, $3A. $36 in order.
This command used exclusively for
initializing barrel cannon or bonus cannon.
$8B00
Syntax
0x8B00, [flags] ushort oamstate
0x8B00, [flags] ushort oamstate
Set sprite state. The argument is OAM state.
Detailed infomation for OAM states, see
Table 2.
This command automatically corrects display
priority.
If the value of "effect 2" in ISD is multiples of
2, this command will assign the specified priority. Otherwise,
this command will assign priority 3 in case you specify 2 or 3,
assign priority 0 in case you specify 0 or 1.
This
automatically correct is for hiding sprites behind the lava,
etc.
It is a very special kind of process, which is normally
used only for Kongs that assign priority 3.
$8C00
Syntax
Load the specified palette. The argument is palette address (Bank $FD).
This command execute jump to command $8400 assembly and works
slower than $8400. Using this command is not recommended.
$8D00
Syntax
0x8D00, ushort palettenumber
0x8D00, ushort palettenumber
Load the specified palette. The argument is palette index. You should use
this command for normal use.
See
Table 3 for palette index list.
$8E00
Syntax
0x8E00, ushort controlcode, ushort patettenumber, longaddress imageaddress, byte imagesize
0x8E00, ushort controlcode, ushort patettenumber, longaddress imageaddress, byte imagesize
Set sprite assembly pointer and palette and configure DMA.
Argument 1: Sprite assembly pointer.
Argument 2: Palette index.
Argument 3: Sprite image address. (24 bits)
Argument 4: 1/64 of Sprite image size. (8 bits)