Prev: C15B Up: Map Next: C452
C2E7: Routine at C2E7
Used by the routine at main_loop_13.
C2E7 LD A,IYl A = IY.low
C2E9 CP $13 Compare to 19
C2EB JP NC,$C43B Jump if >= 19
C2EE EX AF,AF' Bank
C2EF LD A,(IX+$00) A = IX[0]
C2F2 LD L,A L = A
C2F3 AND $0C A &= 12
C2F5 JP Z,$C43B Jump if zero
C2F8 DEC IY IY--
C2FA BIT 5,L Bit 5 of L set?
C2FC JR Z,$C305 Jump if clear
C2FE BIT 7,L Bit 7 of L set?
C300 LD H,$EC H = $EC
C302 JR NZ,$C305 Jump if set
C304 DEC H H = $EB
C305 BIT 4,L Bit 4 of L set?
C307 JP Z,$C37E Jump if clear
C30A EX AF,AF' Bank
C30B CP $02 Compare to 2
C30D JP NC,$C357 Jump if >= 2
C310 EX AF,AF' Bank
C311 CP $04 Compare to 4
C313 LD A,$20 A = 32
C315 LD C,(IY+$01) C = IY[1]
C318 JR NZ,$C31E Jump if != 4
C31A XOR A A = 0
C31B LD C,(IY+$02) C = IY[2]
C31E LD ($C346),A Self modify 'ADD A,x' @ C345
C321 LD A,(IY+$00) A = IY[0]
C324 SUB C A -= C
C325 JP C,$C439 Jump if A was <= C
C328 JP Z,$C439
C32B LD C,A C = A
C32C ADD A,A A <<= 1
C32D LD B,A B = A
C32E LD A,$60 L = ~(($60 - IY[0]) << 1)
C330 SUB (IY+$00)
C333 ADD A,A
C334 CPL
C335 LD L,A
C336 LD SP,HL -- why are we copying to SP with no push/pop nearby?
C337 LD D,(HL) D = *HL
C338 DEC L L--
C339 LD E,(HL) E = *HL
C33A SUB B A -= B
C33B LD L,A L = A
C33C DEC H H--
C33D LD A,($A23F) A = fast_counter
C340 RRA A ROR 3
C341 RRA
C342 RRA
C343 AND $1C A &= 28
C345 ADD A,$00 A += <self modified>
C347 LD ($C352),HL Self modify 'LD HL,x' @ C351 below
C34A EX DE,HL Swap
C34B LD E,A DE = A
C34C LD D,$00
C34E SBC HL,DE HL -= DE
C350 EX DE,HL Swap
C351 LD HL,$0000 HL = <self modified>
C354 JP $C3EE Jump
Another case.
C357 EX AF,AF' Bank
C358 CP $04 Compare to 4
C35A JP NZ,$C439 Jump if non-zero
C35D LD A,(IY+$00) A = IY[0] - IY[2]
C360 SUB (IY+$02)
C363 JP C,$C439 Jump if IY[0] was <= IY[2]
C366 JP Z,$C439
C369 LD C,A C = A
C36A ADD A,A A <<= 1
C36B LD B,A B = A
C36C LD A,$60 L = ~(($60 - IY[0]) << 1)
C36E SUB (IY+$00)
C371 ADD A,A
C372 CPL
C373 LD L,A
C374 LD SP,HL -- this again
C375 LD D,(HL) D = *HL
C376 DEC L L--
C377 LD E,(HL) E = *HL
C378 SUB B A -= B
C379 LD L,A L = A
C37A DEC H H--
C37B JP $C3EE Jump
C37E EX AF,AF' Bank/unbank
C37F CP $02 Compare to 2
This entry point is used by the routine at diamond_zoom_in_mask.
C381 JP NC,$C3CA Jump if A >= 2
C384 EX AF,AF' Bank/unbank
C385 CP $04 Compare to 4
C387 LD A,$20 A = 32
C389 LD C,(IY+$01) C = IY[1]
C38C JR NZ,$C392 Jump if non-zero
C38E XOR A X = 0
C38F LD C,(IY+$02) C = IY[2]
C392 LD ($C3BE),A Self modify 'ADD A,x' @ C3BD below
C395 LD A,(IY+$00) A = IY[0]
C398 SUB C A -= C
C399 JP C,$C439 Jump if A was >= C
C39C JP Z,$C439
C39F LD C,A C = A << 1
C3A0 ADD A,A
C3A1 LD B,A B = A
C3A2 LD A,$60 L = ~(($60 - IY[0]) << 1)
C3A4 SUB (IY+$00)
C3A7 ADD A,A
C3A8 CPL
C3A9 LD L,A
C3AA LD SP,HL -- this again
C3AB DEC H H--
C3AC LD D,(HL) D = *HL
C3AD DEC L L--
C3AE LD E,(HL) E = *HL
C3AF SUB B A -= B
C3B0 LD L,A L = A
C3B1 INC H H++
C3B2 LD ($C3C5),HL Self modify 'LD HL,x' @ C3C4 below
C3B5 LD A,($A23F) A = fast_counter
C3B8 RRA A ROR 3
C3B9 RRA
C3BA RRA
C3BB AND $1C A &= 28
C3BD ADD A,$00 A += <self modified>
C3BF LD L,A HL = A
C3C0 LD H,$00
C3C2 ADD HL,DE HL += DE
C3C3 EX DE,HL Swap
C3C4 LD HL,$0000 HL = <self modified>
C3C7 JP $C3EE Jump
C3CA EX AF,AF' Swap
C3CB CP $04 Compare to 4
C3CD JR NZ,$C439 Jump if non-zero
C3CF LD A,(IY+$00) A = IY[0] - IY[2]
C3D2 SUB (IY+$02)
C3D5 JP C,$C439 Jump if IY[0] was <= IY[2]
C3D8 JP Z,$C439
C3DB LD C,A C = A
C3DC ADD A,A A <<= 1
C3DD LD B,A B = A
C3DE LD A,$60 L = ~(($60 - IY[0]) << 1)
C3E0 SUB (IY+$00)
C3E3 ADD A,A
C3E4 CPL
C3E5 LD L,A
C3E6 LD SP,HL -- this again
C3E7 DEC H H--
C3E8 LD D,(HL) D = *HL
C3E9 DEC L L--
C3EA LD E,(HL) E = *HL
C3EB SUB B A -= B
C3EC LD L,A L = A
C3ED INC H H++
Continuation point.
C3EE LD A,(HL) A = *HL
C3EF DEC L L--
C3F0 LD L,(HL) L = *HL
C3F1 LD H,A H = A
C3F2 AND A Set flags
C3F3 SBC HL,DE HL -= DE
C3F5 LD A,L A = L
C3F6 JP M,$C401 Jump if negative
C3F9 AND A Set flags
C3FA JP P,$C407 Jump if positive
C3FD LD A,$7F A = 127
C3FF JR $C407 Jump
Negative case.
C401 AND A Set flags
C402 JP M,$C407 Jump if negative
C405 LD A,$81 A = $81
Positive case.
C407 INC SP SP++
C408 BIT 5,(IX+$00) Bit 5 of IX[0] set?
C40C JR Z,$C413 Jump if clear
C40E LD HL,$FF00 HL = $FF00
C411 ADD HL,SP HL += SP
C412 LD SP,HL SP = HL
C413 LD L,A L = A
C414 LD B,C B = C
C415 LD A,C A = C
C416 BIT 7,L Bit 7 of L set?
C418 JR Z,$C426 Jump if clear
C41A LD A,L A = L
C41B NEG A = -A
C41D LD L,A L = A
C41E LD A,B A = B
C41F CP L Compare to L
C420 LD A,$1B A = 'DEC DE'
C422 JR C,$C441 Jump if A was < L
C424 JR $C42B Jump
C426 CP L Compare to L
C427 LD A,$13 A = 'INC DE'
C429 JR C,$C441 Jump if A was < L
C42B LD ($C435),A Self modify instruction at C435
C42E LD A,B A = B
C42F RRA A >>= 1
Divider?
C430 ADD A,L A = L
C431 CP C Compare to C
C432 JR C,$C436 Jump if A < C
C434 SUB C A -= C
C435 INC DE <self modified instruction> DE++ or DE--
C436 PUSH DE Stack DE
C437 DJNZ $C430 Loop
C439 INC IY IY++
C43B LD HL,$C534 Pointer to routine which called function will store at instruction C4B2
C43E JP main_loop_13_10 Jump
C441 LD ($C445),A Self modify instruction at C445
C444 XOR A A = 0
C445 INC DE <self modified instruction> DE++ or DE--
C446 ADD A,C A += C
C447 JR C,$C44C Jump if carry
C449 CP L Compare to L
C44A JR C,$C445 Jump if A < L
C44C SUB L A -= L
C44D PUSH DE Stack DE
C44E DJNZ $C445 Loop
C450 JR $C439 Jump to exit
Prev: C15B Up: Map Next: C452