![]() |
Routines |
| Prev: 44409 | Up: Map | Next: 44557 |
|
Used by the routine at GameEntryPoint.
|
||||
| GameStart | 44449 | LD HL,40840 | HL=Table_ItemLocations. | |
| 44452 | LD BC,385 | BC=0385. | ||
| GameStart_0 | 44455 | LD (HL),0 | Write 0 to *HL. | |
| 44457 | INC HL | Move HL on to the next byte to clear. | ||
| 44458 | DEC BC | Count down the 0385 bytes and loop back to GameStart_0 until all are cleared. | ||
| 44459 | LD A,B | |||
| 44460 | OR C | |||
| 44461 | JR NZ,GameStart_0 | |||
| 44463 | LD HL,47883 | Copy 0136 bytes of data (count is via *Count_Objects_1) from Table_InitialItemLocations to Table_ItemLocations. | ||
| 44466 | LD DE,40840 | |||
| 44469 | LD BC,(48071) | |||
| 44473 | LDIR | |||
| 44475 | LD A,(48087) | Write *InitialCarryingLimit to *CarryingLimit. | ||
| 44478 | LD (41171),A | |||
| 44481 | LD IX,47865 | IX=Table_SavedStateAddresses. | ||
| 44485 | LD DE,47877 | DE=InitialSavedStateBytes. | ||
| 44488 | LD A,(48081) | B=*Count_SavedStateBytes. | ||
| 44491 | LD B,A | |||
| GameStart_1 | 44492 | LD L,(IX+0) | L=*IX+0. | |
| 44495 | LD H,(IX+1) | H=*IX+1. | ||
| 44498 | LD A,(DE) | A=*DE. | ||
| 44499 | LD (HL),A | Write that initial-state byte through the address from Table_SavedStateAddresses. | ||
| 44500 | INC IX | Move IX on to the next initial-state address. | ||
| 44502 | INC IX | |||
| 44504 | INC DE | Move DE on to the next initial-state byte. | ||
| 44505 | DJNZ GameStart_1 | Decrease the init counter and loop back to GameStart_1 until every saved-state address is primed. | ||
| 44507 | CALL JustReturn | Call JustReturn. | ||
| 44510 | LD A,(48083) | Write *StartingRoom to *CurrentRoom. | ||
| 44513 | LD (41222),A | |||
| 44516 | CALL ChangeRoom | Call ChangeRoom. | ||
| GameStart_2 | 44519 | CALL Handler_GameEvents | Call Handler_GameEvents. | |
| 44522 | CALL Handler_ScenicEvents | Call Handler_ScenicEvents. | ||
| 44525 | LD A,0 | A=0. | ||
| 44527 | CALL TestFlag | Call TestFlag. | ||
| 44530 | JR NZ,GameOver | End the game when the player is dead. | ||
| 44532 | LD A,1 | A=1. | ||
| 44534 | CALL TestFlag | Call TestFlag. | ||
| 44537 | JR NZ,GameOver_Score | End the game and show the score. | ||
| 44539 | LD A,2 | A=2. | ||
| 44541 | CALL TestFlag | Call TestFlag. | ||
| 44544 | JR NZ,WantAnotherGameInput | End the game and ask for another one. | ||
| 44546 | CALL Handler_UserInput | Call Handler_UserInput. | ||
| 44549 | CALL Parser_ProcessItem | Call Parser_ProcessItem. | ||
| 44552 | CALL NC,Handler_DispatchVerb | Call Handler_DispatchVerb if C is greater than 2. | ||
| 44555 | JR GameStart_2 | Jump to GameStart_2. | ||
| Prev: 44409 | Up: Map | Next: 44557 |