Prev: 26965 Up: Map Next: 27029
27005: Copy alien UDG data to a screen row
Each row of aliens has 11 of them. This populates the graphics used to render a row. It builds the data structure at _ALIEN_ROWS_DATA.
It enters with IX pointing to the alien row data. It populates 22 bytes of UDG data which is 2 bytes side-by-side on one screen scan, for 11 aliens. All 11 aliens are set up the same, so that's one scan for one row. It then moves down one scan of the source alien graphic data and repeats. Alien data is at _RED_ALIEN_LOOK_LEFT, which shows that each alien is make up of 2 sprites, one looking left, one looking right. That's 16 scans for the graphic, twice. The whole lot is copied, so 32 times in total. 22*32 is 704 bytes.
Used by the routine at init_alien_row_data.
Input
HL Alien data
IX Alien row data
Output
IX incremented by 704
populate_alien_row_udgs 27005 LD C,32 2 UDGs which are 16 scans high, so 32 reps
populate_alien_row_udgs_0 27007 LD E,(HL) Load DE from 2 bytes of alien scan data
27008 INC HL
27009 LD D,(HL)
27010 INC HL
27011 LD B,11 Copy that pair of bytes repeatedly, 11 times, into the location pointed to by IX.
populate_alien_row_udgs_1 27013 LD (IX+0),E
27016 INC IX
27018 LD (IX+0),D
27021 INC IX
27023 DJNZ populate_alien_row_udgs_1
27025 DEC C Repeat 32 times
27026 JR NZ,populate_alien_row_udgs_0
27028 RET
Prev: 26965 Up: Map Next: 27029