Prev: E83E Up: Map Next: E866
E847: Graphic Layout Routine: (F5) Set Next Graphic Index From Random List
Pick the next graphic-set index from the layout's random list.
GraphicLayoutRoutine_SetGraphicFromRandomList E847 PUSH IX Stash IX on the stack.
E849 LD A,(IX+$00) Fetch the current entity's type into A.
E84C CALL PseudoRandom Call PseudoRandom to pick a pseudo-random value.
E84F INC A Step the random-list index on by one.
E850 LD B,$00 Load B with 00.
E852 LD C,A Keep the table index in C.
E853 ADD IX,BC IX+=BC.
E855 LD A,(IX+$00) Fetch the current entity's type into A.
E858 POP IX Restore IX from the stack.
E85A LD C,(IX+$00) Load C with the current entity's entity type.
E85D INC C Advance the saved count in C by one.
E85E ADD IX,BC IX+=BC.
E860 LD (IX+$00),A Set the current entity's entity type.
E863 JP Process_GraphicLayoutData Jump to Process_GraphicLayoutData to process graphic layout data.
View the equivalent code in;
Prev: E83E Up: Map Next: E866