Prev: 62399 Up: Map Next: 62634
62480: Show Hall Of Fame
Paint the hall of fame page, print the ranks, names and scores, then wait for a number key or the timer.
Paint the hall of fame attribute rows.
HallOfFame 62480 LD A,71 A=INK:WHITE, PAPER:BLACK (BRIGHT).
62482 LD C,8 Set a row counter in C for 8 loops.
62484 LD HL,22784 HL=22784.
HallOfFame_Loop 62487 LD B,64 Set an attribute counter in B for 64 loops.
HallOfFame_WriteAttribute 62489 LD (HL),A Write the attribute.
62490 INC HL Advance the attribute pointer.
62491 DJNZ HallOfFame_WriteAttribute Decrease the column count by one and jump back to HallOfFame_WriteAttribute until it is zero.
Step to the next band colour, going back to INK:GREEN, PAPER:BLACK (BRIGHT) after INK:RED, PAPER:BLACK (BRIGHT).
62493 DEC A Decrease the attribute by one.
62494 CP 65 Jump to HallOfFame_NextRow if it is not INK:BLUE, PAPER:BLACK (BRIGHT).
62496 JR NZ,HallOfFame_NextRow
62498 LD A,68 A=INK:GREEN, PAPER:BLACK (BRIGHT).
HallOfFame_NextRow 62500 DEC C Decrease the row count by one.
62501 JR NZ,HallOfFame_Loop Jump back to HallOfFame_Loop until it is zero.
Handle printing "THE ULTIMATE" messaging.
62503 LD HL,6224 HL=6224 (screen location).
62506 LD DE,62634 DE=String_Ultimate.
62509 CALL PrintStringColour Call PrintStringColour.
Handle printing "HALL OF FAME" messaging.
62512 LD HL,10320 HL=10320 (screen location).
62515 LD DE,62648 DE=String_HallOfFame.
62518 CALL PrintStringColour Call PrintStringColour.
Print the rank numbers down the page.
62521 LD HL,16456 HL=16456 (screen location).
62524 XOR A Clear A.
62525 LD C,49 C=49.
62527 LD B,8 Set a rank counter in B for 8 loops.
HallOfFame_Rank_Loop 62529 PUSH HL Stash the row address on the stack.
62530 CALL ScreenAddress Call ScreenAddress.
62533 LD A,C Copy the rank character into A.
62534 CALL PrintScreen Call PrintScreen.
62537 POP HL Restore the row address from the stack.
62538 LD A,H Move down two character rows.
62539 ADD A,16
62541 LD H,A
62542 INC C Increase the rank character by one.
62543 DJNZ HallOfFame_Rank_Loop Decrease the rank count by one and jump back to HallOfFame_Rank_Loop until it is zero.
Print the eight names.
62545 LD HL,16480 HL=16480 (screen location).
62548 LD DE,24096 DE=HallOfFame_Names.
62551 LD C,8 Set a name counter in C for 8 loops.
HallOfFame_PrintName 62553 PUSH HL Stash the row address on the stack.
62554 CALL ScreenAddress Call ScreenAddress.
Print the three letters of the name.
62557 LD B,3 Set a letter counter in B for 3 loops.
HallOfFame_PrintLetter 62559 LD A,(DE) Fetch the next name letter.
62560 CALL PrintScreen Call PrintScreen.
62563 INC DE Advance the name pointer.
62564 DJNZ HallOfFame_PrintLetter Decrease the letter count by one and jump back to HallOfFame_PrintLetter until it is zero.
Move down to the row for the next name.
62566 POP HL Restore the row address from the stack.
62567 LD A,H Move down two character rows.
62568 ADD A,16
62570 LD H,A
62571 DEC C Decrease the name count by one.
62572 JR NZ,HallOfFame_PrintName Jump back to HallOfFame_PrintName until it is zero.
Print the eight scores.
62574 LD C,8 Set a score counter in C for 8 loops.
62576 LD DE,24070 DE=High_Score.
62579 LD HL,16520 HL=16520.
HallOfFame_PrintScore 62582 LD B,3 Set a score byte counter in B for 3 loops.
62584 PUSH HL Stash HL on the stack.
62585 CALL ScreenAddress Call ScreenAddress.
62588 CALL PrintScore_Loop Call PrintScore_Loop.
62591 POP HL Restore HL from the stack.
62592 LD A,H H=H+16.
62593 ADD A,16
62595 LD H,A
62596 DEC C Decrease C by one.
62597 JR NZ,HallOfFame_PrintScore Jump back to HallOfFame_PrintScore until C is zero.
Set the timeout and wait for a number key.
62599 LD A,1 Write 1 to HighScore_PlayerCopy.
62601 LD (24180),A
62604 LD HL,1024 Write 1024 to HallOfFame_Timer.
62607 LD (24173),HL
HallOfFame_WaitKey 62610 EI Enable interrupts.
62611 HALT Wait for the next interrupt.
Count the timeout down.
62612 LD HL,(24173) Fetch HallOfFame_Timer.
62615 DEC HL Decrease it by one.
62616 LD (24173),HL Write it back.
Read the number keys and return if any is pressed.
62619 LD A,231 Read from the keyboard;
Port Number Bit
0 1 2 3 4
231 0 1 2 3 4 5 6 7 8 9
62621 OUT (253),A
62623 IN A,(254)
62625 CPL Flip the bits.
62626 AND %00011111 Keep only bits 0-4.
62628 RET NZ Return if any number key is pressed.
62629 LD A,H Jump back to HallOfFame_WaitKey if the timer is not zero.
62630 OR L
62631 JR NZ,HallOfFame_WaitKey
62633 RET Return.
Prev: 62399 Up: Map Next: 62634