|  | Routines | 
| Prev: 26539 | Up: Map | Next: 27853 | 
|  | ||||||||||||||||||||
| Start | 27648 | DI | Disable interrupts. | |||||||||||||||||
| 
Initial set-up; copies "clean" data to the "CopyOf..." store. This is then used to create a new game in ReStart.
 | ||||||||||||||||||||
| 27649 | LD DE,62464 | Copies Objects to CopyOfObjects ($615 bytes). | ||||||||||||||||||
| 27652 | LD HL,49435 | |||||||||||||||||||
| 27655 | LD BC,1557 | |||||||||||||||||||
| 27658 | LDIR | |||||||||||||||||||
| 27660 | LD HL,47754 | Copies Locations to CopyOfLocations ($5D9 bytes). | ||||||||||||||||||
| 27663 | LD BC,1497 | |||||||||||||||||||
| 27666 | LDIR | |||||||||||||||||||
| 27668 | LD DE,24320 | Copies 46827 to $5F00 ($1D bytes). | ||||||||||||||||||
| 27671 | LD HL,46827 | |||||||||||||||||||
| 27674 | LD BC,29 | |||||||||||||||||||
| 27677 | LDIR | |||||||||||||||||||
| 27679 | LD HL,51844 | Copies $CA84 to $5F1D ($BF bytes). | ||||||||||||||||||
| 27682 | LD BC,191 | |||||||||||||||||||
| 27685 | LDIR | |||||||||||||||||||
|  | ||||||||||||||||||||
| ReStart | 27687 | DI | Disable interrupts. | |||||||||||||||||
| 27688 | LD SP,24319 | Set the stack pointer to 24319. | ||||||||||||||||||
| 
Reset the border and paper colours for location 5 - "Trolls Clearing".
 | ||||||||||||||||||||
| 27691 | LD IX,52224 | IX=LocGFXTable | ||||||||||||||||||
| 27695 | LD A,5 | Call IndexIdTable with location 5 - "Trolls Clearing". | ||||||||||||||||||
| 27697 | CALL IndexIdTable | |||||||||||||||||||
| 27700 | LD L,(IX+1) | HL=57666 (HL=location graphics data for "Trolls Clearing"). | ||||||||||||||||||
| 27703 | LD H,(IX+2) | |||||||||||||||||||
| 27706 | LD (HL),0 | Write $00 (black) to the first (border) and second (paper) addresses. | ||||||||||||||||||
| 27708 | INC HL | |||||||||||||||||||
| 27709 | LD (HL),0 | |||||||||||||||||||
| 
Copy "clean" data to the game tables ready for a new game.
 | ||||||||||||||||||||
| 27711 | LD HL,62464 | Copies CopyOfObjects to Objects ($615 bytes). | ||||||||||||||||||
| 27714 | LD DE,49435 | |||||||||||||||||||
| 27717 | LD BC,1557 | |||||||||||||||||||
| 27720 | LDIR | |||||||||||||||||||
| 27722 | LD DE,47754 | Copies CopyOfLocations to Locations ($5D9 bytes). | ||||||||||||||||||
| 27725 | LD BC,1497 | |||||||||||||||||||
| 27728 | LDIR | |||||||||||||||||||
| 27730 | LD HL,24320 | Copies $5F00 to 46827 ($1D bytes). | ||||||||||||||||||
| 27733 | LD DE,46827 | |||||||||||||||||||
| 27736 | LD BC,29 | |||||||||||||||||||
| 27739 | LDIR | |||||||||||||||||||
| 27741 | LD DE,51844 | Copies $CA84 to $5F1D ($BF bytes). | ||||||||||||||||||
| 27744 | LD BC,191 | |||||||||||||||||||
| 27747 | LDIR | |||||||||||||||||||
| 27749 | XOR A | Set the border colour to black. | ||||||||||||||||||
| 27750 | OUT (254),A | |||||||||||||||||||
| 27752 | LD A,56 | Write $38 to BORDCR. | ||||||||||||||||||
| 27754 | LD (23624),A | |||||||||||||||||||
| ReStart_Keypress | 27757 | XOR A | Read from the keyboard port. | |||||||||||||||||
| 27758 | IN A,(254) | |||||||||||||||||||
| 27760 | AND %00011111 | A pressed key from any line will set its respective bit; bit 0 (outer key) to bit 4 (inner key). Hence keep only bits 0-4 for the check. | ||||||||||||||||||
| 27762 | CP 31 | Loop back to ReStart_Keypress until any key has been pressed. | ||||||||||||||||||
| 27764 | JR Z,ReStart_Keypress | |||||||||||||||||||
| 27766 | LD A,127 | Read from the keyboard port. 
 | ||||||||||||||||||
| 27768 | IN A,(254) | |||||||||||||||||||
| 27770 | AND %00001000 | Keep bit 3 ("N"). | ||||||||||||||||||
| 27772 | LD (46855),A | Write it to 46855. | ||||||||||||||||||
| 27775 | LD HL,20704 | Write $50E0 to the percentage buffer. | ||||||||||||||||||
| 27778 | LD (34228),HL | |||||||||||||||||||
| 27781 | LD A,43 | Write $2B to $85B6. | ||||||||||||||||||
| 27783 | LD (34230),A | |||||||||||||||||||
| 27786 | LD HL,20512 | Write $5020 to 34460. | ||||||||||||||||||
| 27789 | LD (34460),HL | |||||||||||||||||||
| 27792 | LD A,1 | Write $01 to 34462. | ||||||||||||||||||
| 27794 | LD (34462),A | |||||||||||||||||||
| 27797 | LD A,32 | Write $20 to 34227. | ||||||||||||||||||
| 27799 | LD (34227),A | |||||||||||||||||||
| 27802 | LD A,42 | Write $2A to 34459. | ||||||||||||||||||
| 27804 | LD (34459),A | |||||||||||||||||||
| 27807 | LD B,200 | Write $00 to 200 bytes, starting from 46904 (using Blanker). | ||||||||||||||||||
| 27809 | LD HL,46904 | |||||||||||||||||||
| 27812 | CALL Blanker | |||||||||||||||||||
| 27815 | LD A,R | R = refresh register; i.e. write a semi-random number to RandomSeed. | ||||||||||||||||||
| 27817 | LD (46862),A | |||||||||||||||||||
| 27820 | XOR A | Write $00 to; | ||||||||||||||||||
| 27821 | LD (34463),A | |||||||||||||||||||
| 27824 | LD (34464),A | |||||||||||||||||||
| 27827 | LD (46874),A | |||||||||||||||||||
| 27830 | LD (46848),A | |||||||||||||||||||
| 27833 | LD (46834),A | |||||||||||||||||||
| 27836 | LD A,1 | Write $01 to; | ||||||||||||||||||
| 27838 | LD (46850),A | |||||||||||||||||||
| 27841 | LD (46842),A | |||||||||||||||||||
| 27844 | LD (46852),A | |||||||||||||||||||
| 27847 | LD HL,0 | Write $0000 to PercentageComplete. | ||||||||||||||||||
| 27850 | LD (46839),HL | |||||||||||||||||||
| Prev: 26539 | Up: Map | Next: 27853 |