Prev: 25562 Up: Map Next: 25690
25599: Handler: Pick Up Cup
Used by the routine at 28714.
Calculate number of points to award.
HandlerCup 25599 LD A,(24124) A=Cups_Collected.
25602 INC A A=(A + 1) * 2 with BCD conversion.
25603 ADD A,A
25604 DAA
Adds points to score.
25605 LD B,A BC=number of points to award.
25606 LD C,0
25608 CALL AddPointsToScore Call AddPointsToScore.
Handle incrementing the cup counter.
25611 LD HL,24124 Increment Cups_Collected by one.
25614 INC (HL)
Have all the cups been collected?
25615 LD A,(HL) A=Cups_Collected.
25616 CP 8 If A is less than 8 jump to DisplayCupsCollected.
25618 JR C,DisplayCupsCollected
All cups have been collected, display the "congratulations" messaging.
25620 CALL SetDayAttributes Call SetDayAttributes.
25623 CALL CreateWindow Call CreateWindow.
25626 CALL DisplayCongratsMessaging Call DisplayCongratsMessaging.
Writes the line "YOUR TIME WAS".
25629 LD HL,22632 HL=22632 (screen location).
25632 LD DE,25571 DE=Message_YourTime.
25635 CALL MenuWriteText Call MenuWriteText.
Set HL to where the time itself will display.
25638 LD HL,26752 HL=26752 (screen location).
25641 CALL ScreenAddress Call ScreenAddress.
25644 CALL DisplayTime_Minutes Call DisplayTime_Minutes.
Has a new "Best Time" been made?
25647 LD A,(24067) If Flag_BestTime is zero then jump to BestTime_Set.
25650 AND A
25651 JR Z,BestTime_Set
25653 CALL DisplayBestTime Call DisplayBestTime.
25656 LD HL,24064 HL=BestTime_1.
25659 LD DE,24113 DE=Time_1.
25662 LD B,3 B=3 (counter).
BestTime_Compare 25664 LD A,(DE) Compare DE against HL.
25665 CP (HL)
25666 JR C,BestTime_Update If it's higher than A then jump to BestTime_Update.
25668 JR Z,BestTime_Compare_Next If zero then jump to BestTime_Compare_Next.
25670 JR HandlerCup_Delay Jump to HandlerCup_Delay.
BestTime_Compare_Next 25672 INC HL Move onto the next BestTime digit.
25673 INC DE Move onto the next Time digit.
25674 DJNZ BestTime_Compare Decrease counter by one and loop back to BestTime_Compare until counter is zero.
Create a short pause.
HandlerCup_Delay 25676 LD B,12 B=12.
25678 CALL Delay Call Delay.
25681 CALL GameInit_0 Call GameInit_0.
25684 LD SP,24064 Set the stack pointer to 24064.
25687 JP StartGame_0 Jump to StartGame_0.
Prev: 25562 Up: Map Next: 25690