Prev: $36E3 Up: Map Next: $379F
$3724: Set up sprites #1-#5
Used by the routine at $2043.
Input
($9B) Bits 0-7 of the base x-coordinate
($9C) The sprites' y-coordinate
$3724 LDA $9C Add 52 to the y-coordinate.
$3726 CLC
$3727 ADC #$34
$3729 STA $D003 Set the y-coordinates of sprites #1-#5.
$372C STA $D005
$372F STA $D007
$3732 STA $D009
$3735 STA $D00B
$3738 LDA $D010 Pick up bit 8 of the sprites' x-coordinates.
$373B BNE $3742 Branch unless they're all zero.
$373D LDA #$00 Reset bit 8 of every sprite's x-coordinate.
$373F STA $D010
$3742 LDA $9B Set the x-coordinates of sprites #1 and #4 (bits 0-7).
$3744 STA $D002
$3747 STA $D008
$374A CLC Add 16 to the base x-coordinate.
$374B ADC #$10
$374D STA $D00A Set the x-coordinate of sprite #5 (bits 0-7).
$3750 BCC $375A Branch unless the x-coordinate is greater than 255.
$3752 LDA #$2C Set bit 8 of the x-coordinates of sprites #2, #3 and #5.
$3754 ORA $D010
$3757 STA $D010
$375A LDA $D00A Pick up bits 0-7 of the x-coordinate of sprite #5 and add 8.
$375D CLC
$375E ADC #$08
$3760 STA $D004 Set the x-coordinate of sprite #2 (bits 0-7).
$3763 BCC $376D Branch unless this x-coordinate is greater than 255.
$3765 LDA #$0C Set bit 8 of the x-coordinates of sprites #2 and #3.
$3767 ORA $D010
$376A STA $D010
$376D LDA $D004 Pick up the x-coordinate of sprite #2 (bits 0-7) and add 24.
$3770 CLC
$3771 ADC #$18
$3773 STA $D006 Set the x-coordinate of sprite #3 (bits 0-7).
$3776 BCC $3780 Branch unless this x-coordinate is greater than 255.
$3778 LDA #$08 Set bit 8 of the x-coordinate of sprite #3.
$377A ORA $D010
$377D STA $D010
$3780 LDA #$30 Stretch sprites #4 and #5 to double width.
$3782 STA $D01D
$3785 LDA #$2B Set the pointer for sprite #1 to $2B. This points at $CAC0.
$3787 STA $CFF9
$378A LDA #$2C Set the pointer for sprite #2 to $2C. This points at $CB00.
$378C STA $CFFA
$378F LDA #$2D Set the pointer for sprite #3 to $2D. This points at $CB40.
$3791 STA $CFFB
$3794 LDA #$2E Set the pointer for sprite #4 to $2E. This points at $CB80.
$3796 STA $CFFC
$3799 LDA #$2F Set the pointer for sprite #5 to $2F. This points at $CBC0.
$379B STA $CFFD
$379E RTS
Prev: $36E3 Up: Map Next: $379F