|  | Routines | 
| Prev: 67AB | Up: Map | Next: 6CCD | 
|  | ||||||||||||||||||||
| Start | 6C00 | DI | Disable interrupts. | |||||||||||||||||
| 
Initial set-up; copies "clean" data to the "CopyOf..." store. This is then used to create a new game in ReStart.
 | ||||||||||||||||||||
| 6C01 | LD DE,$F400 | Copies Objects to CopyOfObjects ($615 bytes). | ||||||||||||||||||
| 6C04 | LD HL,$C11B | |||||||||||||||||||
| 6C07 | LD BC,$0615 | |||||||||||||||||||
| 6C0A | LDIR | |||||||||||||||||||
| 6C0C | LD HL,$BA8A | Copies Locations to CopyOfLocations ($5D9 bytes). | ||||||||||||||||||
| 6C0F | LD BC,$05D9 | |||||||||||||||||||
| 6C12 | LDIR | |||||||||||||||||||
| 6C14 | LD DE,$5F00 | Copies B6EB to $5F00 ($1D bytes). | ||||||||||||||||||
| 6C17 | LD HL,$B6EB | |||||||||||||||||||
| 6C1A | LD BC,$001D | |||||||||||||||||||
| 6C1D | LDIR | |||||||||||||||||||
| 6C1F | LD HL,$CA84 | Copies $CA84 to $5F1D ($BF bytes). | ||||||||||||||||||
| 6C22 | LD BC,$00BF | |||||||||||||||||||
| 6C25 | LDIR | |||||||||||||||||||
|  | ||||||||||||||||||||
| ReStart | 6C27 | DI | Disable interrupts. | |||||||||||||||||
| 6C28 | LD SP,$5EFF | Set the stack pointer to 5EFF. | ||||||||||||||||||
| 
Reset the border and paper colours for location $05 - "Trolls Clearing".
 | ||||||||||||||||||||
| 6C2B | LD IX,$CC00 | IX=LocGFXTable | ||||||||||||||||||
| 6C2F | LD A,$05 | Call IndexIdTable with location $05 - "Trolls Clearing". | ||||||||||||||||||
| 6C31 | CALL IndexIdTable | |||||||||||||||||||
| 6C34 | LD L,(IX+$01) | HL=E142 (HL=location graphics data for "Trolls Clearing"). | ||||||||||||||||||
| 6C37 | LD H,(IX+$02) | |||||||||||||||||||
| 6C3A | LD (HL),$00 | Write $00 (black) to the first (border) and second (paper) addresses. | ||||||||||||||||||
| 6C3C | INC HL | |||||||||||||||||||
| 6C3D | LD (HL),$00 | |||||||||||||||||||
| 
Copy "clean" data to the game tables ready for a new game.
 | ||||||||||||||||||||
| 6C3F | LD HL,$F400 | Copies CopyOfObjects to Objects ($615 bytes). | ||||||||||||||||||
| 6C42 | LD DE,$C11B | |||||||||||||||||||
| 6C45 | LD BC,$0615 | |||||||||||||||||||
| 6C48 | LDIR | |||||||||||||||||||
| 6C4A | LD DE,$BA8A | Copies CopyOfLocations to Locations ($5D9 bytes). | ||||||||||||||||||
| 6C4D | LD BC,$05D9 | |||||||||||||||||||
| 6C50 | LDIR | |||||||||||||||||||
| 6C52 | LD HL,$5F00 | Copies $5F00 to B6EB ($1D bytes). | ||||||||||||||||||
| 6C55 | LD DE,$B6EB | |||||||||||||||||||
| 6C58 | LD BC,$001D | |||||||||||||||||||
| 6C5B | LDIR | |||||||||||||||||||
| 6C5D | LD DE,$CA84 | Copies $CA84 to $5F1D ($BF bytes). | ||||||||||||||||||
| 6C60 | LD BC,$00BF | |||||||||||||||||||
| 6C63 | LDIR | |||||||||||||||||||
| 6C65 | XOR A | Set the border colour to black. | ||||||||||||||||||
| 6C66 | OUT ($FE),A | |||||||||||||||||||
| 6C68 | LD A,$38 | Write $38 to BORDCR. | ||||||||||||||||||
| 6C6A | LD ($5C48),A | |||||||||||||||||||
| ReStart_Keypress | 6C6D | XOR A | Read from the keyboard port. | |||||||||||||||||
| 6C6E | IN A,($FE) | |||||||||||||||||||
| 6C70 | 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. | ||||||||||||||||||
| 6C72 | CP $1F | Loop back to ReStart_Keypress until any key has been pressed. | ||||||||||||||||||
| 6C74 | JR Z,ReStart_Keypress | |||||||||||||||||||
| 6C76 | LD A,$7F | Read from the keyboard port. 
 | ||||||||||||||||||
| 6C78 | IN A,($FE) | |||||||||||||||||||
| 6C7A | AND %00001000 | Keep bit 3 ("N"). | ||||||||||||||||||
| 6C7C | LD ($B707),A | Write it to B707. | ||||||||||||||||||
| 6C7F | LD HL,$50E0 | Write $50E0 to the percentage buffer. | ||||||||||||||||||
| 6C82 | LD ($85B4),HL | |||||||||||||||||||
| 6C85 | LD A,$2B | Write $2B to $85B6. | ||||||||||||||||||
| 6C87 | LD ($85B6),A | |||||||||||||||||||
| 6C8A | LD HL,$5020 | Write $5020 to 869C. | ||||||||||||||||||
| 6C8D | LD ($869C),HL | |||||||||||||||||||
| 6C90 | LD A,$01 | Write $01 to 869E. | ||||||||||||||||||
| 6C92 | LD ($869E),A | |||||||||||||||||||
| 6C95 | LD A,$20 | Write $20 to 85B3. | ||||||||||||||||||
| 6C97 | LD ($85B3),A | |||||||||||||||||||
| 6C9A | LD A,$2A | Write $2A to 869B. | ||||||||||||||||||
| 6C9C | LD ($869B),A | |||||||||||||||||||
| 6C9F | LD B,$C8 | Write $00 to C8 bytes, starting from B738 (using Blanker). | ||||||||||||||||||
| 6CA1 | LD HL,$B738 | |||||||||||||||||||
| 6CA4 | CALL Blanker | |||||||||||||||||||
| 6CA7 | LD A,R | R = refresh register; i.e. write a semi-random number to RandomSeed. | ||||||||||||||||||
| 6CA9 | LD ($B70E),A | |||||||||||||||||||
| 6CAC | XOR A | Write $00 to; | ||||||||||||||||||
| 6CAD | LD ($869F),A | |||||||||||||||||||
| 6CB0 | LD ($86A0),A | |||||||||||||||||||
| 6CB3 | LD ($B71A),A | |||||||||||||||||||
| 6CB6 | LD ($B700),A | |||||||||||||||||||
| 6CB9 | LD ($B6F2),A | |||||||||||||||||||
| 6CBC | LD A,$01 | Write $01 to; | ||||||||||||||||||
| 6CBE | LD ($B702),A | |||||||||||||||||||
| 6CC1 | LD ($B6FA),A | |||||||||||||||||||
| 6CC4 | LD ($B704),A | |||||||||||||||||||
| 6CC7 | LD HL,$0000 | Write $0000 to PercentageComplete. | ||||||||||||||||||
| 6CCA | LD ($B6F7),HL | |||||||||||||||||||
| Prev: 67AB | Up: Map | Next: 6CCD |