Prev: DD6F Up: Map Next: DE51
DD73: Print Helper Preview Image
Used by the routine at Game_Loop.
Takes the generated image at Buffer_Image, and creates a preview image from it.
Level 01 Level 02 Level 03
helper-image-$5B00 helper-image-$6182 helper-image-$6AFF
Level 04 Level 05 Level 06
helper-image-$730A helper-image-$783C helper-image-$7CFD
Level 07 Level 08 Level 09
helper-image-$8106 helper-image-$89D2 helper-image-$9110
Marilyn Monroe has no preview image, but if she did, it would look like this:
Level 0A
helper-image-$9772
Print_HelperPreviewImage DD73 LD B,$04 Set the initial X co-ordinate in B.
DD75 LD C,$16 Set the initial Y co-ordinate in C.
Print_HelperPreviewImage_0 DD77 PUSH BC Stash the co-ordinates on the stack.
DD78 CALL Calculate_ScreenBlockAddress Call Calculate_ScreenBlockAddress.
DD7B LD B,$08 Set a counter in B for 08.
Print_HelperPreviewImage_1 DD7D PUSH BC Stash the counter on the stack.
DD7E LD B,$0A Set a counter in B for 0A.
DD80 PUSH HL Stash the screen buffer address pointer on the stack.
Print_HelperPreviewImage_2 DD81 LD (HL),$00 Write 00 to *HL.
DD83 INC HL Increment the screen buffer address pointer by one.
DD84 DJNZ Print_HelperPreviewImage_2 Decrease the counter by one and loop back to Print_HelperPreviewImage_2 until the counter is zero.
DD86 POP HL Restore the original screen buffer address from the stack.
DD87 INC H Move down one line.
DD88 POP BC Restore the counter from the stack.
DD89 DJNZ Print_HelperPreviewImage_1 Decrease the counter by one and loop back to Print_HelperPreviewImage_1 until the counter is zero.
DD8B POP BC Restore the original co-ordinates from the stack.
DD8C INC B Increment B by one.
DD8D LD A,$0C Jump to Print_HelperPreviewImage_0 if B is not equal to 0C.
DD8F CP B
DD90 JR NZ,Print_HelperPreviewImage_0
DD92 LD A,$B0 Write B0 to *Temp_X_Coordinate.
DD94 LD ($DD6F),A
DD97 LD A,$20 Write 20 to *Temp_Y_Coordinate.
DD99 LD ($DD70),A
DD9C LD HL,$A0E3 Write Buffer_Image to *Temp_SourceAddress.
DD9F LD ($DD71),HL
DDA2 LD B,$40 B=40.
Print_HelperPreviewImage_3 DDA4 PUSH BC Stash BC on the stack.
DDA5 LD A,($DD6F) H=*Temp_X_Coordinate.
DDA8 LD H,A
DDA9 LD A,($DD70) L=*Temp_Y_Coordinate.
DDAC LD L,A
DDAD CALL CalculateScreenAddress Call CalculateScreenAddress.
DDB0 PUSH DE Load the screen buffer address into IX (using the stack).
DDB1 POP IX
DDB3 LD B,$02 Set a counter in B for 02.
Print_HelperPreviewImage_4 DDB5 PUSH BC Stash the counter and the screen buffer address on the stack.
DDB6 PUSH IX
DDB8 LD HL,($DD71) HL=*Temp_SourceAddress.
DDBB LD B,$0A B=0A.
Print_HelperPreviewImage_5 DDBD XOR A A=00.
DDBE LD D,(HL) D=*HL.
DDBF INC HL Increment HL by one.
DDC0 LD E,(HL) E=*HL.
DDC1 INC HL Increment HL by one.
DDC2 CALL Print_HelperPreviewImage_6 Call Print_HelperPreviewImage_6.
DDC5 LD D,(IX+$00) D=*IX+00.
DDC8 OR D Set the bits from D.
DDC9 LD (IX+$00),A Write A to *IX+00.
DDCC INC IX Increment IX by one.
DDCE DJNZ Print_HelperPreviewImage_5 Decrease counter by one and loop back to Print_HelperPreviewImage_5 until counter is zero.
DDD0 POP IX Restore IX from the stack.
DDD2 LD ($DD71),HL Write HL to *Temp_SourceAddress.
DDD5 POP BC Restore BC from the stack.
DDD6 DJNZ Print_HelperPreviewImage_4 Decrease counter by one and loop back to Print_HelperPreviewImage_4 until counter is zero.
DDD8 LD HL,$DD70 HL=Temp_Y_Coordinate.
DDDB INC (HL) Increment *HL by one.
DDDC POP BC Restore BC from the stack.
DDDD DJNZ Print_HelperPreviewImage_3 Decrease counter by one and loop back to Print_HelperPreviewImage_3 until counter is zero.
DDDF RET Return.
Magic.
Print_HelperPreviewImage_6 DDE0 RLC D Rotate D left (through the carry flag).
DDE2 JP NC,Print_HelperPreviewImage_7 Jump to Print_HelperPreviewImage_7 if the carry flag isn't set (if the leftmost bit was 0).
DDE5 OR %10000000 Set bit 7.
Print_HelperPreviewImage_7 DDE7 RLC D Rotate D left (through the carry flag).
DDE9 JP NC,Print_HelperPreviewImage_8 Jump to Print_HelperPreviewImage_8 if the carry flag isn't set (if the leftmost bit was 0).
DDEC OR %10000000 Set bit 7.
Print_HelperPreviewImage_8 DDEE RLC D Rotate D left (through the carry flag).
DDF0 JP NC,Print_HelperPreviewImage_9 Jump to Print_HelperPreviewImage_9 if the carry flag isn't set (if the leftmost bit was 0).
DDF3 OR %01000000 Set bit 6.
Print_HelperPreviewImage_9 DDF5 RLC D Rotate D left (through the carry flag).
DDF7 JP NC,Print_HelperPreviewImage_10 Jump to Print_HelperPreviewImage_10 if the carry flag isn't set (if the leftmost bit was 0).
DDFA OR %01000000 Set bit 6.
Print_HelperPreviewImage_10 DDFC RLC D Rotate D left (through the carry flag).
DDFE JP NC,Print_HelperPreviewImage_11 Jump to Print_HelperPreviewImage_11 if the carry flag isn't set (if the leftmost bit was 0).
DE01 OR %00100000 Set bit 5.
Print_HelperPreviewImage_11 DE03 RLC D Rotate D left (through the carry flag).
DE05 JP NC,Print_HelperPreviewImage_12 Jump to Print_HelperPreviewImage_12 if the carry flag isn't set (if the leftmost bit was 0).
DE08 OR %00100000 Set bit 5.
Print_HelperPreviewImage_12 DE0A RLC D Rotate D left (through the carry flag).
DE0C JP NC,Print_HelperPreviewImage_13 Jump to Print_HelperPreviewImage_13 if the carry flag isn't set (if the leftmost bit was 0).
DE0F OR %00010000 Set bit 4.
Print_HelperPreviewImage_13 DE11 RLC D Rotate D left (through the carry flag).
DE13 JP NC,Print_HelperPreviewImage_14 Jump to Print_HelperPreviewImage_14 if the carry flag isn't set (if the leftmost bit was 0).
DE16 OR %00010000 Set bit 4.
Print_HelperPreviewImage_14 DE18 RLC E Rotate E left (through the carry flag).
DE1A JP NC,Print_HelperPreviewImage_15 Jump to Print_HelperPreviewImage_15 if the carry flag isn't set (if the leftmost bit was 0).
DE1D OR %00001000 Set bit 3.
Print_HelperPreviewImage_15 DE1F RLC E Rotate E left (through the carry flag).
DE21 JP NC,Print_HelperPreviewImage_16 Jump to Print_HelperPreviewImage_16 if the carry flag isn't set (if the leftmost bit was 0).
DE24 OR %00001000 Set bit 3.
Print_HelperPreviewImage_16 DE26 RLC E Rotate E left (through the carry flag).
DE28 JP NC,Print_HelperPreviewImage_17 Jump to Print_HelperPreviewImage_17 if the carry flag isn't set (if the leftmost bit was 0).
DE2B OR %00000100 Set bit 2.
Print_HelperPreviewImage_17 DE2D RLC E Rotate E left (through the carry flag).
DE2F JP NC,Print_HelperPreviewImage_18 Jump to Print_HelperPreviewImage_18 if the carry flag isn't set (if the leftmost bit was 0).
DE32 OR %00000100 Set bit 2.
Print_HelperPreviewImage_18 DE34 RLC E Rotate E left (through the carry flag).
DE36 JP NC,Print_HelperPreviewImage_19 Jump to Print_HelperPreviewImage_19 if the carry flag isn't set (if the leftmost bit was 0).
DE39 OR %00000010 Set bit 1.
Print_HelperPreviewImage_19 DE3B RLC E Rotate E left (through the carry flag).
DE3D JP NC,Print_HelperPreviewImage_20 Jump to Print_HelperPreviewImage_20 if the carry flag isn't set (if the leftmost bit was 0).
DE40 OR %00000010 Set bit 1.
Print_HelperPreviewImage_20 DE42 RLC E Rotate E left (through the carry flag).
DE44 JP NC,Print_HelperPreviewImage_21 Jump to Print_HelperPreviewImage_21 if the carry flag isn't set (if the leftmost bit was 0).
DE47 OR %00000001 Set bit 0.
Print_HelperPreviewImage_21 DE49 RLC E Rotate E left (through the carry flag).
DE4B JP NC,Print_HelperPreviewImage_22 Jump to Print_HelperPreviewImage_22 if the carry flag isn't set (if the leftmost bit was 0).
DE4E OR %00000001 Set bit 0.
Print_HelperPreviewImage_22 DE50 RET Return.
Prev: DD6F Up: Map Next: DE51