![]() |
Routines |
| Prev: 30317 | Up: Map | Next: 30416 |
|
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 | 30379 | EX DE,HL | DE=the row of sprite data, and HL=the address of the next row. | |||||||||||||
| 30380 | EX (SP),HL | HL=the screen address, and the address of the next row of sprite data is stored on the stack. | ||||||||||||||
| 30381 | 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 | 30383 | PUSH HL | Stash the screen address on the stack. | |||||||||||||
| 30384 | EX DE,HL | HL=the address of the sprite data, and DE=the screen address. | ||||||||||||||
| 30385 | PUSH DE | Stash the screen address on the stack again. | ||||||||||||||
| 30386 | LD D,(HL) | D=the first byte of the row. | ||||||||||||||
| 30387 | INC HL | Move to the next byte of sprite data. | ||||||||||||||
| 30388 | LD E,(HL) | E=the second byte of the row. | ||||||||||||||
| 30389 | INC HL | Move on to the next row of sprite data. | ||||||||||||||
| 30390 | EX DE,HL | HL=the row of sprite data, and DE=the address of the next row. | ||||||||||||||
| 30391 | XOR A | A=0. | ||||||||||||||
|
Self modifying code; the operand of this command is written by 30104. It jumps into the sequence of shifts below, so that the row is moved right by the right number of pixels.
|
||||||||||||||||
| DrawActorSpriteRow_Shift | 30392 | 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.
|
||||||||||||||||
| 30394 | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 30395 | 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.
|
||||||||||||||||
| 30396 | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 30397 | 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.
|
||||||||||||||||
| 30398 | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 30399 | ADC A,A | |||||||||||||||
| 30400 | ADC HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 30402 | ADC A,A | |||||||||||||||
| 30403 | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 30404 | ADC A,A | |||||||||||||||
| 30405 | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 30406 | ADC A,A | |||||||||||||||
| 30407 | ADD HL,HL | Shift HL left by one, moving the bit shifted out into A. | ||||||||||||||
| 30408 | ADC A,A | |||||||||||||||
| 30409 | EX DE,HL | DE=the shifted row, and HL=the address of the next row of sprite data. | ||||||||||||||
| 30410 | EX (SP),HL | HL=the screen address, and the address of the next row of sprite data is stored on the stack. | ||||||||||||||
| 30411 | XOR (HL) | Exclusive OR the first byte (in A) onto the screen. | ||||||||||||||
| 30412 | LD (HL),A | Write the result to the screen. | ||||||||||||||
| 30413 | INC L | Move to the next byte on the screen. | ||||||||||||||
| 30414 | JR DrawSpriteRow_Write | Jump to DrawSpriteRow_Write. | ||||||||||||||
| Prev: 30317 | Up: Map | Next: 30416 |