Prev: 933E Up: Map Next: 9395
9356: Draw Terrain?
Used by the routines at A1AA and LevelNew.
9356 LD HL,($607A) HL=607A.
9359 LD DE,$FF88 DE=FF88.
935C ADD HL,DE HL+=DE.
935D LD A,H A=H.
935E AND %00011111 Keep only bits 0-4.
9360 LD H,A H=A.
9361 SRA H
9363 RR L
9365 SRA H
9367 RR L
9369 SRA H
936B RR L
936D LD DE,$50C0 DE=50C0.
9370 LD BC,$7000 BC=TerrainData_Active.
9373 LD A,$20 A=20.
9375 PUSH AF Stash AF and HL on the stack.
9376 PUSH HL
9377 ADD HL,BC HL+=BC.
9378 PUSH BC Stash BC and DE on the stack.
9379 PUSH DE
937A CALL $917C Call 917C.
937D POP DE Restore DE from the stack.
937E INC E Increment E by one.
937F POP BC Restore BC and HL from the stack.
9380 POP HL
9381 INC HL Increment HL by one.
9382 LD A,H A=H.
9383 AND %00000011 Keep only bits 0-1.
9385 LD H,A H=A.
9386 POP AF Restore AF from the stack.
9387 DEC A Decrease A by one.
9388 JR NZ,$9375 Jump back to 9375 unless A is now zero.
938A LD HL,$5AE1 HL=5AE1.
938D LD BC,$1E5B BC=1E5B.
9390 LD (HL),C Write C to HL.
9391 INC HL Increment HL by one.
9392 DJNZ $9390 Decrease counter by one and loop back to 9390 until counter is zero.
9394 RET Return.
Prev: 933E Up: Map Next: 9395