![]() |
Routines |
| Prev: CB24 | Up: Map | Next: CB60 |
|
Used by the routines at HandleOutlaw and HandleSheriff.
Chooses the sprite numbers for a figure of three sprites, from the walking frame and FigureSpriteNumbers. Bit 2 of the walking frame chooses the second set. Types other than 01 and 0A use a horse for the middle sprite.
|
||||||||||||||||||||
|
Fetch the lower and middle sprites from FigureSpriteNumbers.
|
||||||||||||||||||||
| ChooseFigureSprites | CB29 | LD L,(IX+$0C) | Fetch the walking frame into HL. | |||||||||||||||||
| CB2C | LD H,$00 | |||||||||||||||||||
| CB2E | ADD HL,HL | Double it. | ||||||||||||||||||
| CB2F | LD BC,$C967 | Point BC at FigureSpriteNumbers. | ||||||||||||||||||
| CB32 | ADD HL,BC | Find the entry. | ||||||||||||||||||
| CB33 | LD E,(HL) | Fetch the lower and middle sprites. | ||||||||||||||||||
| CB34 | INC HL | |||||||||||||||||||
| CB35 | LD D,(HL) | |||||||||||||||||||
|
Choose the vertical offsets from bit 2 of the walking frame.
|
||||||||||||||||||||
| CB36 | LD A,(IX+$0C) | Fetch the walking frame. | ||||||||||||||||||
| CB39 | BIT 2,A | Test bit 2. | ||||||||||||||||||
| CB3B | LD BC,$1A0F | Use 1A for the top and 0F for the middle. | ||||||||||||||||||
| CB3E | JR NZ,ChooseFigureSprites_Top | Jump to ChooseFigureSprites_Top if bit 2 is set. | ||||||||||||||||||
| CB40 | LD BC,$190D | Use 19 for the top and 0D for the middle. | ||||||||||||||||||
|
Make the top sprite 0E or 0F.
|
||||||||||||||||||||
| ChooseFigureSprites_Top | CB43 | RRCA | Move bit 2 into bit 0. | |||||||||||||||||
| CB44 | RRCA | |||||||||||||||||||
| CB45 | AND %00000001 | Keep only that bit. | ||||||||||||||||||
| CB47 | ADD A,$0E | Add 0E. | ||||||||||||||||||
| CB49 | EX AF,AF' | Keep it in A'. | ||||||||||||||||||
|
Types 01 and 0A keep these sprites.
|
||||||||||||||||||||
| CB4A | LD A,(IX+$00) | Fetch the type. | ||||||||||||||||||
| CB4D | CP $01 | Return if the type is 01. | ||||||||||||||||||
| CB4F | RET Z | |||||||||||||||||||
| CB50 | CP $0A | Return if the type is 0A. | ||||||||||||||||||
| CB52 | RET Z | |||||||||||||||||||
|
Use a horse for the middle sprite.
|
||||||||||||||||||||
| CB53 | LD BC,$1909 | Use 19 for the top and 09 for the middle. | ||||||||||||||||||
| CB56 | LD A,D | Fetch the middle sprite. | ||||||||||||||||||
| CB57 | SUB $17 | Subtract 17. | ||||||||||||||||||
| CB59 | RRCA | Move bit 1 into bit 0. | ||||||||||||||||||
| CB5A | AND %00000001 | Keep only that bit. | ||||||||||||||||||
| CB5C | ADD A,$34 | Add 34. | ||||||||||||||||||
| CB5E | LD D,A | Set the middle sprite and return. | ||||||||||||||||||
| CB5F | RET | |||||||||||||||||||
| Prev: CB24 | Up: Map | Next: CB60 |