![]() |
Routines |
| Prev: 766D | Up: Map | Next: 76D0 |
|
Does the same as DrawOldSpriteRow_Aligned, but for the sprite prepared by PrepareActorSprite.
|
||||||||||||||||
|
The entry point for a sprite which is aligned to a character cell.
|
||||||||||||||||
| DrawActorSpriteRow_Aligned | 76AB | EX DE,HL | DE=the row of sprite data, and HL=the address of the next row. | |||||||||||||
| 76AC | EX (SP),HL | HL=the screen address, and the address of the next row of sprite data is stored on the stack. | ||||||||||||||
| 76AD | JR DrawSpriteRow_Write | Jump to DrawSpriteRow_Write. | ||||||||||||||
|
This entry point is used by the routine at XORSpriteLoop.
The entry point for a sprite which is not aligned to a character cell.
|
||||||||||||||||
| DrawActorSpriteRow | 76AF | PUSH HL | Stash the screen address on the stack. | |||||||||||||
| 76B0 | EX DE,HL | HL=the address of the sprite data, and DE=the screen address. | ||||||||||||||
| 76B1 | PUSH DE | Stash the screen address on the stack again. | ||||||||||||||
| 76B2 | LD D,(HL) | D=the first byte of the row. | ||||||||||||||
| 76B3 | INC HL | Move to the next byte of sprite data. | ||||||||||||||
| 76B4 | LD E,(HL) | E=the second byte of the row. | ||||||||||||||
| 76B5 | INC HL | Move on to the next row of sprite data. | ||||||||||||||
| 76B6 | EX DE,HL | HL=the row of sprite data, and DE=the address of the next row. | ||||||||||||||
| 76B7 | XOR A | A=00. | ||||||||||||||
|
Self modifying code; the operand of this command is written by 7598. It jumps into the sequence of shifts below, so that the row is moved right by the right number of pixels.
|
||||||||||||||||
| DrawActorSpriteRow_Shift | 76B8 | JR DrawActorSpriteRow_Shift | Jump to the first shift to do. | |||||||||||||
|
Shift the row left by up to seven bits; the bits which are shifted out of the row end up in A. The fourth shift is done with a longer command, but the jumps still land on the start of a shift.
|
||||||||||||||||
| 76BA | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 76BB | ADC A,A | |||||||||||||||
|
Shift the row left by up to seven bits; the bits which are shifted out of the row end up in A. The fourth shift is done with a longer command, but the jumps still land on the start of a shift.
|
||||||||||||||||
| 76BC | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 76BD | ADC A,A | |||||||||||||||
|
Shift the row left by up to seven bits; the bits which are shifted out of the row end up in A. The fourth shift is done with a longer command, but the jumps still land on the start of a shift.
|
||||||||||||||||
| 76BE | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 76BF | ADC A,A | |||||||||||||||
| 76C0 | ADC HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 76C2 | ADC A,A | |||||||||||||||
| 76C3 | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 76C4 | ADC A,A | |||||||||||||||
| 76C5 | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 76C6 | ADC A,A | |||||||||||||||
| 76C7 | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 76C8 | ADC A,A | |||||||||||||||
| 76C9 | EX DE,HL | DE=the shifted row, and HL=the address of the next row of sprite data. | ||||||||||||||
| 76CA | EX (SP),HL | HL=the screen address, and the address of the next row of sprite data is stored on the stack. | ||||||||||||||
| 76CB | XOR (HL) | Exclusive OR the first byte (in A) onto the screen. | ||||||||||||||
| 76CC | LD (HL),A | Write the result to the screen. | ||||||||||||||
| 76CD | INC L | Move to the next byte on the screen. | ||||||||||||||
| 76CE | JR DrawSpriteRow_Write | Jump to DrawSpriteRow_Write. | ||||||||||||||
| Prev: 766D | Up: Map | Next: 76D0 |