Prev: E4FB Up: Map Next: E560
E510: Store The Result In The High Byte
The opening bytes are data. The instructions that follow store the display pointer. A non-zero return means the script step succeeded. Reached from the script record at E508.
StoreResultHighByte E510 DEFB $57,$70,$E3,$FD,$FC,$0F,$E5 Refresh the room from the text at E370, using the low byte of the location, the high byte of the location and otherwise continue at E50F.
E517 DEFB $0B Run the nested character script.
E518 DEFB $6D,$0D,$FC,$E4 Display record read by ProcessDisplayRecord: flags 6D value 0D handler E4FC.
Run by CA64 after the display record at E518.
E51C LD A,$FE Take FE for the location value.
E51E LD ($9FD7),A Store it at LocationValue.
E521 LD L,(IX+$09) Read the text pointer at offsets 09 and 0A.
E524 LD H,(IX+$0A)
E527 SET 7,L Set bit 7 of the pointer's low byte.
E529 LD ($A02F),HL Record the display pointer.
E52C OR %00000001 Reset the zero flag.
E52E RET Return.
Named from the script commands at E456, E732, E745, E751, EEAA, EF34, F004, F080, F2BA, F2D3, F2FF and F334.
E52F DEFB $07,$07 Display record read by ProcessDisplayRecord: flags 07 value 07.
Run by CA64 after the display record at E52F.
E531 LD A,$02 Take 02 as the number of bytes to allocate.
E533 CALL AllocateMemory Call AllocateMemory to build the pointer the clock update stores.
E536 LD HL,($9FE5) Read the clock at 9FE5 into HL and store IX in its place.
E539 LD ($9FE5),IX
E53D LD (IX-$02),L Store the low byte of the pointer in the previous record.
E540 LD (IX-$01),H Store the high byte of the pointer in the previous record.
E543 LD A,($A036)
E546 LD (IX+$00),A Store the record's flag byte.
E549 LD A,($A035) Jump to StoreResultHighByte_MovedMarker if the room graphics parameter is FF.
E54C LD B,$00
E54E CP $FF
E550 JR Z,StoreResultHighByte_MovedMarker
Get character attribute with sign.
E552 CALL GetRandomNumber Call GetRandomNumber to read the signed character attribute.
E555 LD B,A Use the get character attribute with sign result as the count.
StoreResultHighByte_MovedMarker E556 LD A,($A034) Add the count to the room display parameter and store it as the moved marker.
E559 ADD A,B
E55A LD (IX+$01),A
E55D OR %00000001 Reset the zero flag.
E55F RET Return.
Prev: E4FB Up: Map Next: E560