Prev: 58658 Up: Map Next: 58863
58735: COPY_BUFFER_TO_SCREEN
Used by the routine PLAY_GAME.
COPY_BUFFER_TO_SCREEN 58735 LD (59787),SP Store SP to SP_STORAGE_2
58739 LD SP,59789
58742 LD HL,60391 Point HL at the screen buffer, two columns in
58745 LD A,121
COPY_BUFFER_TO_SCREEN_0 58747 POP DE
58748 LDI LDI x28 - the visible screen is 28 columns wide. DE is pointing at 16386 (the address of the top of the second column)
58750 LDI
58752 LDI
58754 LDI
58756 LDI
58758 LDI
58760 LDI
58762 LDI
58764 LDI
58766 LDI
58768 LDI
58770 LDI
58772 LDI
58774 LDI
58776 LDI
58778 LDI
58780 LDI
58782 LDI
58784 LDI
58786 LDI
58788 LDI
58790 LDI
58792 LDI
58794 LDI
58796 LDI
58798 LDI
58800 LDI
58802 LDI
58804 LD BC,4
58807 ADD HL,BC Add 4 to HL to skip the 2 undisplayed columns either side of the play area
58808 DEC A
58809 JP NZ,COPY_BUFFER_TO_SCREEN_0 Loop 120 times (15 character rows, top two thirds of screen)
58812 POP DE
58813 LD SP,(59787) Restore SP from SP_STORAGE_2
58817 LD B,H
58818 LD C,L
58819 LD HL,50922 Point HL at L50922
58822 LD A,(59667)
58825 AND A
58826 JR Z,COPY_BUFFER_TO_SCREEN_1
58828 LD HL,51314 Point HL at L51314
COPY_BUFFER_TO_SCREEN_1 58831 LD A,7
COPY_BUFFER_TO_SCREEN_2 58833 PUSH AF
58834 LD A,28
58836 PUSH DE
COPY_BUFFER_TO_SCREEN_3 58837 PUSH AF
58838 LD A,(BC)
58839 INC BC
58840 AND (HL)
58841 INC HL
58842 OR (HL)
58843 INC HL
58844 LD (DE),A
58845 INC DE
58846 POP AF
58847 DEC A
58848 JP NZ,COPY_BUFFER_TO_SCREEN_3
58851 POP DE
58852 INC D
58853 INC BC
58854 INC BC
58855 INC BC
58856 INC BC
58857 POP AF
58858 DEC A
58859 JP NZ,COPY_BUFFER_TO_SCREEN_2
58862 RET
Prev: 58658 Up: Map Next: 58863