Prev: 741E Up: Map Next: 7499
7420: Routine at 7420
Used by the routines at GameOver, 763C and 76D7.
7420 LD HL,($7844) HL=*Score.
7423 LD DE,($7846) DE=*7846.
7427 AND A Set flags.
7428 SBC HL,DE HL-=DE (with carry).
742A RET Z Return if the result is zero.
742B ADD HL,DE HL+=DE.
This entry point is used by the routine at PrintGameDisplay.
742C LD ($7846),HL Write HL to *7846.
742F EXX Switch to the shadow registers.
7430 LD DE,$51C6 DE'=51C6 (screen buffer location).
7433 EXX Switch back to the normal registers.
This entry point is used by the routines at GameOver and PrintGameDisplay.
7434 LD DE,$784B DE=Target.
7437 LD BC,$D810 BC=D810.
743A LD A,$FF A=FF.
743C INC A Increment A by one.
743D ADD HL,BC HL+=BC.
743E JR C,$743C Jump to 743C if {} is lower.
7440 SBC HL,BC HL-=BC.
7442 LD (DE),A Write A to *DE.
7443 INC E Increment E by one.
7444 LD BC,$FC18 BC=FC18.
7447 LD A,$FF A=FF.
7449 INC A Increment A by one.
744A ADD HL,BC HL+=BC.
744B JR C,$7449 Jump to 7449 if {} is lower.
744D SBC HL,BC HL-=BC.
744F LD (DE),A Write A to *DE.
7450 INC E Increment E by one.
7451 LD BC,$FF9C BC=FF9C.
7454 LD A,$FF A=FF.
7456 INC A Increment A by one.
7457 ADD HL,BC HL+=BC.
7458 JR C,$7456 Jump to 7456 if {} is lower.
745A SBC HL,BC HL-=BC.
745C LD (DE),A Write A to *DE.
745D INC E Increment E by one.
745E LD C,$F6 C=F6.
7460 LD A,$FF A=FF.
7462 INC A Increment A by one.
7463 ADD HL,BC HL+=BC.
7464 JR C,$7462 Jump to 7462 if {} is lower.
7466 LD (DE),A Write A to *DE.
7467 INC E Increment E by one.
7468 LD A,L A=L.
7469 ADD A,$0A A+=0A.
746B LD (DE),A Write A to *DE.
746C EXX Switch to the shadow registers.
746D LD BC,$784B BC'=Target.
Work out the ZX Spectrum ROM location of the number UDG, e.g. "1" would be 3D89.
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 7470 LD A,(BC) A=*BC'.
7471 ADD A,A L'=81+(A*08).
7472 ADD A,A
7473 ADD A,A
7474 ADD A,$81
7476 LD L,A
7477 LD H,$3D H'=3D.
7479 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
747A LD (DE),A
747B INC L Increment L' by one.
747C INC D Increment D' by one.
747D LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
747E LD (DE),A
747F INC L Increment L' by one.
7480 INC D Increment D' by one.
7481 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
7482 LD (DE),A
7483 INC L Increment L' by one.
7484 INC D Increment D' by one.
7485 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
7486 LD (DE),A
7487 INC L Increment L' by one.
7488 INC D Increment D' by one.
7489 LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
748A LD (DE),A
748B INC L Increment L' by one.
748C INC D Increment D' by one.
748D LD A,(HL) Copy a number UDG byte line from the Spectum ROM (*HL') to the screen buffer (*DE').
748E LD (DE),A
Reset the screen buffer position.
748F LD D,$51 D'=51.
7491 INC E Move right one character block in the screen buffer, ready to print the next number.
7492 INC C Increment C' by one.
7493 BIT 3,C Jump to PrintTarget if bit 3 of C' is not zero.
7495 JR NZ,PrintTarget
7497 EXX Switch back to the normal registers.
7498 RET Return.
Prev: 741E Up: Map Next: 7499