Routines |
Prev: 56039 | Up: Map | Next: 56412 |
Used by the routine at DemoEntryPoint.
|
||||||
Takes the generated image at Buffer_Image, and creates a preview image from it.
|
||||||
Print_HelperPreviewImage | 56190 | LD B,4 | Set the initial X co-ordinate in B. | |||
56192 | LD C,22 | Set the initial Y co-ordinate in C. | ||||
Print_HelperPreviewImage_0 | 56194 | PUSH BC | Stash the co-ordinates on the stack. | |||
56195 | CALL Calculate_ScreenBlockAddress | Call Calculate_ScreenBlockAddress. | ||||
56198 | LD B,8 | Set a counter in B for 8. | ||||
Print_HelperPreviewImage_1 | 56200 | PUSH BC | Stash the counter on the stack. | |||
56201 | LD B,10 | Set a counter in B for 10. | ||||
56203 | PUSH HL | Stash the screen buffer address pointer on the stack. | ||||
Print_HelperPreviewImage_2 | 56204 | LD (HL),0 | Write 0 to *HL. | |||
56206 | INC HL | Increment the screen buffer address pointer by one. | ||||
56207 | DJNZ Print_HelperPreviewImage_2 | Decrease the counter by one and loop back to Print_HelperPreviewImage_2 until the counter is zero. | ||||
56209 | POP HL | Restore the original screen buffer address from the stack. | ||||
56210 | INC H | Move down one line. | ||||
56211 | POP BC | Restore the counter from the stack. | ||||
56212 | DJNZ Print_HelperPreviewImage_1 | Decrease the counter by one and loop back to Print_HelperPreviewImage_1 until the counter is zero. | ||||
56214 | POP BC | Restore the original co-ordinates from the stack. | ||||
56215 | INC B | Increment B by one. | ||||
56216 | LD A,12 | Jump to Print_HelperPreviewImage_0 if B is not equal to 12. | ||||
56218 | CP B | |||||
56219 | JR NZ,Print_HelperPreviewImage_0 | |||||
56221 | LD A,176 | Write 176 to *56186. | ||||
56223 | LD (56186),A | |||||
56226 | LD A,32 | Write 32 to *56187. | ||||
56228 | LD (56187),A | |||||
56231 | LD HL,41187 | Write Buffer_Image to *56188. | ||||
56234 | LD (56188),HL | |||||
56237 | LD B,64 | B=64. | ||||
Print_HelperPreviewImage_3 | 56239 | PUSH BC | Stash BC on the stack. | |||
56240 | LD A,(56186) | H=*56186. | ||||
56243 | LD H,A | |||||
56244 | LD A,(56187) | L=*56187. | ||||
56247 | LD L,A | |||||
56248 | CALL 56412 | Call 56412. | ||||
56251 | PUSH DE | Load the screen buffer address into IX (using the stack). | ||||
56252 | POP IX | |||||
56254 | LD B,2 | Set a counter in B for 2. | ||||
Print_HelperPreviewImage_4 | 56256 | PUSH BC | Stash the counter and the screen buffer address on the stack. | |||
56257 | PUSH IX | |||||
56259 | LD HL,(56188) | HL=*56188. | ||||
56262 | LD B,10 | B=10. | ||||
Print_HelperPreviewImage_5 | 56264 | XOR A | A=0. | |||
56265 | LD D,(HL) | D=*HL. | ||||
56266 | INC HL | Increment HL by one. | ||||
56267 | LD E,(HL) | E=*HL. | ||||
56268 | INC HL | Increment HL by one. | ||||
56269 | CALL Print_HelperPreviewImage_6 | Call Print_HelperPreviewImage_6. | ||||
56272 | LD D,(IX+0) | D=*IX+0. | ||||
56275 | OR D | Set the bits from D. | ||||
56276 | LD (IX+0),A | Write A to *IX+0. | ||||
56279 | INC IX | Increment IX by one. | ||||
56281 | DJNZ Print_HelperPreviewImage_5 | Decrease counter by one and loop back to Print_HelperPreviewImage_5 until counter is zero. | ||||
56283 | POP IX | Restore IX from the stack. | ||||
56285 | LD (56188),HL | Write HL to *56188. | ||||
56288 | POP BC | Restore BC from the stack. | ||||
56289 | DJNZ Print_HelperPreviewImage_4 | Decrease counter by one and loop back to Print_HelperPreviewImage_4 until counter is zero. | ||||
56291 | LD HL,56187 | HL=56187. | ||||
56294 | INC (HL) | Increment *HL by one. | ||||
56295 | POP BC | Restore BC from the stack. | ||||
56296 | DJNZ Print_HelperPreviewImage_3 | Decrease counter by one and loop back to Print_HelperPreviewImage_3 until counter is zero. | ||||
56298 | RET | Return. | ||||
Magic.
|
||||||
Print_HelperPreviewImage_6 | 56299 | RLC D | Rotate D left (through the carry flag). | |||
56301 | JP NC,Print_HelperPreviewImage_7 | Jump to Print_HelperPreviewImage_7 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56304 | OR %10000000 | Set bit 7. | ||||
Print_HelperPreviewImage_7 | 56306 | RLC D | Rotate D left (through the carry flag). | |||
56308 | JP NC,Print_HelperPreviewImage_8 | Jump to Print_HelperPreviewImage_8 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56311 | OR %10000000 | Set bit 7. | ||||
Print_HelperPreviewImage_8 | 56313 | RLC D | Rotate D left (through the carry flag). | |||
56315 | JP NC,Print_HelperPreviewImage_9 | Jump to Print_HelperPreviewImage_9 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56318 | OR %01000000 | Set bit 6. | ||||
Print_HelperPreviewImage_9 | 56320 | RLC D | Rotate D left (through the carry flag). | |||
56322 | JP NC,Print_HelperPreviewImage_10 | Jump to Print_HelperPreviewImage_10 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56325 | OR %01000000 | Set bit 6. | ||||
Print_HelperPreviewImage_10 | 56327 | RLC D | Rotate D left (through the carry flag). | |||
56329 | JP NC,Print_HelperPreviewImage_11 | Jump to Print_HelperPreviewImage_11 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56332 | OR %00100000 | Set bit 5. | ||||
Print_HelperPreviewImage_11 | 56334 | RLC D | Rotate D left (through the carry flag). | |||
56336 | JP NC,Print_HelperPreviewImage_12 | Jump to Print_HelperPreviewImage_12 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56339 | OR %00100000 | Set bit 5. | ||||
Print_HelperPreviewImage_12 | 56341 | RLC D | Rotate D left (through the carry flag). | |||
56343 | JP NC,Print_HelperPreviewImage_13 | Jump to Print_HelperPreviewImage_13 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56346 | OR %00010000 | Set bit 4. | ||||
Print_HelperPreviewImage_13 | 56348 | RLC D | Rotate D left (through the carry flag). | |||
56350 | JP NC,Print_HelperPreviewImage_14 | Jump to Print_HelperPreviewImage_14 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56353 | OR %00010000 | Set bit 4. | ||||
Print_HelperPreviewImage_14 | 56355 | RLC E | Rotate E left (through the carry flag). | |||
56357 | JP NC,Print_HelperPreviewImage_15 | Jump to Print_HelperPreviewImage_15 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56360 | OR %00001000 | Set bit 3. | ||||
Print_HelperPreviewImage_15 | 56362 | RLC E | Rotate E left (through the carry flag). | |||
56364 | JP NC,Print_HelperPreviewImage_16 | Jump to Print_HelperPreviewImage_16 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56367 | OR %00001000 | Set bit 3. | ||||
Print_HelperPreviewImage_16 | 56369 | RLC E | Rotate E left (through the carry flag). | |||
56371 | JP NC,Print_HelperPreviewImage_17 | Jump to Print_HelperPreviewImage_17 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56374 | OR %00000100 | Set bit 2. | ||||
Print_HelperPreviewImage_17 | 56376 | RLC E | Rotate E left (through the carry flag). | |||
56378 | JP NC,Print_HelperPreviewImage_18 | Jump to Print_HelperPreviewImage_18 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56381 | OR %00000100 | Set bit 2. | ||||
Print_HelperPreviewImage_18 | 56383 | RLC E | Rotate E left (through the carry flag). | |||
56385 | JP NC,Print_HelperPreviewImage_19 | Jump to Print_HelperPreviewImage_19 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56388 | OR %00000010 | Set bit 1. | ||||
Print_HelperPreviewImage_19 | 56390 | RLC E | Rotate E left (through the carry flag). | |||
56392 | JP NC,Print_HelperPreviewImage_20 | Jump to Print_HelperPreviewImage_20 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56395 | OR %00000010 | Set bit 1. | ||||
Print_HelperPreviewImage_20 | 56397 | RLC E | Rotate E left (through the carry flag). | |||
56399 | JP NC,Print_HelperPreviewImage_21 | Jump to Print_HelperPreviewImage_21 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56402 | OR %00000001 | Set bit 0. | ||||
Print_HelperPreviewImage_21 | 56404 | RLC E | Rotate E left (through the carry flag). | |||
56406 | JP NC,Print_HelperPreviewImage_22 | Jump to Print_HelperPreviewImage_22 if the carry flag isn't set (if the leftmost bit was 0). | ||||
56409 | OR %00000001 | Set bit 0. | ||||
Print_HelperPreviewImage_22 | 56411 | RET | Return. |
Prev: 56039 | Up: Map | Next: 56412 |