Prev: A2CE Up: Map Next: A379
A311: Menu Icons
Used by the routine at GameInitialisation.
Draws the nine icons of the menu. The data for each one is the same as an entity record, which is copied from the table at MenuEntities to EntityToDraw, drawn with DrawEntity and then coloured with SetEntityAttributes.
Before After
menu-icons-before menu-icons-after
MenuIcons A311 LD IX,$A17D Point IX at the entity to draw at EntityToDraw.
A315 LD HL,$A331 Point HL at the table of icons at MenuEntities.
A318 LD B,$09 B=09 (the number of icons).
MenuIcons_Loop A31A PUSH BC Stash the icon counter on the stack.
A31B LD DE,$A17D Copy 08 bytes of data from HL to EntityToDraw.
A31E LD BC,$0008
A321 LDIR
A323 PUSH HL Stash HL and DE on the stack.
A324 PUSH DE
A325 CALL DrawEntity Call DrawEntity to draw the entity.
A328 CALL SetEntityAttributes Call SetEntityAttributes to set the attributes of the entity.
A32B POP DE Restore DE and HL from the stack.
A32C POP HL
A32D POP BC Restore the icon counter from the stack.
A32E DJNZ MenuIcons_Loop Decrease the icon counter by one and loop back to MenuIcons_Loop until all nine icons have been drawn.
A330 RET Return.
The sprite IDs are stored +01 higher than their actual value.
MenuEntities A331 DEFB $32,$00,$00,$20,$4F,$46,$00,$00
Address Sprite Attribute Screen Buffer Location
A331 "Cursor: Left" 20 464F
A339 "Cursor: Right" 30 464F
A341 "Joystick: Left" 20 444F
A349 "Joystick: Right" 30 444F
A351 "Keyboard: Left" 20 434F
A359 "Keyboard: Right" 30 434F
A361 "Knight: Left Frame 1" 28 474F
A369 "Wizard: Left Frame 1" 28 474F
A371 "Serf: Left Frame 1" 28 4797
A339 DEFB $33,$00,$00,$30,$4F,$46,$00,$00
A341 DEFB $4A,$00,$00,$20,$37,$44,$00,$00
A349 DEFB $4B,$00,$00,$30,$37,$44,$00,$00
A351 DEFB $48,$00,$00,$20,$1C,$43,$00,$00
A359 DEFB $49,$00,$00,$30,$1C,$43,$00,$00
A361 DEFB $01,$00,$00,$28,$67,$47,$00,$00
A369 DEFB $11,$00,$00,$28,$7F,$47,$00,$00
A371 DEFB $21,$00,$00,$28,$97,$47,$00,$00
Prev: A2CE Up: Map Next: A379