Prev: B7F5 Up: Map Next: B82A
B804: Place Scene Objects
Used by the routine at GameOver.
Places the objects of an ending scene in the table of objects, starting at PlayerBottomObject. Each is described by five bytes: the sprite number, the flags, the colour, the pixel x position and the pixel y position. The list ends with a sprite number of zero.
Input
DE Address of the list of objects
Start at the first object.
PlaceSceneObjects B804 LD IY,$5B88 Point IY at PlayerBottomObject.
B808 LD BC,$0020 Set the size of an object record to 20.
Copy the next object, or return at the terminator.
PlaceSceneObjects_NextObject B80B LD A,(DE) Fetch the sprite number.
B80C INC DE Move on.
B80D AND A Return if the list has ended.
B80E RET Z
B80F LD (IY+$00),A Set the sprite number of the object.
B812 LD A,(DE) Fetch the flags.
B813 INC DE Move on.
B814 LD (IY+$07),A Set the flags of the object.
B817 LD A,(DE) Fetch the colour.
B818 INC DE Move on.
B819 LD (IY+$10),A Set the colour of the object.
B81C LD A,(DE) Fetch the pixel x position.
B81D INC DE Move on.
B81E LD (IY+$1A),A Set the pixel x position of the object.
B821 LD A,(DE) Fetch the pixel y position.
B822 INC DE Move on.
B823 LD (IY+$1B),A Set the pixel y position of the object.
B826 ADD IY,BC Move on to the next object.
B828 JR PlaceSceneObjects_NextObject Jump to PlaceSceneObjects_NextObject.
Prev: B7F5 Up: Map Next: B82A