Prev: 45380 Up: Map Next: 45406
45390: Point HL to the E-th byte of the A-th record in object properties table
Used by the routines at 41748, 42638, 43494, 43636, 44337, 44635, 45351, 46380 and 46490.
Input
A Index of required record (i.e. table entry number), first is zero
E Index of required field within record (i.e. byte number), first is zero
HL (entry at 45393 only) Points to table of characters' current stats (Off-White's entry, i.e. not including Magic Knight)
Output
HL Points to required field within record of interest
45390 LD HL,49354 Point HL at start of table of object properties
This entry point is used by the routine at 45406.
45393 PUSH HL Store HL (points to current position in a table of 8-byte-wide records)
45394 ADD A,A Multiply A (record number) by eight and load into HL...
45395 ADD A,A ...
45396 LD L,A ...
45397 LD H,0 ...
45399 ADD HL,HL ...
45400 LD D,0 Set D to zero (DE = field number)
45402 ADD HL,DE Add field number to HL to give exact offset to record and field of interest
45403 POP DE Restore DE (points to current position in a table of 8-byte-wide records)...
45404 ADD HL,DE ...and add to offset value already in HL
45405 RET Return
Prev: 45380 Up: Map Next: 45406