Prev: 67AB Up: Map Next: 6CCD
6C00: Game Entry Point
Starts a game. The clean object, location and save bytes are copied out, then a keypress builds a new game from those copies. Holding N while that key is pressed turns the pictures off.
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 0615 bytes from Objects to CopyOfObjects.
6C04 LD HL,$C11B
6C07 LD BC,$0615
6C0A LDIR
6C0C LD HL,$BA8A Copies 05D9 bytes from Locations to CopyOfLocations.
6C0F LD BC,$05D9
6C12 LDIR
6C14 LD DE,$5F00 Copies 1D bytes from B6EB to 5F00.
6C17 LD HL,$B6EB
6C1A LD BC,$001D
6C1D LDIR
6C1F LD HL,$CA84 Copies BF bytes from CA84 to 5F1D.
6C22 LD BC,$00BF
6C25 LDIR
This entry point is used by the routines at Command_FollowTheGrammarFlag, LoadBlock and YouAreDead.
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 Point IX at the location graphics table.
6C2F LD A,$05 Call IndexIdTable with location 05 - "Trolls Clearing".
6C31 CALL IndexIdTable
6C34 LD L,(IX+$01) Read the low byte of the graphics address for 05 (Graphics_TrollsClearing).
6C37 LD H,(IX+$02) Read the high byte of the graphics address for 05 (Graphics_TrollsClearing).
6C3A LD (HL),$00 Write 00 over the border and colour of Trolls Clearing, Graphics_TrollsClearing and the next byte.
6C3C INC HL
6C3D LD (HL),$00
Copy "clean" data to the game tables ready for a new game.
6C3F LD HL,$F400 Copies 0615 bytes from CopyOfObjects to Objects.
6C42 LD DE,$C11B
6C45 LD BC,$0615
6C48 LDIR
6C4A LD DE,$BA8A Copies 05D9 bytes from CopyOfLocations to Locations.
6C4D LD BC,$05D9
6C50 LDIR
6C52 LD HL,$5F00 Copies 1D bytes from 5F00 to B6EB.
6C55 LD DE,$B6EB
6C58 LD BC,$001D
6C5B LDIR
6C5D LD DE,$CA84 Copies BF bytes from 5F1D back to CA84.
6C60 LD BC,$00BF
6C63 LDIR
6C65 XOR A Set the border colour to BLACK.
6C66 OUT ($FE),A
6C68 LD A,$38 Write INK: BLACK, PAPER: WHITE to BORDCR.
6C6A LD ($5C48),A
Restart_Keypress 6C6D XOR A Read from the keyboard port.
6C6E IN A,($FE)
6C70 AND %00011111 Keep bits 0-4, one for each key in the half-row. XOR A then IN A,(FE) reads every half-row at once, and a pressed key reads as a reset bit.
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.
Port Number Bit
0 1 2 3 4
7F SPACE SYMBOL SHIFT M N B
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 PrintWriteACharacterToTheScreen.
6C9C LD ($869B),A
6C9F LD B,$C8 Write 00 to C8 bytes, starting from B738 with Blanker.
6CA1 LD HL,$B738
6CA4 CALL Blanker
6CA7 LD A,R Store the refresh register in the random seed.
6CA9 LD ($B70E),A
6CAC XOR A Clear the space count and the character flag and the matcher path flag.
6CAD LD ($869F),A
6CB0 LD ($86A0),A
6CB3 LD ($B71A),A
6CB6 LD ($B700),A Clear the S-types-an-F gate and the printer-on flag.
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