Prev: 39081 Up: Map Next: 39175
39125: Draw odd ball to screen
Used by the routine at 35993.
Input
A Frame number (32, 116, 117, 118 or 119)
39125 PUSH HL Store HL
39126 LD DE,64500 Point DE at 64500
39129 ADD A,A Double A...
39130 LD H,0 ...load into HL...
39132 LD L,A ...
39133 ADD HL,HL ...double again...
39134 ADD HL,HL ...and again to get 8 times original A value...
39135 ADD HL,DE ...and add DE to this
At this point, HL points to one of the five sets of Odd Ball frame graphic data (64756, 65428, 65436, 65444 or 65452).
39136 EX DE,HL Swap so DE now points to an Odd Ball graphic and HL holds 64500
39137 PUSH DE Copy DE into IX...
39138 POP IX ...
39140 LD BC,(23677) Load value in coordinate storage into BC (holds x- and y-coordinates of Odd Ball)
39144 CALL 8874 Load HL with display file address and A with the location of that pixel within the byte for the pixel at coordinates BC
39147 LD C,A Load pixel-within-byte "address" into C
39148 LD B,8 Load 8 into B (as Odd Ball graphic data comprises 8 pixel rows)
39150 LD D,(IX+0) Load a byte of Odd Ball graphic data into D
39153 CALL 39175 Shift Odd Ball graphic data right by C pixels and load into D (LHS) and A' (RHS)
39156 LD A,D Load left part of Odd Ball graphic data into A
39157 LD E,(HL) Load E with graphic data currently at Odd Ball's position on screen
39158 XOR E Blend Odd Ball graphic data with what is already on screen at its position to make things look more natural...
39159 LD (HL),A ...and write new graphic data back to screen
39160 INC HL Advance right one byte in display file
39161 EX AF,AF' Switch registers to restore right part of Odd Ball graphic data to A
39162 LD E,(HL) Load E with graphic data currently at Odd Ball's position on screen
39163 XOR E Blend Odd Ball graphic data with what is already on screen at its position to make things look more natural...
39164 LD (HL),A ...and write new graphic data back to screen
39165 DEC HL Move left one byte in display file
39166 INC IX Advance IX to next row of Odd Ball graphic data
39168 CALL 39200 Advance HL down one pixel row in display file
39171 DJNZ 39150 Loop back to draw next row of Odd Ball data
39173 POP HL Restore HL
39174 RET Return
Prev: 39081 Up: Map Next: 39175