Routines |
Prev: 56687 | Up: Map | Next: 56913 |
Used by the routine at Game_Loop.
|
||||||||||||||||||||||||
Takes the generated image at Buffer_Image, and creates a preview image from it.
|
||||||||||||||||||||||||
Print_HelperPreviewImage | 56691 | LD B,4 | Set the initial X co-ordinate in B. | |||||||||||||||||||||
56693 | LD C,22 | Set the initial Y co-ordinate in C. | ||||||||||||||||||||||
Print_HelperPreviewImage_0 | 56695 | PUSH BC | Stash the co-ordinates on the stack. | |||||||||||||||||||||
56696 | CALL Calculate_ScreenBlockAddress | Call Calculate_ScreenBlockAddress. | ||||||||||||||||||||||
56699 | LD B,8 | Set a counter in B for 8. | ||||||||||||||||||||||
Print_HelperPreviewImage_1 | 56701 | PUSH BC | Stash the counter on the stack. | |||||||||||||||||||||
56702 | LD B,10 | Set a counter in B for 10. | ||||||||||||||||||||||
56704 | PUSH HL | Stash the screen buffer address pointer on the stack. | ||||||||||||||||||||||
Print_HelperPreviewImage_2 | 56705 | LD (HL),0 | Write 0 to *HL. | |||||||||||||||||||||
56707 | INC HL | Increment the screen buffer address pointer by one. | ||||||||||||||||||||||
56708 | DJNZ Print_HelperPreviewImage_2 | Decrease the counter by one and loop back to Print_HelperPreviewImage_2 until the counter is zero. | ||||||||||||||||||||||
56710 | POP HL | Restore the original screen buffer address from the stack. | ||||||||||||||||||||||
56711 | INC H | Move down one line. | ||||||||||||||||||||||
56712 | POP BC | Restore the counter from the stack. | ||||||||||||||||||||||
56713 | DJNZ Print_HelperPreviewImage_1 | Decrease the counter by one and loop back to Print_HelperPreviewImage_1 until the counter is zero. | ||||||||||||||||||||||
56715 | POP BC | Restore the original co-ordinates from the stack. | ||||||||||||||||||||||
56716 | INC B | Increment B by one. | ||||||||||||||||||||||
56717 | LD A,12 | Jump to Print_HelperPreviewImage_0 if B is not equal to 12. | ||||||||||||||||||||||
56719 | CP B | |||||||||||||||||||||||
56720 | JR NZ,Print_HelperPreviewImage_0 | |||||||||||||||||||||||
56722 | LD A,176 | Write 176 to *Temp_X_Coordinate. | ||||||||||||||||||||||
56724 | LD (56687),A | |||||||||||||||||||||||
56727 | LD A,32 | Write 32 to *Temp_Y_Coordinate. | ||||||||||||||||||||||
56729 | LD (56688),A | |||||||||||||||||||||||
56732 | LD HL,41187 | Write Buffer_Image to *Temp_SourceAddress. | ||||||||||||||||||||||
56735 | LD (56689),HL | |||||||||||||||||||||||
56738 | LD B,64 | B=64. | ||||||||||||||||||||||
Print_HelperPreviewImage_3 | 56740 | PUSH BC | Stash BC on the stack. | |||||||||||||||||||||
56741 | LD A,(56687) | H=*Temp_X_Coordinate. | ||||||||||||||||||||||
56744 | LD H,A | |||||||||||||||||||||||
56745 | LD A,(56688) | L=*Temp_Y_Coordinate. | ||||||||||||||||||||||
56748 | LD L,A | |||||||||||||||||||||||
56749 | CALL CalculateScreenAddress | Call CalculateScreenAddress. | ||||||||||||||||||||||
56752 | PUSH DE | Load the screen buffer address into IX (using the stack). | ||||||||||||||||||||||
56753 | POP IX | |||||||||||||||||||||||
56755 | LD B,2 | Set a counter in B for 2. | ||||||||||||||||||||||
Print_HelperPreviewImage_4 | 56757 | PUSH BC | Stash the counter and the screen buffer address on the stack. | |||||||||||||||||||||
56758 | PUSH IX | |||||||||||||||||||||||
56760 | LD HL,(56689) | HL=*Temp_SourceAddress. | ||||||||||||||||||||||
56763 | LD B,10 | B=10. | ||||||||||||||||||||||
Print_HelperPreviewImage_5 | 56765 | XOR A | A=0. | |||||||||||||||||||||
56766 | LD D,(HL) | D=*HL. | ||||||||||||||||||||||
56767 | INC HL | Increment HL by one. | ||||||||||||||||||||||
56768 | LD E,(HL) | E=*HL. | ||||||||||||||||||||||
56769 | INC HL | Increment HL by one. | ||||||||||||||||||||||
56770 | CALL Print_HelperPreviewImage_6 | Call Print_HelperPreviewImage_6. | ||||||||||||||||||||||
56773 | LD D,(IX+0) | D=*IX+0. | ||||||||||||||||||||||
56776 | OR D | Set the bits from D. | ||||||||||||||||||||||
56777 | LD (IX+0),A | Write A to *IX+0. | ||||||||||||||||||||||
56780 | INC IX | Increment IX by one. | ||||||||||||||||||||||
56782 | DJNZ Print_HelperPreviewImage_5 | Decrease counter by one and loop back to Print_HelperPreviewImage_5 until counter is zero. | ||||||||||||||||||||||
56784 | POP IX | Restore IX from the stack. | ||||||||||||||||||||||
56786 | LD (56689),HL | Write HL to *Temp_SourceAddress. | ||||||||||||||||||||||
56789 | POP BC | Restore BC from the stack. | ||||||||||||||||||||||
56790 | DJNZ Print_HelperPreviewImage_4 | Decrease counter by one and loop back to Print_HelperPreviewImage_4 until counter is zero. | ||||||||||||||||||||||
56792 | LD HL,56688 | HL=Temp_Y_Coordinate. | ||||||||||||||||||||||
56795 | INC (HL) | Increment *HL by one. | ||||||||||||||||||||||
56796 | POP BC | Restore BC from the stack. | ||||||||||||||||||||||
56797 | DJNZ Print_HelperPreviewImage_3 | Decrease counter by one and loop back to Print_HelperPreviewImage_3 until counter is zero. | ||||||||||||||||||||||
56799 | RET | Return. | ||||||||||||||||||||||
Magic.
|
||||||||||||||||||||||||
Print_HelperPreviewImage_6 | 56800 | RLC D | Rotate D left (through the carry flag). | |||||||||||||||||||||
56802 | JP NC,Print_HelperPreviewImage_7 | Jump to Print_HelperPreviewImage_7 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56805 | OR %10000000 | Set bit 7. | ||||||||||||||||||||||
Print_HelperPreviewImage_7 | 56807 | RLC D | Rotate D left (through the carry flag). | |||||||||||||||||||||
56809 | JP NC,Print_HelperPreviewImage_8 | Jump to Print_HelperPreviewImage_8 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56812 | OR %10000000 | Set bit 7. | ||||||||||||||||||||||
Print_HelperPreviewImage_8 | 56814 | RLC D | Rotate D left (through the carry flag). | |||||||||||||||||||||
56816 | JP NC,Print_HelperPreviewImage_9 | Jump to Print_HelperPreviewImage_9 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56819 | OR %01000000 | Set bit 6. | ||||||||||||||||||||||
Print_HelperPreviewImage_9 | 56821 | RLC D | Rotate D left (through the carry flag). | |||||||||||||||||||||
56823 | JP NC,Print_HelperPreviewImage_10 | Jump to Print_HelperPreviewImage_10 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56826 | OR %01000000 | Set bit 6. | ||||||||||||||||||||||
Print_HelperPreviewImage_10 | 56828 | RLC D | Rotate D left (through the carry flag). | |||||||||||||||||||||
56830 | JP NC,Print_HelperPreviewImage_11 | Jump to Print_HelperPreviewImage_11 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56833 | OR %00100000 | Set bit 5. | ||||||||||||||||||||||
Print_HelperPreviewImage_11 | 56835 | RLC D | Rotate D left (through the carry flag). | |||||||||||||||||||||
56837 | JP NC,Print_HelperPreviewImage_12 | Jump to Print_HelperPreviewImage_12 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56840 | OR %00100000 | Set bit 5. | ||||||||||||||||||||||
Print_HelperPreviewImage_12 | 56842 | RLC D | Rotate D left (through the carry flag). | |||||||||||||||||||||
56844 | JP NC,Print_HelperPreviewImage_13 | Jump to Print_HelperPreviewImage_13 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56847 | OR %00010000 | Set bit 4. | ||||||||||||||||||||||
Print_HelperPreviewImage_13 | 56849 | RLC D | Rotate D left (through the carry flag). | |||||||||||||||||||||
56851 | JP NC,Print_HelperPreviewImage_14 | Jump to Print_HelperPreviewImage_14 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56854 | OR %00010000 | Set bit 4. | ||||||||||||||||||||||
Print_HelperPreviewImage_14 | 56856 | RLC E | Rotate E left (through the carry flag). | |||||||||||||||||||||
56858 | JP NC,Print_HelperPreviewImage_15 | Jump to Print_HelperPreviewImage_15 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56861 | OR %00001000 | Set bit 3. | ||||||||||||||||||||||
Print_HelperPreviewImage_15 | 56863 | RLC E | Rotate E left (through the carry flag). | |||||||||||||||||||||
56865 | JP NC,Print_HelperPreviewImage_16 | Jump to Print_HelperPreviewImage_16 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56868 | OR %00001000 | Set bit 3. | ||||||||||||||||||||||
Print_HelperPreviewImage_16 | 56870 | RLC E | Rotate E left (through the carry flag). | |||||||||||||||||||||
56872 | JP NC,Print_HelperPreviewImage_17 | Jump to Print_HelperPreviewImage_17 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56875 | OR %00000100 | Set bit 2. | ||||||||||||||||||||||
Print_HelperPreviewImage_17 | 56877 | RLC E | Rotate E left (through the carry flag). | |||||||||||||||||||||
56879 | JP NC,Print_HelperPreviewImage_18 | Jump to Print_HelperPreviewImage_18 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56882 | OR %00000100 | Set bit 2. | ||||||||||||||||||||||
Print_HelperPreviewImage_18 | 56884 | RLC E | Rotate E left (through the carry flag). | |||||||||||||||||||||
56886 | JP NC,Print_HelperPreviewImage_19 | Jump to Print_HelperPreviewImage_19 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56889 | OR %00000010 | Set bit 1. | ||||||||||||||||||||||
Print_HelperPreviewImage_19 | 56891 | RLC E | Rotate E left (through the carry flag). | |||||||||||||||||||||
56893 | JP NC,Print_HelperPreviewImage_20 | Jump to Print_HelperPreviewImage_20 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56896 | OR %00000010 | Set bit 1. | ||||||||||||||||||||||
Print_HelperPreviewImage_20 | 56898 | RLC E | Rotate E left (through the carry flag). | |||||||||||||||||||||
56900 | JP NC,Print_HelperPreviewImage_21 | Jump to Print_HelperPreviewImage_21 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56903 | OR %00000001 | Set bit 0. | ||||||||||||||||||||||
Print_HelperPreviewImage_21 | 56905 | RLC E | Rotate E left (through the carry flag). | |||||||||||||||||||||
56907 | JP NC,Print_HelperPreviewImage_22 | Jump to Print_HelperPreviewImage_22 if the carry flag isn't set (if the leftmost bit was 0). | ||||||||||||||||||||||
56910 | OR %00000001 | Set bit 0. | ||||||||||||||||||||||
Print_HelperPreviewImage_22 | 56912 | RET | Return. |
Prev: 56687 | Up: Map | Next: 56913 |