![]() |
Routines |
| Prev: D2F5 | Up: Map | Next: D33C |
|
Used by the routine at CountMatchingAttributes.
Walks the object list at Table_Objects until the id matches.
|
||||
| ScanObjectsId | D305 | PUSH IX | Use the objects at Table_Objects. | |
| D307 | LD IX,$8B6F | |||
| ScanObjectsId_UseCharacter | D30B | CALL FetchNextObjectWithID | Go to ScanObjectsId_Save if there is no further object. | |
| D30E | JR Z,ScanObjectsId_Save | |||
| D310 | CP (IY+$01) | Jump back to ScanObjectsId_UseCharacter while this id does not match the schedule entry. | ||
| D313 | JR NZ,ScanObjectsId_UseCharacter | |||
| D315 | PUSH AF | Keep the low byte and go to ScanObjectsId_Next if the count is zero. | ||
| D316 | SUB A | |||
| D317 | CP B | |||
| D318 | LD A,C | |||
| D319 | JR Z,ScanObjectsId_Next | |||
| D31B | ADD A,(IY+$02) | Add the attribute at offset 02 and go to ScanObjectsId_BringObjectCarry when the sum overflows. | ||
| D31E | JP PE,ScanObjectsId_BringObjectCarry | |||
| D321 | LD C,A | Jump ahead to ScanObjectsId_FetchObject to fetch the next object. | ||
| D322 | JR ScanObjectsId_FetchObject | |||
|
Add the schedule field onto the result, then store the result in the low byte of the count, then read the record flag.
|
||||
| ScanObjectsId_Next | D324 | ADD A,(IY+$03) | Add the attribute at offset 03 and go to ScanObjectsId_BringObjectCarry when the sum overflows. | |
| D327 | JP PE,ScanObjectsId_BringObjectCarry | |||
| D32A | LD C,A | Store the sum as the count, read the record's flag byte and call ScanObjectsId. | ||
| D32B | LD A,(IX+$00) | |||
| D32E | CALL ScanObjectsId | |||
| ScanObjectsId_FetchObject | D331 | POP AF | Fetch the next object from ScanObjectsId_UseCharacter. | |
| D332 | JR ScanObjectsId_UseCharacter | |||
|
Return.
|
||||
| ScanObjectsId_Save | D334 | POP IX | Restore the saved character record from the stack. | |
| D336 | RET | Return. | ||
|
Bring back the object id and carry on with the scan.
|
||||
| ScanObjectsId_BringObjectCarry | D337 | POP AF | Jump back to ScanObjectsId_Save to count FF. | |
| D338 | LD C,$FF | |||
| D33A | JR ScanObjectsId_Save | |||
|
View the equivalent code in;
|
||||
| Prev: D2F5 | Up: Map | Next: D33C |