Prev: 54920 Up: Map Next: 55286
54985: Print Sprite
Input
A Sprite ID
BC Screen co-ordinates
PrintSprite 54985 LD (53780),A Write A to *53780.
54988 PUSH BC Stash BC on the stack.
54989 CALL InitialiseSprite Call InitialiseSprite.
54992 POP BC Restore BC from the stack.
54993 LD D,A D=A.
54994 LD A,(53831) A=*Flag_Orientation.
Moves the orientation flag into the carry flag.
54997 RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
54998 JP C,PrintSprite_Mirrored_0 Jump to PrintSprite_Mirrored_0 if the carry flag is set.
55001 EX AF,AF' Exchange the AF register with the shadow AF register.
55002 LD E,A E=A.
55003 LD L,C L=C.
55004 EXX Switch to the shadow registers.
55005 LD A,(HL) A=*HL.
55006 INC HL Increment HL by one.
55007 LD H,(HL) H=*HL.
55008 LD L,A L=A.
PrintSprite_0 55009 EXX Switch back to the normal registers.
55010 LD A,C Jump to PrintSprite_1 if C is not equal to L.
55011 CP L
55012 JP NZ,PrintSprite_1
55015 LD A,B A=B.
55016 AND %11111000 Keep only bits 3-7.
55018 ADD A,107 A+=107.
55020 LD H,A H=A.
55021 EX AF,AF' Exchange the AF register with the shadow AF register.
55022 LD A,B A=B.
55023 AND %00000111 Keep only bits 0-2.
55025 RRCA RRCA.
55026 RRCA
55027 RRCA
55028 ADD A,C A+=C.
55029 EXX Switch to the shadow registers.
55030 LD C,A C=A.
55031 EX AF,AF' Exchange the AF register with the shadow AF register.
55032 LD B,A B=A.
55033 JP PrintSprite_2 Jump to PrintSprite_2.
PrintSprite_1 55036 LD A,H A=H.
55037 EXX Switch back to the normal registers.
55038 INC C Increment C by one.
55039 LD B,A B=A.
PrintSprite_2 55040 EXX Switch to the shadow registers.
55041 LD A,C A=C.
55042 CP 32 Jump to PrintSprite_6 if A is higher than 32.
55044 JP NC,PrintSprite_6
55047 LD A,B A=B.
55048 CP 24 Jump to PrintSprite_6 if A is higher than 24.
55050 JP NC,PrintSprite_6
55053 EXX Switch back to the normal registers.
55054 LD A,(HL) Jump to PrintSprite_5 if *HL is equal to 54.
55055 CP 54
55057 JP Z,PrintSprite_5
55060 LD A,(DE) Jump to PrintSprite_8 if *DE is equal to 54.
55061 CP 54
55063 JP Z,PrintSprite_8
55066 INC HL Increment HL by one.
55067 INC DE Increment DE by one.
55068 LD A,(BC) A=*BC.
55069 AND (HL) Merge the bits from *HL.
55070 EX DE,HL Exchange the DE and HL registers.
55071 OR (HL) Set the bits from *HL.
55072 EX DE,HL Exchange the DE and HL registers.
55073 LD (BC),A Write A to *BC.
55074 INC DE Increment DE by one.
55075 INC HL Increment HL by one.
55076 INC B Increment B by one.
55077 LD A,(BC) A=*BC.
55078 AND (HL) Merge the bits from *HL.
55079 EX DE,HL Exchange the DE and HL registers.
55080 OR (HL) Set the bits from *HL.
55081 EX DE,HL Exchange the DE and HL registers.
55082 LD (BC),A Write A to *BC.
55083 INC DE Increment DE by one.
55084 INC HL Increment HL by one.
55085 INC B Increment B by one.
55086 LD A,(BC) A=*BC.
55087 AND (HL) Merge the bits from *HL.
55088 EX DE,HL Exchange the DE and HL registers.
55089 OR (HL) Set the bits from *HL.
55090 EX DE,HL Exchange the DE and HL registers.
55091 LD (BC),A Write A to *BC.
55092 INC DE Increment DE by one.
55093 INC HL Increment HL by one.
55094 INC B Increment B by one.
55095 LD A,(BC) A=*BC.
55096 AND (HL) Merge the bits from *HL.
55097 EX DE,HL Exchange the DE and HL registers.
55098 OR (HL) Set the bits from *HL.
55099 EX DE,HL Exchange the DE and HL registers.
55100 LD (BC),A Write A to *BC.
55101 INC DE Increment DE by one.
55102 INC HL Increment HL by one.
55103 INC B Increment B by one.
55104 LD A,(BC) A=*BC.
55105 AND (HL) Merge the bits from *HL.
55106 EX DE,HL Exchange the DE and HL registers.
55107 OR (HL) Set the bits from *HL.
55108 EX DE,HL Exchange the DE and HL registers.
55109 LD (BC),A Write A to *BC.
55110 INC DE Increment DE by one.
55111 INC HL Increment HL by one.
55112 INC B Increment B by one.
55113 LD A,(BC) A=*BC.
55114 AND (HL) Merge the bits from *HL.
55115 EX DE,HL Exchange the DE and HL registers.
55116 OR (HL) Set the bits from *HL.
55117 EX DE,HL Exchange the DE and HL registers.
55118 LD (BC),A Write A to *BC.
55119 INC DE Increment DE by one.
55120 INC HL Increment HL by one.
55121 INC B Increment B by one.
55122 LD A,(BC) A=*BC.
55123 AND (HL) Merge the bits from *HL.
55124 EX DE,HL Exchange the DE and HL registers.
55125 OR (HL) Set the bits from *HL.
55126 EX DE,HL Exchange the DE and HL registers.
55127 LD (BC),A Write A to *BC.
55128 INC DE Increment DE by one.
55129 INC HL Increment HL by one.
55130 INC B Increment B by one.
55131 LD A,(BC) A=*BC.
55132 AND (HL) Merge the bits from *HL.
55133 EX DE,HL Exchange the DE and HL registers.
55134 OR (HL) Set the bits from *HL.
55135 EX DE,HL Exchange the DE and HL registers.
55136 LD (BC),A Write A to *BC.
55137 CALL 55686 Call 55686.
PrintSprite_3 55140 INC DE Increment DE by one.
55141 INC HL Increment HL by one.
PrintSprite_4 55142 EXX Switch to the shadow registers.
55143 INC C Increment C by one.
55144 LD A,E Compare E with C...
55145 CP C
55146 EXX Switch back to the normal registers.
55147 JP NZ,PrintSprite_0 Jump to PrintSprite_0 if E is not equal to C on line 55144.
55150 EXX Switch to the shadow registers.
55151 LD C,L C=L.
55152 INC B Increment B by one.
55153 LD A,D Compare D with B...
55154 CP B
55155 EXX Switch back to the normal registers.
55156 JP NZ,PrintSprite_0 Jump to PrintSprite_0 if D is not equal to B on line 55153.
55159 RET Return.
PrintSprite_5 55160 LD A,(DE) Jump to PrintSprite_3 if *DE is equal to 54.
55161 CP 54
55163 JP Z,PrintSprite_3
55166 INC DE Increment DE by one.
55167 INC HL Increment HL by one.
55168 LD A,(DE) A=*DE.
55169 LD (BC),A Write A to *BC.
55170 INC DE Increment DE by one.
55171 INC B Increment B by one.
55172 LD A,(DE) A=*DE.
55173 LD (BC),A Write A to *BC.
55174 INC DE Increment DE by one.
55175 INC B Increment B by one.
55176 LD A,(DE) A=*DE.
55177 LD (BC),A Write A to *BC.
55178 INC DE Increment DE by one.
55179 INC B Increment B by one.
55180 LD A,(DE) A=*DE.
55181 LD (BC),A Write A to *BC.
55182 INC DE Increment DE by one.
55183 INC B Increment B by one.
55184 LD A,(DE) A=*DE.
55185 LD (BC),A Write A to *BC.
55186 INC DE Increment DE by one.
55187 INC B Increment B by one.
55188 LD A,(DE) A=*DE.
55189 LD (BC),A Write A to *BC.
55190 INC DE Increment DE by one.
55191 INC B Increment B by one.
55192 LD A,(DE) A=*DE.
55193 LD (BC),A Write A to *BC.
55194 INC DE Increment DE by one.
55195 INC B Increment B by one.
55196 LD A,(DE) A=*DE.
55197 LD (BC),A Write A to *BC.
55198 INC DE Increment DE by one.
55199 CALL 55686 Call 55686.
55202 JP PrintSprite_4 Jump to PrintSprite_4.
PrintSprite_6 55205 EXX Switch to the shadow registers.
55206 LD A,(DE) A=*DE.
55207 INC DE Increment DE by one.
55208 CP 54 Jump to PrintSprite_7 if A is equal to 54.
55210 JP Z,PrintSprite_7
55213 INC DE Increment DE by eight.
55214 INC DE
55215 INC DE
55216 INC DE
55217 INC DE
55218 INC DE
55219 INC DE
55220 INC DE
PrintSprite_7 55221 LD A,(HL) A=*HL.
55222 INC HL Increment HL by one.
55223 CP 54 Jump to PrintSprite_4 if A is equal to 54.
55225 JP Z,PrintSprite_4
55228 INC HL Increment HL by eight.
55229 INC HL
55230 INC HL
55231 INC HL
55232 INC HL
55233 INC HL
55234 INC HL
55235 INC HL
55236 JP PrintSprite_4 Jump to PrintSprite_4.
PrintSprite_8 55239 INC DE Increment DE by one.
55240 INC HL Increment HL by one.
55241 LD A,(BC) A=*BC.
55242 AND (HL) Merge the bits from *HL.
55243 LD (BC),A Write A to *BC.
55244 INC HL Increment HL by one.
55245 INC B Increment B by one.
55246 LD A,(BC) A=*BC.
55247 AND (HL) Merge the bits from *HL.
55248 LD (BC),A Write A to *BC.
55249 INC HL Increment HL by one.
55250 INC B Increment B by one.
55251 LD A,(BC) A=*BC.
55252 AND (HL) Merge the bits from *HL.
55253 LD (BC),A Write A to *BC.
55254 INC HL Increment HL by one.
55255 INC B Increment B by one.
55256 LD A,(BC) A=*BC.
55257 AND (HL) Merge the bits from *HL.
55258 LD (BC),A Write A to *BC.
55259 INC HL Increment HL by one.
55260 INC B Increment B by one.
55261 LD A,(BC) A=*BC.
55262 AND (HL) Merge the bits from *HL.
55263 LD (BC),A Write A to *BC.
55264 INC HL Increment HL by one.
55265 INC B Increment B by one.
55266 LD A,(BC) A=*BC.
55267 AND (HL) Merge the bits from *HL.
55268 LD (BC),A Write A to *BC.
55269 INC HL Increment HL by one.
55270 INC B Increment B by one.
55271 LD A,(BC) A=*BC.
55272 AND (HL) Merge the bits from *HL.
55273 LD (BC),A Write A to *BC.
55274 INC HL Increment HL by one.
55275 INC B Increment B by one.
55276 LD A,(BC) A=*BC.
55277 AND (HL) Merge the bits from *HL.
55278 LD (BC),A Write A to *BC.
55279 INC HL Increment HL by one.
55280 CALL 55686 Call 55686.
55283 JP PrintSprite_4 Jump to PrintSprite_4.
Prev: 54920 Up: Map Next: 55286