Routines |
Prev: 54504 | Up: Map | Next: 54619 |
Used by the routine at FindScene.
|
||||
54540 | OR A | Set zero flag based on A. | ||
54541 | SLA A | Shift A left (with carry). | ||
54543 | LD L,A | Store the result in L. | ||
54544 | RLA | Rotate A left (bit 7 is moved to bit 0). | ||
54545 | AND %00000001 | Keep only bit 0. | ||
54547 | LD H,A | H=A. | ||
54548 | LD DE,50944 | DE=50944. | ||
54551 | ADD HL,DE | HL+=DE. | ||
54552 | EX DE,HL | Exchange the DE and HL registers. | ||
54553 | LD BC,32 | BC=0032. | ||
54556 | LD HL,24896 | HL=24896. | ||
54559 | PUSH HL | Stash HL and DE on the stack. | ||
54560 | PUSH DE | |||
54561 | LD A,(DE) | A=*DE. | ||
54562 | DEC A | Decrease A by one. | ||
54563 | INC DE | Increment DE by one. | ||
54564 | OR A | Set the bits from A. | ||
54565 | LD (HL),1 | Write 1 to *HL. | ||
54567 | SBC HL,BC | HL-=BC. | ||
54569 | DEC A | Decrease A by one. | ||
54570 | JR NZ,54565 | Jump to 54565 until A is zero. | ||
54572 | LD A,(DE) | Jump to 54608 if *DE is zero. | ||
54573 | AND A | |||
54574 | JR Z,54608 | |||
54576 | PUSH HL | Stash HL on the stack. | ||
54577 | LD HL,51200 | HL=51200. | ||
54580 | LD E,A | E=A. | ||
54581 | LD A,(HL) | A=*HL. | ||
54582 | INC HL | Increment HL by one. | ||
54583 | CP 128 | Jump to 54581 if A is lower than 128. | ||
54585 | JP C,54581 | |||
54588 | DEC E | Decrease E by one. | ||
54589 | JP NZ,54581 | Jump to 54581 until E is zero. | ||
54592 | EX DE,HL | Exchange the DE and HL registers. | ||
54593 | POP HL | Restore HL from the stack. | ||
54594 | LD A,(DE) | A=*DE. | ||
54595 | AND %01111111 | Keep only bits 0-6. | ||
54597 | LD (HL),A | Write A to *HL. | ||
54598 | LD A,(DE) | A=*DE. | ||
54599 | BIT 7,A | Jump to 54608 if bit 7 of A is set. | ||
54601 | JR NZ,54608 | |||
54603 | SBC HL,BC | HL-=BC. | ||
54605 | INC DE | Increment DE by one. | ||
54606 | JR 54594 | Jump to 54594. | ||
54608 | POP DE | Restore DE and HL from the stack. | ||
54609 | POP HL | |||
54610 | INC HL | Increment HL by one. | ||
54611 | INC DE | Increment DE by two. | ||
54612 | INC DE | |||
54613 | LD A,L | Jump to 54559 if L is not equal to 96. | ||
54614 | CP 96 | |||
54616 | JR NZ,54559 | |||
54618 | RET | Return. |
Prev: 54504 | Up: Map | Next: 54619 |