![]() |
Routines |
| Prev: 58753 | Up: Map | Next: 59068 |
|
Used by the routine at InitialiseGame.
|
||||
| Handler_Items | 58868 | LD IX,(23520) | Point IX at *ReferenceItems. | |
|
Walk the item table looking for one the player is standing on.
|
||||
| Handler_Items_Loop | 58872 | LD A,(IX+0) | Return if this item entry is the terminator (255). | |
| 58875 | CP 255 | |||
| 58877 | RET Z | |||
| 58878 | LD C,A | C=this item's horizontal co-ordinate. | ||
| 58879 | LD B,(IX+1) | B=this item's vertical co-ordinate. | ||
| 58882 | LD A,(IX+5) | Jump to Handler_Items_Next if this item has already been collected. | ||
| 58885 | CP 0 | |||
| 58887 | JR Z,Handler_Items_Next | |||
| 58889 | LD A,(62002) | A=*PlayerVerticalCoordinate. | ||
| 58892 | DEC A | Move one row up to the player's feet. | ||
| 58893 | CP B | Jump to Handler_Items_Next if the player is not on this item's row. | ||
| 58894 | JR NZ,Handler_Items_Next | |||
| 58896 | LD A,(62001) | A=*TablePlayerAttributes. | ||
| 58899 | SUB C | Subtract the item column. | ||
| 58900 | JR Z,Item_Collected | Jump to Item_Collected if the player is in this item's column. | ||
| 58902 | CP 255 | |||
| 58904 | JR Z,Item_Collected | |||
| Handler_Items_Next | 58906 | LD DE,7 | Move IX on to the next seven-byte item entry. | |
| 58909 | ADD IX,DE | |||
| 58911 | JR Handler_Items_Loop | Jump to Handler_Items_Loop. | ||
| Item_Collected | 58913 | CALL Controller_BombCheck | Maybe place a bomb at this item. | |
| 58916 | LD A,4 | Queue the collected-item sound at SoundFlag_General. | ||
| 58918 | LD (65534),A | |||
| 58921 | LD A,0 | A=0. | ||
| 58923 | LD D,2 | Set the blank sprite width/ height (2/ 2). | ||
| 58925 | LD E,2 | |||
| 58927 | PUSH DE | Stash the blank size on the stack. | ||
| 58928 | CALL WriteGameSpriteBuffer | Blank the item in the game sprite buffer. | ||
| 58931 | CALL 3545 | Call CL_SET. | ||
| 58934 | POP DE | Restore the blank size from the stack. | ||
| 58935 | LD HL,40812 | Write 40812 to *CHARS. | ||
| 58938 | LD (23606),HL | |||
| 58941 | LD A,32 | A=a blank character. | ||
| 58943 | CALL PrintSprite | Print the blank over the item. | ||
| 58946 | LD (IX+5),0 | Mark this item as collected. | ||
| 58950 | LD A,16 | Set INK: YELLOW (6). | ||
| 58952 | RST 16 | |||
| 58953 | LD A,6 | |||
| 58955 | RST 16 | |||
| 58956 | LD A,17 | Set PAPER: *Active_BorderColour. | ||
| 58958 | RST 16 | |||
| 58959 | LD A,(23504) | |||
| 58962 | RST 16 | |||
|
Restore the default ZX Spectrum font.
|
||||
| 58963 | LD HL,15360 | Write CHARSET-256 to *CHARS. | ||
| 58966 | LD (23606),HL | |||
| 58969 | LD C,19 | Move the cursor to the booty count. | ||
| 58971 | LD B,1 | |||
| 58973 | CALL 3545 | |||
| 58976 | LD BC,(23540) | Increment *PlayerBooty by one. | ||
| 58980 | INC BC | |||
| 58981 | LD (23540),BC | |||
| 58985 | CALL 6683 | Print the new booty count. | ||
| 58988 | LD C,5 | Move the cursor to the treasure count. | ||
| 58990 | LD B,1 | |||
| 58992 | CALL 3545 | |||
| 58995 | LD BC,(23538) | Decrease *PlayerTreasure by one. | ||
| 58999 | DEC BC | |||
| 59000 | LD (23538),BC | |||
| 59004 | LD A,B | Jump to Item_Collected_TestTreasure if the remaining treasure is not 50. | ||
| 59005 | CP 0 | |||
| 59007 | JR NZ,Item_Collected_TestTreasure | |||
| 59009 | LD A,C | Jump to Item_Collected_TestTreasure if the remaining low byte is not 50. | ||
| 59010 | CP 50 | |||
| 59012 | JR NZ,Item_Collected_TestTreasure | |||
| 59014 | LD A,(23507) | Record the current room in *GoldenKeyRoom. | ||
| 59017 | LD (23548),A | |||
| 59020 | LD A,(IX+0) | Record this item's column in *PositionGoldenKey. | ||
| 59023 | LD (23549),A | |||
| 59026 | LD A,(IX+1) | A=this item's row. | ||
| 59029 | INC A | Move one row down for the golden-key position. | ||
| 59030 | LD (23550),A | Write it to *PositionGoldenKey_Vertical. | ||
| Item_Collected_TestTreasure | 59033 | LD A,C | Test whether any treasure remains. | |
| 59034 | CP 0 | |||
| 59036 | PUSH AF | Stash that result on the stack. | ||
| 59037 | CALL NZ,6683 | Print the remaining treasure if it is not zero. | ||
| 59040 | LD A,32 | A=ASCII "space" (32). | ||
| 59042 | CALL PrintColourCharacter | Call PrintColourCharacter. | ||
| 59045 | POP AF | Restore the remaining-treasure result from the stack. | ||
| 59046 | RET NZ | Return if treasure still remains. | ||
| 59047 | LD A,45 | Start *TimerGoldenKey at 45 seconds. | ||
| 59049 | LD (23551),A | |||
| 59052 | LD BC,20 | Write the golden-key frame skip to *TimerGoldenKey_FrameSkip. | ||
| 59055 | LD (23546),BC | |||
|
Restore the default ZX Spectrum font.
|
||||
| 59059 | LD HL,15360 | Write CHARSET-256 to *CHARS. | ||
| 59062 | LD (23606),HL | |||
| 59065 | JP PrintFindTheGoldKey | Jump to PrintFindTheGoldKey. | ||
| Prev: 58753 | Up: Map | Next: 59068 |