Prev: 832F Up: Map Next: 83AD
8395: Select the graphic for Monty
Used by the routines at 8A0A and 8A63.
Input
A Frame number ( 0 - 3)
DE Base address of graphics
HL On exit, points to the graphic to draw in screen.
8395 LD L,A Put the frame number in HL.
8396 LD H,$00
8398 ADD HL,HL Multiply by 32 to get a screen offset.
8399 ADD HL,HL
839A ADD HL,HL
839B ADD HL,HL
839C ADD HL,HL
839D ADD HL,DE Add the base address
839E LD A,($832E) Get the last input data.
83A1 AND $03 Ignore anything without the direction flags.
83A3 EX DE,HL Remember the base address.
83A4 LD H,A Put the position in HL.
83A5 LD L,$00
83A7 SRL H Convert this into an offset from the graphic table.
83A9 RR L
83AB ADD HL,DE Combine this to point to the correct graphic and return.
83AC RET
Prev: 832F Up: Map Next: 83AD