Prev: 44128 Up: Map Next: 44315
44253: Trim Object Sprite
Used by the routine at UpdateMapObjects.
Used for the object at IY if it is type 27 or has state zero, one, three, ten or twelve. Returns if the bottom three bits of the vertical position in 41430 are all set. Otherwise subtracts seven from that position and four from the number of rows in 41432 (and sets the number of rows to zero if the new position is below 24).
TrimObjectSprite 44253 LD A,(IY+0) Read offset 0 of IY.
44256 CP 27 Jump to TrimObjectSprite_Trim if A is 27.
44258 JR Z,TrimObjectSprite_Trim
44260 LD A,(IY+19) Read offset 19 of IY.
44263 AND %00001111 Keep the bits of A that are set in 15.
44265 JR Z,TrimObjectSprite_Trim Jump to TrimObjectSprite_Trim if the zero flag is set.
44267 CP 1 Jump to TrimObjectSprite_Trim if A is 1.
44269 JR Z,TrimObjectSprite_Trim
44271 CP 3 Jump to TrimObjectSprite_Trim if A is 3.
44273 JR Z,TrimObjectSprite_Trim
44275 CP 10 Jump to TrimObjectSprite_Trim if A is 10.
44277 JR Z,TrimObjectSprite_Trim
44279 CP 12 Return if A is not 12.
44281 RET NZ
TrimObjectSprite_Trim 44282 LD A,(41430) The vertical position of the second sprite.
44285 XOR %00000111 Flip the bits of A that are set in 7.
44287 AND %00000111 Keep the bits of A that are set in 7.
44289 RET Z Return if the zero flag is set.
44290 LD A,(41432) The rows of the second sprite.
44293 SUB 4 Subtract 4 from A.
44295 LD (41432),A The rows of the second sprite.
44298 LD A,(41430) The vertical position of the second sprite.
44301 SUB 7 Subtract 7 from A.
44303 CP 24 Jump to TrimObjectSprite_Store if A is 24 or more.
44305 JR NC,TrimObjectSprite_Store
44307 XOR A Clear A.
44308 LD (41432),A The rows of the second sprite.
TrimObjectSprite_Store 44311 LD (41430),A The vertical position of the second sprite.
44314 RET Return.
Prev: 44128 Up: Map Next: 44315