| Routines

30017: Initialise the events and objects for a new game

Continues from the routine at 31458. First we initialise the entries in the event table at 24544.
30017 | LD HL,24544 | The event table starts at 24544
30020 | LD DE,0 | DE will be used to move HL from one entry to the next; initialise it to 0
30023 | ADD HL,DE | Point HL at the next entry in the table
30024 | CALL 30043 | Initialise the entry
30027 | INC HL | Prepare DE to point HL at the next event entry
30028 | LD E,(HL)
30029 | JR NZ,30023 | Jump back until every entry has been processed
Now we initialise the entries in the object location table at 32028.
30031 | LD E,4 | Each entry is 4 bytes long
30033 | LD HL,32028 | The object location table starts at 32028
30036 | CALL 30043 | Initialise the entry
30039 | RET Z | Return if we've reached the end of the table
30040 | ADD HL,DE | Point HL at the next entry
30041 | JR 30036 | Jump back to process the next entry