Routines |
Prev: D391 | Up: Map | Next: D3F0 |
highlight_objects | D392 | DI | Disable interrupts and preserve registers. | |
D393 | PUSH AF | |||
D394 | PUSH BC | |||
D395 | PUSH DE | |||
D396 | PUSH HL | |||
D397 | LD HL,map_object_table | Set HL to address of map_object_table. | ||
D39A | LD B,$9F | Set B to 195 as loop counter. | ||
highlight_objects_loop | D39C | PUSH HL | Preserve address and loop counter. | |
D39D | PUSH BC | |||
D39E | LD A,(HL) | If object number is zero jump to ignore_object. | ||
D39F | OR A | |||
D3A0 | JR Z,ignore_object | |||
D3A2 | LD DE,$0141 | Else add $0141 to get corresponding entry in map_animation_frame_table. | ||
D3A5 | ADD HL,DE | |||
D3A6 | LD A,(HL) | If animation frame is $04 (dead sprite) jump to ignore_object. | ||
D3A7 | CP $04 | |||
D3A9 | JR Z,ignore_object | |||
D3AB | LD DE,$00A0 | Else add $00A0 to get corresponding entry in map_object_properties_table. | ||
D3AE | ADD HL,DE | |||
D3AF | LD A,(HL) | Read entry into A. | ||
D3B0 | LD DE,$01E1 | Subtract $01E1 to get corresponding entry in map_object_table. | ||
D3B3 | SBC HL,DE | |||
D3B5 | AND $07 | If low three bits (wizard number) of object properties equal temp_wizard_number jump to owner_matches. | ||
D3B7 | LD E,A | |||
D3B8 | LD A,(temp_wizard_number) | |||
D3BB | CP E | |||
D3BC | JR Z,owner_matches | |||
ignore_object | D3BE | POP BC | Restore loop counter and address in map_object_table. | |
D3BF | POP HL | |||
D3C0 | INC HL | Increment address and loop back to highlight_objects_loop for 160 iterations. | ||
D3C1 | DJNZ highlight_objects_loop | |||
D3C3 | POP HL | Restore registers and return. | ||
D3C4 | POP DE | |||
D3C5 | POP BC | |||
D3C6 | POP AF | |||
D3C7 | RET | |||
owner_matches | D3C8 | LD (temp_entry_pointer),HL | Store address of object properties entry in temp_entry_pointer. | |
D3CB | LD A,$02 | Call CHAN-OPEN in ROM to set output channel to 2 (Screen). | ||
D3CD | CALL $1601 | |||
D3D0 | CALL address_to_coordinate | Convert address of entry to coordinates. | ||
D3D3 | LD A,$16 | Use PRINT-A routine in ROM to print AT control code followed by coordinates H, L. | ||
D3D5 | RST $10 | |||
D3D6 | LD A,H | |||
D3D7 | RST $10 | |||
D3D8 | LD A,L | |||
D3D9 | RST $10 | |||
D3DA | LD A,$8F | Print filled block twice to invert pixels. | ||
D3DC | RST $10 | |||
D3DD | LD A,$8F | |||
D3DF | RST $10 | |||
D3E0 | LD A,$16 | Print AT code followed by coordinates H+1, L. | ||
D3E2 | RST $10 | |||
D3E3 | LD A,H | |||
D3E4 | INC A | |||
D3E5 | RST $10 | |||
D3E6 | LD A,L | |||
D3E7 | RST $10 | |||
D3E8 | LD A,$8F | |||
D3EA | RST $10 | Print filled block twice to invert pixels. | ||
D3EB | LD A,$8F | |||
D3ED | RST $10 | |||
D3EE | JR ignore_object | Jump back to ignore_object. |
Prev: D391 | Up: Map | Next: D3F0 |