Prev: EF7E Up: Map Next: F041
EFBD: Draw static UDGs on the start room
Used by the routine at EF7E.
Input
HL Pointer to graphic IDs
A Character to print
D Y position
E X position
B Current row count
EFBD PUSH AF Store all registers being used.
EFBE PUSH BC
EFBF PUSH HL
EFC0 PUSH DE
EFC1 CP $7F If the character is 50 or above, move forward.
EFC3 JR NC,$F033
This is an ordinary character in the ROM.
EFC5 LD H,$00 Put the character in HL.
EFC7 LD L,A
EFC8 ADD HL,HL Multiply by 8 to get the correct offset.
EFC9 ADD HL,HL
EFCA ADD HL,HL
EFCB LD BC,$3C00 Add the base address for the ROM character set.
Now print the character.
EFCE ADD HL,BC Add the offset to the base address.
EFCF LD ($F047),HL Store the current address being printed.
EFD2 LD A,D Convert the Y position to a screen offset.
EFD3 SUB $17
EFD5 NEG
EFD7 LD L,A Put this in HL.
EFD8 LD H,$00
EFDA ADD HL,HL Multiply by 8 to get the correct offset.
EFDB ADD HL,HL
EFDC ADD HL,HL
EFDD LD BC,$0007 Add an offset of 7 to point at the bottom of the graphic.
EFE0 ADD HL,BC
EFE1 EX DE,HL Add the base address for the screen address buffer.
EFE2 LD HL,$EA60
EFE5 ADD HL,DE
EFE6 ADD HL,DE
EFE7 LD ($F049),HL Store this.
EFEA LD B,$08 Print 8 rows.
EFEC LD A,(HL) Put the actual screen address in HL.
EFED INC HL
EFEE LD H,(HL)
EFEF LD L,A
EFF0 POP DE Restore the X co-ordinate.
EFF1 PUSH DE Store it again.
EFF2 LD D,$00 Add it to the screen address.
EFF4 ADD HL,DE
EFF5 EX DE,HL Convert this into an address in the screen buffer.
EFF6 CALL $FE8F
EFF9 LD A,(HL) Get the byte.
EFFA INC HL Move to the next data position and store it.
EFFB LD ($F047),HL
EFFE EX DE,HL Restore HL.
EFFF LD (HL),A Set the byte.
F000 LD HL,($F049) Move the current screen address up a row.
F003 DEC HL
F004 DEC HL
F005 LD ($F049),HL
F008 DJNZ $EFEC Loop until all rows have been printed.
F00A POP DE Restore DE and HL.
F00B POP HL
F00C PUSH HL Get an offset to the attribute buffer.
F00D PUSH DE
F00E LD DE,$0230
F011 ADD HL,DE
F012 DEC HL Move up a row.
F013 POP DE Restore DE.
F014 PUSH DE Store it again.
F015 LD A,E Put the Y co-ordinate in HL.
F016 LD E,D
F017 LD D,$00
F019 EX DE,HL
F01A LD B,$05 Multiply 2^5 times ie: 32 to get an appropriate address.
F01C ADD HL,HL
F01D DJNZ $F01C
F01F PUSH DE Store DE.
F020 LD E,A Add the X co-ordinate.
F021 LD D,$00
F023 ADD HL,DE
F024 LD DE,$CF54 Add the base address of the attribute buffer.
F027 ADD HL,DE
F028 POP DE Restore DE.
F029 EX DE,HL Copy the graphic data.
F02A LD A,(HL)
F02B EX DE,HL
F02C LD (HL),A
F02D POP DE Restore DE
F02E INC E Move to the next row.
F02F POP HL Restore all registers and return.
F030 POP BC
F031 POP AF
F032 RET
This is a custom character.
F033 SUB $80 Subtract 80 to get the real value.
F035 LD H,$00 Put this in HL.
F037 LD L,A
F038 ADD HL,HL Multiply by 8 to get an offset in the screen buffer.
F039 ADD HL,HL
F03A ADD HL,HL
F03B LD BC,($F043) Get the start of the graphics.
F03F JR $EFCE Print the character.
Prev: EF7E Up: Map Next: F041