Prev: 8055 Up: Map Next: 813C
8079: Routine at 8079
Used by the routines at 8055 and 9270.
8079 LD A,($5C78) A=*FRAMES.
807C LD ($EFFC),A Write A to *EFFC.
807F LD E,$10 E=10.
8081 LD C,A C=A.
8082 LD A,($EFFF) A=*EFFF.
8085 BIT 1,A Test bit 1 of A.
8087 JR NZ,$80D5 Jump to 80D5 if is not zero.
8089 BIT 0,A Test bit 0 of A.
808B JR NZ,$80CB Jump to 80CB if is not zero.
808D BIT 2,A Test bit 2 of A.
808F JR Z,$8096 Jump to 8096 if is zero.
8091 LD B,$7F B=7F.
8093 JP $811C Jump to 811C.
8096 BIT 3,A Test bit 3 of A.
8098 JR Z,$809F Jump to 809F if is zero.
809A LD B,$3F B=3F.
809C JP $811C Jump to 811C.
809F BIT 4,A Test bit 4 of A.
80A1 JR Z,$80A7 Jump to 80A7 if is zero.
80A3 LD A,$C8 A=C8.
80A5 JR $80C1 Jump to 80C1.
80A7 BIT 5,A Test bit 5 of A.
80A9 JR Z,$80AF Jump to 80AF if is zero.
80AB LD A,$78 A=78.
80AD JR $80C1 Jump to 80C1.
80AF BIT 6,A Test bit 6 of A.
80B1 JR Z,$80B7 Jump to 80B7 if is zero.
80B3 LD A,$50 A=50.
80B5 JR $80C1 Jump to 80C1.
80B7 BIT 7,A Test bit 7 of A.
80B9 JR Z,$80BF Jump to 80BF if is zero.
80BB LD A,$32 A=32.
80BD JR $80C1 Jump to 80C1.
80BF HALT Halt operation (suspend CPU until the next interrupt).
80C0 RET Return.
80C1 LD ($EFFE),A Write A to *EFFE.
80C4 LD A,$00 Write 00 to *EFFF.
80C6 LD ($EFFF),A
80C9 JR $8102 Jump to 8102.
80CB SET 1,A Set bit 1 of A.
80CD LD ($EFFF),A Write A to *EFFF.
80D0 LD HL,$8FEB HL=8FEB.
80D3 JR $80E2 Jump to 80E2.
80D5 LD HL,$EFDD HL=EFDD.
80D8 LD A,($5C78) A=*FRAMES.
80DB CP (HL) Compare A with *HL.
80DC JP M,$8102 Jump to 8102 M.
80DF LD HL,($EFDE) HL=*EFDE.
80E2 LD A,(HL) Jump to 80EE if *HL is not equal to 00.
80E3 CP $00
80E5 JR NZ,$80EE
80E7 LD HL,$EFFF HL=EFFF.
80EA LD (HL),$00 Write 00 to *HL.
80EC JR $80BF Jump to 80BF.
80EE INC HL Increment HL by one.
80EF LD B,(HL) B=*HL.
80F0 INC HL Increment HL by one.
80F1 LD ($EFDE),HL Write HL to *EFDE.
80F4 LD HL,$EFFE HL=EFFE.
80F7 CP (HL) Compare A with *HL.
80F8 LD (HL),A Write A to *HL.
80F9 JR NZ,$80FD Jump to 80FD if A is not zero.
80FB LD E,$00 E=00.
80FD LD A,C A=C.
80FE ADD A,B A+=B.
80FF LD ($EFDD),A Write A to *EFDD.
8102 LD HL,$EFFD HL=EFFD.
8105 LD A,($5C78) Return if *FRAMES is not equal to C.
8108 CP C
8109 RET NZ
810A DEC (HL) Decrease *HL by one.
810B JR NZ,$8105 Jump to 8105 if *HL is not zero.
810D LD A,($EFFE) Write *EFFE to *HL.
8110 LD (HL),A
8111 LD A,($99CC) A=*99CC.
8114 XOR E Flip the bits according to E.
8115 LD ($99CC),A Write A to *99CC.
8118 OUT ($FE),A OUT FE
811A JR $8105 Jump to 8105.
811C AND %11110000 Keep only bits 4-7.
811E LD ($EFFF),A Write A to *EFFF.
8121 LD HL,$EFFD HL=EFFD.
8124 LD A,($5C78) A=*FRAMES.
8127 CP C Return if A is not equal to C.
8128 RET NZ
8129 DEC (HL) Decrease *HL by one.
812A JR NZ,$8124 Jump to 8124 if *HL is not zero.
812C CALL $9619 Call 9619.
812F AND B Merge the bits from B.
8130 LD (HL),A Write A to *HL.
8131 LD A,($99CC) A=*99CC.
8134 XOR E Flip the bits according to E.
8135 LD ($99CC),A Write A to *99CC.
8138 OUT ($FE),A OUT FE
813A JR $8124 Jump to 8124.
Prev: 8055 Up: Map Next: 813C