Prev: B2EE Up: Map Next: B374
B322: Routine at B322
Used by the routine at B3F0.
B322 LD L,(IX+$05) L=*IX+05.
B325 LD A,(IX+$06) A=*IX+06.
B328 AND %00000011 Keep only bits 0-1.
B32A OR %00111000 Set bits 3-5.
B32C LD H,A H=A.
B32D ADD HL,HL HL+=HL.
B32E LD E,(IX+$01) E=*IX+01.
B331 LD D,(IX+$02) D=*IX+02.
B334 LD C,(IX+$03) C=*IX+03.
B337 LD B,(IX+$04) B=*IX+04.
B33A PUSH BC Stash BC, DE, HL and HL on the stack.
B33B PUSH DE
B33C PUSH HL
B33D PUSH HL
B33E LD B,(HL) B=*HL.
B33F INC HL Increment HL by one.
B340 LD H,(HL) H=*HL.
B341 BIT 7,H Jump to B36E if bit 7 of H is not set.
B343 JR Z,$B36E
B345 LD L,B L=B.
B346 LD B,$08 B=08.
B348 LD A,(HL) A=*HL.
B349 LD (DE),A Write A to *DE.
B34A INC HL Increment HL by one.
B34B INC D Increment D by one.
B34C DJNZ $B348 Decrease counter by one and loop back to B348 until counter is zero.
B34E DEC C Decrease C by one.
B34F JR Z,$B364 Jump to B364 if C is zero.
B351 LD A,E E+=20.
B352 ADD A,$20
B354 LD E,A
B355 JR C,$B35B Jump to B35B if {} is lower.
B357 LD A,D D-=08.
B358 SUB $08
B35A LD D,A
B35B POP HL Restore HL from the stack.
B35C LD A,C A=C.
B35D LD BC,$0040 HL+=0040.
B360 ADD HL,BC
B361 LD C,A C=A.
B362 JR $B33D Jump to B33D.
B364 POP HL Restore HL, HL, DE and BC from the stack.
B365 POP HL
B366 POP DE
B367 POP BC
B368 INC E Increment E by one.
B369 INC L Increment L by two.
B36A INC L
B36B DJNZ $B33A Decrease counter by one and loop back to B33A until counter is zero.
B36D RET Return.
B36E LD A,D D+=08.
B36F ADD A,$08
B371 LD D,A
B372 JR $B34E Jump to B34E.
Prev: B2EE Up: Map Next: B374