Prev: 93FE Up: Map Next: 9438
9404: Return the display file address of a sprite
Used by the routine at 929C.
Input
HL On input, Y and X co-ordinates. On output, the display file address
9404 PUSH AF
9405 PUSH DE
9406 PUSH BC
9407 EX DE,HL
9408 LD HL,$4000
940B LD BC,$0800
940E LD A,D
940F CP $80
9411 JR NC,$9419
9413 CP $40
9415 JR NC,$9418
9417 ADD HL,BC
9418 ADD HL,BC
9419 AND $38
941B LD C,A
941C LD A,$38
941E SUB C
941F SLA A
9421 SLA A
9423 LD B,$00
9425 LD C,A
9426 ADD HL,BC
9427 LD A,D
9428 AND $07
942A XOR $07
942C LD D,A
942D SRL E
942F SRL E
9431 SRL E
9433 ADD HL,DE
9434 POP BC
9435 POP DE
9436 POP AF
9437 RET
Prev: 93FE Up: Map Next: 9438