![]() |
Routines |
| Prev: D904 | Up: Map | Next: DA3F |
|
Used by the routine at Dispatch_Handlers.
Two bats in room 07 stored at SpecialActor.
|
||||
| Handler_RoomSeven | D9B6 | LD IX,$644D | IX=SpecialActor. | |
| D9BA | LD A,($64A2) | Return if *CurrentRoom is not 07. | ||
| D9BD | CP $07 | |||
| D9BF | RET NZ | Write 0E to *ClipWindow_MaximumRow. | ||
| D9C0 | LD A,$0E | |||
| D9C2 | LD ($641A),A | |||
| D9C5 | LD B,$02 | B=02. | ||
| Handler_RoomSeven_Loop | D9C7 | PUSH BC | Stash the bat count on the stack. | |
| D9C8 | LD A,(IX+$00) | Jump to Handler_RoomSeven_Move if this bat is already active. | ||
| D9CB | BIT 7,A | |||
| D9CD | JR Z,Handler_RoomSeven_Move | |||
| D9CF | CALL JumpTable_GetRandomNumber | Jump to Handler_RoomSeven_Next if JumpTable_GetRandomNumber is BE or higher. | ||
| D9D2 | CP $BE | |||
| D9D4 | JR NC,Handler_RoomSeven_Next | |||
| D9D6 | AND $0F | Spawn the bat with sprite E7. | ||
| D9D8 | ADD A,$09 | |||
| D9DA | LD C,A | |||
| D9DB | LD B,$19 | |||
| D9DD | LD DE,$0101 | |||
| D9E0 | LD L,$46 | |||
| D9E2 | LD A,$E7 | |||
| D9E4 | CALL JumpTable_SpawnEntity | |||
| D9E7 | LD (IX+$09),$FA | Write FA to the bat timer. | ||
| Handler_RoomSeven_Move | D9EB | LD A,(IX+$01) | Deactivate the bat if it has reached row 0C. | |
| D9EE | CP $0C | |||
| D9F0 | JR NZ,Handler_RoomSeven_Draw | |||
| D9F2 | SET 7,(IX+$00) | |||
| D9F6 | JR Handler_RoomSeven_Next | Jump to Handler_RoomSeven_Next. | ||
| Handler_RoomSeven_Draw | D9F8 | CALL JumpTable_AdvanceEntity | Call JumpTable_AdvanceEntity. | |
| D9FB | CALL JumpTable_StorePosition | Call JumpTable_StorePosition. | ||
| D9FE | CALL JumpTable_MoveEntity | Call JumpTable_MoveEntity. | ||
| DA01 | CALL JumpTable_DrawEntity | Call JumpTable_DrawEntity. | ||
| DA04 | CALL JumpTable_EraseEntity | Call JumpTable_EraseEntity. | ||
| Handler_RoomSeven_Next | DA07 | POP BC | Restore the bat count from the stack. | |
| DA08 | LD DE,$000E | IX+=000E. | ||
| DA0B | ADD IX,DE | |||
| DA0D | DJNZ Handler_RoomSeven_Loop | Decrease the bat count and loop back to Handler_RoomSeven_Loop. | ||
| DA0F | LD A,$02 | Write 02 to *ClipWindow_MaximumRow. | ||
| DA11 | LD ($641A),A | |||
| DA14 | RET | Return. | ||
|
This entry point is used by the routines at Change_Room and Handler_InventoryItems.
Draw the collected-item icons along the top of the screen.
|
||||
| Print_CollectionBar | DA15 | LD HL,$7C70 | Write Buffer_ActiveFont to *CHARS. | |
| DA18 | LD ($5C36),HL | |||
| DA1B | LD BC,$0119 | Call JumpTable_SetPrintPosition at column 01 row 19. | ||
| DA1E | CALL JumpTable_SetPrintPosition | |||
| DA21 | LD B,$00 | Write WHITE to *ATTR_T. | ||
| DA23 | LD A,$07 | |||
| DA25 | LD ($5C8F),A | |||
| Print_CollectionBar_Loop | DA28 | LD A,($64A1) | Highlight the current icon in BLACK. | |
| DA2B | CP B | |||
| DA2C | JR NZ,Print_CollectionBar_Glyph | |||
| DA2E | LD A,$38 | |||
| DA30 | LD ($5C8F),A | |||
| Print_CollectionBar_Glyph | DA33 | LD A,$E4 | Print glyph E4. | |
| DA35 | CALL JumpTable_PrintCharacter | |||
| DA38 | INC B | Jump to Print_CollectionBar_Loop until 10 icons are printed. | ||
| DA39 | LD A,B | |||
| DA3A | CP $10 | |||
| DA3C | JR NZ,Print_CollectionBar_Loop | Return. | ||
| DA3E | RET | |||
| Prev: D904 | Up: Map | Next: DA3F |