Prev: B29C Up: Map Next: B3B6
B342: Routine at B342
Used by the routine at AFB5.
B342 PUSH HL Stash HL on the stack.
B343 LD ($B410),A Write A to *B410.
B346 LD D,A D=A.
B347 LD A,$44 Write INK: GREEN, PAPER: BLACK (BRIGHT) to *B418.
B349 LD ($B418),A
B34C LD A,D A=D.
B34D CALL $B402 Call B402.
B350 CP (IX+$00) Jump to B36C if *IX+00 is greater than or equal to 44.
B353 JR NC,$B36C
B355 LD A,(HL) Write *HL to *B411.
B356 LD ($B411),A
B359 CALL $B38E Call B38E.
B35C LD D,A D=A.
B35D LD A,($B419) A=*B419.
B360 CP $44 Jump to B369 if A is not equal to 44.
B362 JR NZ,$B369
B364 LD A,$FF Write FF to *B412.
B366 LD ($B412),A
B369 LD A,D A=D.
B36A JR $B383 Jump to B383.
B36C CP (IX+$01) Jump to B37B if *IX+01 is greater than or equal to FF.
B36F JR NC,$B37B
B371 DEC HL Decrease HL by one.
B372 LD A,(HL) Write *HL to *B411.
B373 LD ($B411),A
B376 CALL $B38E Call B38E.
B379 JR $B383 Jump to B383.
B37B INC HL Increment HL by one.
B37C LD A,(HL) A=*HL.
B37D LD ($B411),A Write A to *B411.
B380 CALL $B38E Call B38E.
B383 POP HL Restore HL from the stack.
B384 LD ($B40C),A Write A to *B40C.
B387 LD E,A E=A.
B388 LD D,$00 D=00.
B38A AND A Set flags.
B38B SBC HL,DE HL-=DE (with carry).
B38D RET Return.
B38E LD B,A B=A.
B38F LD E,$C8 E=C8.
B391 CALL $A875 Call A875.
B394 CP (IX+$02) Compare A with *IX+02.
B397 JR NC,$B3A2 Jump to B3A2 if HL is greater than or equal to A.
B399 LD A,$44 Write INK: GREEN, PAPER: BLACK (BRIGHT) to *B419.
B39B LD ($B419),A
B39E LD A,B A=B.
B39F ADD A,A A+=A.
B3A0 JR $B3B5 Jump to B3B5.
B3A2 CP (IX+$03) Compare A with *IX+03.
B3A5 JR NC,$B3AF Jump to B3AF if HL is greater than or equal to A.
B3A7 LD A,$53 Write 53 to *B419.
B3A9 LD ($B419),A
B3AC LD A,B A=B.
B3AD JR $B3B5 Jump to B3B5.
B3AF LD A,$4D Write INK: CYAN, PAPER: BLUE (BRIGHT) to *B419.
B3B1 LD ($B419),A
B3B4 XOR A A=00.
B3B5 RET Return.
Prev: B29C Up: Map Next: B3B6