![]() |
Routines |
| Prev: 51545 | Up: Map | Next: 51840 |
|
|
|||||||||||||||
|
Clears the cashbox flags, clears the screen and displays the phase number.
|
|||||||||||||||
| Prep_Display_Phase | 51639 | LD HL,257 | Writes 1 to both CashboxReference_Inactive and CashboxReference_Active. | ||||||||||||
| 51642 | LD (54364),HL | ||||||||||||||
| 51645 | LD HL,52365 | Clear down the deposit flags (copies 0 to each from DoorDeposited_01). | |||||||||||||
| 51648 | LD DE,52366 | ||||||||||||||
| 51651 | LD BC,13 | ||||||||||||||
| 51654 | LD (HL),0 | ||||||||||||||
| 51656 | LDIR | ||||||||||||||
| 51658 | XOR A | Call Clear_Screen (using 0). | |||||||||||||
| 51659 | CALL Clear_Screen | ||||||||||||||
| 51662 | JR Display_Phase | Jump to Display_Phase. | |||||||||||||
|
This routine has the ability to write any value across the screen buffer, however it's only ever called with A=0 (clear screen).
|
|||||||||||||||
| Clear_Screen | 51664 | LD HL,16384 | Clears the screen buffer by writing 0 to all 6912 memory locations. | ||||||||||||
| 51667 | LD DE,16385 | ||||||||||||||
| 51670 | LD BC,6911 | ||||||||||||||
| 51673 | LD (HL),A | ||||||||||||||
| 51674 | LDIR | ||||||||||||||
| 51676 | RET | ||||||||||||||
|
Displays the current "phase".
|
|||||||||||||||
| Display_Phase | 51677 | LD HL,51790 | Copies Phase_Copy into Progress_Buffer (5 bytes of text data). | ||||||||||||
| 51680 | LD DE,51804 | ||||||||||||||
| 51683 | LD BC,5 | ||||||||||||||
| 51686 | LDIR | ||||||||||||||
| 51688 | LD HL,(51802) | Writes Phase_ASCII to Progress_Buffer (at 51809 - just overwriting the numeric part). | |||||||||||||
| 51691 | LD (51809),HL | ||||||||||||||
| 51694 | LD HL,51786 | Call Progress_Base_10 with Phase. | |||||||||||||
| 51697 | CALL Progress_Base_10 | ||||||||||||||
| 51700 | LD HL,(51809) | Writes 51809 back to Phase_ASCII. | |||||||||||||
| 51703 | LD (51802),HL | ||||||||||||||
| 51706 | RET | Return. | |||||||||||||
|
Displays the current "day".
|
|||||||||||||||
| Display_Day | 51707 | LD HL,51795 | Copies Day_Copy into Progress_Buffer ($05 bytes of text data). | ||||||||||||
| 51710 | LD DE,51804 | ||||||||||||||
| 51713 | LD BC,5 | ||||||||||||||
| 51716 | LDIR | ||||||||||||||
| 51718 | LD HL,(51800) | Writes Day_ASCII to Progress_Buffer (at 51809 - just overwriting the numeric part). | |||||||||||||
| 51721 | LD (51809),HL | ||||||||||||||
| 51724 | LD HL,51788 | Call Progress_Base_10 with Day. | |||||||||||||
| 51727 | CALL Progress_Base_10 | ||||||||||||||
| 51730 | LD HL,(51809) | Writes 51809 back to Day_ASCII. | |||||||||||||
| 51733 | LD (51800),HL | ||||||||||||||
| 51736 | RET | Return. | |||||||||||||
| Progress_Base_10 | 51737 | LD A,(HL) | If the passed number is not more than 10 jump to Progress_Divisible_10. | ||||||||||||
| 51738 | INC A | ||||||||||||||
| 51739 | CP 10 | ||||||||||||||
| 51741 | JR NC,Progress_Divisible_10 | ||||||||||||||
| 51743 | LD (HL),A | Stores the ASCII representation of the number at 51810 (for Progress_Buffer). It adds ASCII "0" so for example 1 ends up being 1 + 48 = 49 (e.g. "1" in ASCII). | |||||||||||||
| 51744 | ADD A,48 | ||||||||||||||
| 51746 | LD (51810),A | ||||||||||||||
| 51749 | JR Print_Progress | Jump to Print_Progress. | |||||||||||||
| Progress_Divisible_10 | 51751 | LD (HL),0 | Reset the current progress digit to 0. | ||||||||||||
| 51753 | INC HL | Use the secondary digit of the currently focused progress. | |||||||||||||
|
Note this doesn't account for a third digit and so leads to eventual corruption. Once past day/ phase "99", this will display "00" and past "09" the first ASCII digit doesn't point to any usable image data. Note however, this occurs after ~4 hours of game play so isn't especially an issue.
|
|||||||||||||||
| 51754 | INC (HL) | Increase this second digit by one. | |||||||||||||
| 51755 | LD A,(HL) | Add ASCII "0" so for example 1 ends up being 1 + 48 = 49 (e.g. "1" in ASCII). Write this number to 51809 (for Progress_Buffer). | |||||||||||||
| 51756 | ADD A,48 | ||||||||||||||
| 51758 | LD (51809),A | ||||||||||||||
| 51761 | DEC HL | Move back to point to the original location of HL. | |||||||||||||
| 51762 | LD A,(HL) | Again, add ASCII "0" for this digit too. Write this number to 51810 (for Progress_Buffer). | |||||||||||||
| 51763 | ADD A,48 | ||||||||||||||
| 51765 | LD (51810),A | ||||||||||||||
|
Prints the current progress buffer message to the screen.
|
|||||||||||||||
| Print_Progress | 51768 | LD HL,51804 | Prints Progress_Buffer to the screen buffer at 18540 using Print_TwoToneText.
|
||||||||||||
| 51771 | LD DE,18540 | ||||||||||||||
| 51774 | LD BC,1795 | ||||||||||||||
| 51777 | CALL Print_TwoToneText | ||||||||||||||
| 51780 | LD B,80 | Interrupt driven HALT loop ($50 cycles). | |||||||||||||
| Progress_Halt_Loop | 51782 | HALT | |||||||||||||
| 51783 | DJNZ Progress_Halt_Loop | ||||||||||||||
| 51785 | RET | Return. | |||||||||||||
| Phase | 51786 | DEFW 6 | |||||||||||||
| Day | 51788 | DEFW 1 | |||||||||||||
| Phase_Copy | 51790 | DEFM "PHASE" | "PHASE". | ||||||||||||
| Day_Copy | 51795 | DEFM " DAY " | " DAY ". | ||||||||||||
| Day_ASCII | 51800 | DEFM " 1" | " 1". | ||||||||||||
| Phase_ASCII | 51802 | DEFM " 6" | " 6". | ||||||||||||
| Progress_Buffer | 51804 | DEFM "PHASE 6",255 | This is a buffer - so text changes during play: "PHASE 6". | ||||||||||||
|
Clears the screen and displays the day number.
|
|||||||||||||||
| Prep_Display_Day | 51812 | XOR A | Clears the screen by passing 0 to Clear_Screen. | ||||||||||||
| 51813 | CALL Clear_Screen | ||||||||||||||
| 51816 | CALL Display_Day | Call Display_Day. | |||||||||||||
| 51819 | RET | Return. | |||||||||||||
|
Clear down the day/ progress states.
|
|||||||||||||||
| Init_Progress | 51820 | LD HL,0 | Clears Phase and Day (writes 0000 to them). | ||||||||||||
| 51823 | LD (51786),HL | ||||||||||||||
| 51826 | LD (51788),HL | ||||||||||||||
| 51829 | LD A,32 | Writes ASCII space (32) to 51809 and ASCII "0" (48) to 51810 (i.e. writes " 0" to the numeric portion of Progress_Buffer). ß | |||||||||||||
| 51831 | LD HL,51809 | ||||||||||||||
| 51834 | LD (HL),A | ||||||||||||||
| 51835 | INC HL | ||||||||||||||
| 51836 | LD A,48 | ||||||||||||||
| 51838 | LD (HL),A | ||||||||||||||
| 51839 | RET | Return. | |||||||||||||
| Prev: 51545 | Up: Map | Next: 51840 |