Prev: 26539 Up: Map Next: 27853
27648: 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 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 1557 bytes from Objects to CopyOfObjects.
27652 LD HL,49435
27655 LD BC,1557
27658 LDIR
27660 LD HL,47754 Copies 1497 bytes from Locations to CopyOfLocations.
27663 LD BC,1497
27666 LDIR
27668 LD DE,24320 Copies 29 bytes from 46827 to 24320.
27671 LD HL,46827
27674 LD BC,29
27677 LDIR
27679 LD HL,51844 Copies 191 bytes from 51844 to 24349.
27682 LD BC,191
27685 LDIR
This entry point is used by the routines at Command_FollowTheGrammarFlag, LoadBlock and YouAreDead.
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 Point IX at the location graphics table.
27695 LD A,5 Call IndexIdTable with location 5 - "Trolls Clearing".
27697 CALL IndexIdTable
27700 LD L,(IX+1) Read the low byte of the graphics address for 5 (Graphics_TrollsClearing).
27703 LD H,(IX+2) Read the high byte of the graphics address for 5 (Graphics_TrollsClearing).
27706 LD (HL),0 Write 0 over the border and colour of Trolls Clearing, Graphics_TrollsClearing and the next byte.
27708 INC HL
27709 LD (HL),0
Copy "clean" data to the game tables ready for a new game.
27711 LD HL,62464 Copies 1557 bytes from CopyOfObjects to Objects.
27714 LD DE,49435
27717 LD BC,1557
27720 LDIR
27722 LD DE,47754 Copies 1497 bytes from CopyOfLocations to Locations.
27725 LD BC,1497
27728 LDIR
27730 LD HL,24320 Copies 29 bytes from 24320 to 46827.
27733 LD DE,46827
27736 LD BC,29
27739 LDIR
27741 LD DE,51844 Copies 191 bytes from 24349 back to 51844.
27744 LD BC,191
27747 LDIR
27749 XOR A Set the border colour to BLACK.
27750 OUT (254),A
27752 LD A,56 Write INK: BLACK, PAPER: WHITE to BORDCR.
27754 LD (23624),A
Restart_Keypress 27757 XOR A Read from the keyboard port.
27758 IN A,(254)
27760 AND %00011111 Keep bits 0-4, one for each key in the half-row. XOR A then IN A,(254) reads every half-row at once, and a pressed key reads as a reset bit.
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.
Port Number Bit
0 1 2 3 4
127 SPACE SYMBOL SHIFT M N B
27768 IN A,(254)
27770 AND %00001000 Keep bit 3 ("N").
27772 LD (46855),A Write it to 46855.
27775 LD HL,20704 Write 20704 to the percentage buffer.
27778 LD (34228),HL
27781 LD A,43 Write 43 to 34230.
27783 LD (34230),A
27786 LD HL,20512 Write 20512 to 34460.
27789 LD (34460),HL
27792 LD A,1 Write 1 to 34462.
27794 LD (34462),A
27797 LD A,32 Write 32 to 34227.
27799 LD (34227),A
27802 LD A,42 Write 42 to PrintWriteACharacterToTheScreen.
27804 LD (34459),A
27807 LD B,200 Write 0 to 200 bytes, starting from 46904 with Blanker.
27809 LD HL,46904
27812 CALL Blanker
27815 LD A,R Store the refresh register in the random seed.
27817 LD (46862),A
27820 XOR A Clear the space count and the character flag and the matcher path flag.
27821 LD (34463),A
27824 LD (34464),A
27827 LD (46874),A
27830 LD (46848),A Clear the S-types-an-F gate and the printer-on flag.
27833 LD (46834),A
27836 LD A,1 Write 1 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