Prev: 9AE1 Up: Map Next: 9B4D
9AE5: Draw explosion for FINAL BOSS
Used by the routine at 99E3.
9AE5 PUSH DE Save DE
9AE6 LD A,($A248) Set A to the x-position of explosion
9AE9 AND $07 Set A to the bit position of the explosion (bits2-0) {
9AEB LD E,A Set HL to the address pointer of offset for sprite movement
9AEC LD D,$00
9AEE ADD HL,DE
9AEF LD E,(HL) Set DE to the corresponding offset based on the position of the sprite
9AF0 LD D,$00
9AF2 POP HL Recover HL (graphics data of the sprite)
9AF3 ADD HL,DE Set HL to the address of the corresponding sprite based on the offset
9AF4 LD A,($A248) Computes at HL the address into room graphic data buffer for the entity
9AF7 SRL A
9AF9 SRL A
9AFB SRL A
9AFD LD ($A248),A
9B00 PUSH HL
9B01 LD A,($A249)
9B04 LD L,A
9B05 LD H,$00
9B07 ADD HL,HL
9B08 ADD HL,HL
9B09 ADD HL,HL
9B0A ADD HL,HL
9B0B ADD HL,HL
9B0C LD DE,$E8FF
9B0F ADD HL,DE
9B10 LD A,($A248)
9B13 LD E,A
9B14 LD D,$00
9B16 ADD HL,DE
9B17 EX DE,HL Exchange DE and HL
9B18 POP HL Recover HL (the address of the corresponding sprite based on the offset)
9B19 PUSH DE Save DE
9B1A LD A,($A24A) Set A to the width of the sprite (in bytes)
9B1D LD ($9B3D),A Configure LD opcode at 9B3C to set B register to the width of the sprite
9B20 LD A,($A24B) Set A to the height of the sprite (in pixels)
9B23 LD ($9B39),A Configure LD opcode at 9B38 to set B register to the height of the sprite
9B26 EX DE,HL Exchange DE and HL
9B27 LD A,($A1CC) Check bit for Graphic Data Select
9B2A BIT 7,A
9B2C JP Z,$9B33 Jump if graphic data is based in animation offsets
9B2F LD DE,($A1CD) Set DE to the graphic data for static (non animated) sprite
Draw the sprite
9B33 LD ($A25E),DE
9B37 POP HL Restore HL
9B38 LD B,$00 Set B to the width of the sprite
9B3A PUSH BC Save BC and HL
9B3B PUSH HL
9B3C LD B,$00 Set B to the height of the sprite
9B3E LD A,(DE) Set A to the graphic data to copy
9B3F LD (HL),A Copy graphics data to the room buffer
9B40 INC DE Increment sprite graphic data and room graphic data destination
9B41 INC HL
9B42 DJNZ $9B3E Jump back if the are more sprite rows o draw
9B44 POP HL Restore HL
9B45 LD BC,$0020 Increment one row for the room graphic data
9B48 ADD HL,BC
9B49 POP BC Restore BC
9B4A DJNZ $9B3A Jump back until all rows drawn
9B4C RET
Prev: 9AE1 Up: Map Next: 9B4D