Prev: 29726 Up: Map Next: 29849
29728: Routine at 7420
Used by the routines at GameOver, 30268 and 30423.
29728 LD HL,(30788) HL=*Score.
29731 LD DE,(30790) DE=*30790.
29735 AND A Set flags.
29736 SBC HL,DE HL-=DE (with carry).
29738 RET Z Return if the result is zero.
29739 ADD HL,DE HL+=DE.
This entry point is used by the routine at PrintGameDisplay.
29740 LD (30790),HL Write HL to *30790.
29743 EXX Switch to the shadow registers.
29744 LD DE,20934 DE'=20934 (screen buffer location).
29747 EXX Switch back to the normal registers.
This entry point is used by the routines at GameOver and PrintGameDisplay.
29748 LD DE,30795 DE=Target.
29751 LD BC,55312 BC=55312.
29754 LD A,255 A=255.
29756 INC A Increment A by one.
29757 ADD HL,BC HL+=BC.
29758 JR C,29756 Jump to 29756 if {} is lower.
29760 SBC HL,BC HL-=BC.
29762 LD (DE),A Write A to *DE.
29763 INC E Increment E by one.
29764 LD BC,64536 BC=64536.
29767 LD A,255 A=255.
29769 INC A Increment A by one.
29770 ADD HL,BC HL+=BC.
29771 JR C,29769 Jump to 29769 if {} is lower.
29773 SBC HL,BC HL-=BC.
29775 LD (DE),A Write A to *DE.
29776 INC E Increment E by one.
29777 LD BC,65436 BC=65436.
29780 LD A,255 A=255.
29782 INC A Increment A by one.
29783 ADD HL,BC HL+=BC.
29784 JR C,29782 Jump to 29782 if {} is lower.
29786 SBC HL,BC HL-=BC.
29788 LD (DE),A Write A to *DE.
29789 INC E Increment E by one.
29790 LD C,246 C=246.
29792 LD A,255 A=255.
29794 INC A Increment A by one.
29795 ADD HL,BC HL+=BC.
29796 JR C,29794 Jump to 29794 if {} is lower.
29798 LD (DE),A Write A to *DE.
29799 INC E Increment E by one.
29800 LD A,L A=L.
29801 ADD A,10 A+=10.
29803 LD (DE),A Write A to *DE.
29804 EXX Switch to the shadow registers.
29805 LD BC,30795 BC'=Target.
Work out the ZX Spectrum ROM location of the number UDG, e.g. "1" would be 15753.
This calculation avoids the whitespace at the top and bottom of the ROM UDG; in the code below you'll see it only copies six bytes/ lines.
PrintTarget 29808 LD A,(BC) A=*BC'.
29809 ADD A,A L'=129+(A*8).
29810 ADD A,A
29811 ADD A,A
29812 ADD A,129
29814 LD L,A
29815 LD H,61 H'=61.
29817 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
29818 LD (DE),A
29819 INC L Increment L' by one.
29820 INC D Increment D' by one.
29821 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
29822 LD (DE),A
29823 INC L Increment L' by one.
29824 INC D Increment D' by one.
29825 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
29826 LD (DE),A
29827 INC L Increment L' by one.
29828 INC D Increment D' by one.
29829 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
29830 LD (DE),A
29831 INC L Increment L' by one.
29832 INC D Increment D' by one.
29833 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
29834 LD (DE),A
29835 INC L Increment L' by one.
29836 INC D Increment D' by one.
29837 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
29838 LD (DE),A
Reset the screen buffer position.
29839 LD D,81 D'=81.
29841 INC E Move right one character block in the screen buffer, ready to print the next number.
29842 INC C Increment C' by one.
29843 BIT 3,C Jump to PrintTarget if bit 3 of C' is not zero.
29845 JR NZ,PrintTarget
29847 EXX Switch back to the normal registers.
29848 RET Return.
Prev: 29726 Up: Map Next: 29849