Prev: F3BF Up: Map Next: F4AA
F410: 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 F410 LD A,$47 A=INK:WHITE, PAPER:BLACK (BRIGHT).
F412 LD C,$08 Set a row counter in C for 08 loops.
F414 LD HL,$5900 HL=5900.
HallOfFame_Loop F417 LD B,$40 Set an attribute counter in B for 40 loops.
HallOfFame_WriteAttribute F419 LD (HL),A Write the attribute.
F41A INC HL Advance the attribute pointer.
F41B 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).
F41D DEC A Decrease the attribute by one.
F41E CP $41 Jump to HallOfFame_NextRow if it is not INK:BLUE, PAPER:BLACK (BRIGHT).
F420 JR NZ,HallOfFame_NextRow
F422 LD A,$44 A=INK:GREEN, PAPER:BLACK (BRIGHT).
HallOfFame_NextRow F424 DEC C Decrease the row count by one.
F425 JR NZ,HallOfFame_Loop Jump back to HallOfFame_Loop until it is zero.
Handle printing "THE ULTIMATE" messaging.
F427 LD HL,$1850 HL=1850 (screen location).
F42A LD DE,$F4AA DE=String_Ultimate.
F42D CALL PrintStringColour Call PrintStringColour.
Handle printing "HALL OF FAME" messaging.
F430 LD HL,$2850 HL=2850 (screen location).
F433 LD DE,$F4B8 DE=String_HallOfFame.
F436 CALL PrintStringColour Call PrintStringColour.
Print the rank numbers down the page.
F439 LD HL,$4048 HL=4048 (screen location).
F43C XOR A Clear A.
F43D LD C,$31 C=31.
F43F LD B,$08 Set a rank counter in B for 08 loops.
HallOfFame_Rank_Loop F441 PUSH HL Stash the row address on the stack.
F442 CALL ScreenAddress Call ScreenAddress.
F445 LD A,C Copy the rank character into A.
F446 CALL PrintScreen Call PrintScreen.
F449 POP HL Restore the row address from the stack.
F44A LD A,H Move down two character rows.
F44B ADD A,$10
F44D LD H,A
F44E INC C Increase the rank character by one.
F44F 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.
F451 LD HL,$4060 HL=4060 (screen location).
F454 LD DE,$5E20 DE=HallOfFame_Names.
F457 LD C,$08 Set a name counter in C for 08 loops.
HallOfFame_PrintName F459 PUSH HL Stash the row address on the stack.
F45A CALL ScreenAddress Call ScreenAddress.
Print the three letters of the name.
F45D LD B,$03 Set a letter counter in B for 03 loops.
HallOfFame_PrintLetter F45F LD A,(DE) Fetch the next name letter.
F460 CALL PrintScreen Call PrintScreen.
F463 INC DE Advance the name pointer.
F464 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.
F466 POP HL Restore the row address from the stack.
F467 LD A,H Move down two character rows.
F468 ADD A,$10
F46A LD H,A
F46B DEC C Decrease the name count by one.
F46C JR NZ,HallOfFame_PrintName Jump back to HallOfFame_PrintName until it is zero.
Print the eight scores.
F46E LD C,$08 Set a score counter in C for 08 loops.
F470 LD DE,$5E06 DE=High_Score.
F473 LD HL,$4088 HL=4088.
HallOfFame_PrintScore F476 LD B,$03 Set a score byte counter in B for 03 loops.
F478 PUSH HL Stash HL on the stack.
F479 CALL ScreenAddress Call ScreenAddress.
F47C CALL PrintScore_Loop Call PrintScore_Loop.
F47F POP HL Restore HL from the stack.
F480 LD A,H H=H+10.
F481 ADD A,$10
F483 LD H,A
F484 DEC C Decrease C by one.
F485 JR NZ,HallOfFame_PrintScore Jump back to HallOfFame_PrintScore until C is zero.
Set the timeout and wait for a number key.
F487 LD A,$01 Write 01 to HighScore_PlayerCopy.
F489 LD ($5E74),A
F48C LD HL,$0400 Write 0400 to HallOfFame_Timer.
F48F LD ($5E6D),HL
HallOfFame_WaitKey F492 EI Enable interrupts.
F493 HALT Wait for the next interrupt.
Count the timeout down.
F494 LD HL,($5E6D) Fetch HallOfFame_Timer.
F497 DEC HL Decrease it by one.
F498 LD ($5E6D),HL Write it back.
Read the number keys and return if any is pressed.
F49B LD A,$E7 Read from the keyboard;
Port Number Bit
0 1 2 3 4
E7 0 1 2 3 4 5 6 7 8 9
F49D OUT ($FD),A
F49F IN A,($FE)
F4A1 CPL Flip the bits.
F4A2 AND %00011111 Keep only bits 0-4.
F4A4 RET NZ Return if any number key is pressed.
F4A5 LD A,H Jump back to HallOfFame_WaitKey if the timer is not zero.
F4A6 OR L
F4A7 JR NZ,HallOfFame_WaitKey
F4A9 RET Return.
Prev: F3BF Up: Map Next: F4AA