Routines |
Prev: C349 | Up: Map | Next: C460 |
Used by the routine at C32D.
|
||||
Run after setting up room's doors. Checks the room object table at 736F and copies any objects to the data sets at 7C00.
|
||||
C42A | LD A,$07 | Maximum of 7 interactable objects displayed in a room. More can be in the room, but they won't appear until Maroc takes an object, leaves and subsequently returns to, the room. | ||
C42C | LD ($EBB7),A | Store as a counter check | ||
C42F | LD HL,($DAF3) | Pointer to room item data tables at 736F | ||
C432 | LD A,$00 | Reset (data set) counter for room object table | ||
C434 | LD ($EB84),A | |||
Set up data for objects in room
|
||||
C437 | LD A,($EAB7) | Get room number | ||
C43A | LD B,A | Used in B register in next CALL | ||
C43B | LD C,$00 | C register used as room counter in next CALL | ||
C43D | CALL $DE4C | Check objects table for what's in the current room | ||
C440 | LD A,($EB84) | |||
C443 | CP $FF | If all objects are dealt with - skip next few instructions | ||
C445 | JR Z,$C460 | |||
Found an object to deal with in this room
|
||||
C447 | LD ($EB7A),HL | Store the room object table address pointer | ||
C44A | CALL $DEB7 | Set up interactable object graphics and copy data into a room item data set at 7C00 | ||
C44D | LD HL,($EB44) | Retrieve address pointer to start of interactable object's data set (at 736F) | ||
C450 | LD (HL),$00 | Set the item's room number to 0, as Maroc is now in the same room as the item | ||
C452 | LD A,($EBB7) | Get maximum object counter (max 7)... | ||
C455 | DEC A | ...Decrement... | ||
C456 | LD ($EBB7),A | ...And re-store. | ||
C459 | JR Z,$C460 | If we've reached the maximum number of objects in this room, jump to next routine | ||
C45B | LD HL,($EB7A) | Otherwise, retrieve the room object table address pointer | ||
C45E | JR $C437 | ...and continue checking for objects. |
Prev: C349 | Up: Map | Next: C460 |