Prev: B575 Up: Map Next: B69D
B5A7: Initialise: Madrid
Madrid_Initialise B5A7 LD IX,$6240 IX=6240.
B5AB LD B,$60 B=60.
Madrid_Initialise_0 B5AD LD DE,$B4FA DE=B4FA.
B5B0 LD L,(IX+$02) L=*IX+02.
B5B3 LD H,(IX+$03) H=*IX+03.
B5B6 AND A Set flags.
B5B7 SBC HL,DE HL-=DE (with carry).
B5B9 JR Z,Madrid_Initialise_3 Jump to Madrid_Initialise_3 if the result is zero.
Madrid_Initialise_1 B5BB PUSH IX Stash IX on the stack.
B5BD CALL $9619 Call 9619.
B5C0 LD A,($99A5) A=*99A5.
B5C3 POP IX Restore IX from the stack.
B5C5 AND (IX+$04) Merge the bits of A with *IX+04.
B5C8 JR Z,Madrid_Initialise_1 Jump to Madrid_Initialise_1 if the result is zero.
B5CA CP $40 Jump to Madrid_Initialise_1 if A is equal to 40.
B5CC JR Z,Madrid_Initialise_1
Madrid_Initialise_2 B5CE LD (IX+$04),A Write A to *IX+04.
B5D1 LD DE,$0006 IX+=0006.
B5D4 ADD IX,DE
B5D6 DJNZ Madrid_Initialise_0 Decrease counter by one and loop back to Madrid_Initialise_0 until counter is zero.
B5D8 LD HL,$7BA4 Write 7BA4 to *725C.
B5DB LD ($725C),HL
B5DE LD HL,$7260 Write 7260 to *99B8.
B5E1 LD ($99B8),HL
B5E4 LD A,$01 A=01.
B5E6 LD ($7258),A Write A to *7258.
B5E9 DEC A Decrease A by one.
B5EA LD ($99AA),A Write A to *99AA.
B5ED CALL $9929 Call 9929.
B5F0 LD IX,$B623 IX=B623.
B5F4 LD DE,$0020 Write 0020 to *926E.
B5F7 LD ($926E),DE
B5FB LD DE,$7400 Write 7400 to *99B8.
B5FE LD ($99B8),DE
B602 LD B,$09 B=09.
B604 JP $9226 Jump to 9226.
Madrid_Initialise_3 B607 PUSH IX Stash IX on the stack.
B609 LD DE,$FF44 DE=FF44.
B60C POP HL Restore HL from the stack.
B60D ADD HL,DE HL+=DE.
B60E LD A,(HL) A=*HL.
B60F AND %00000111 Keep only bits 0-2.
B611 RLCA RLCA.
B612 RLCA
B613 RLCA
B614 LD C,A C=A.
B615 LD A,(HL) A=*HL.
B616 AND %00111000 Keep only bits 3-5.
B618 RRCA RRCA.
B619 RRCA
B61A RRCA
B61B LD E,A E=A.
B61C LD A,(HL) A=*HL.
B61D AND %01000000 Keep only bits 6.
B61F OR C Set the bits from C.
B620 OR E Set the bits from E.
B621 JR Madrid_Initialise_2 Jump to Madrid_Initialise_2.
B623 DEFB $50,$B6,$40,$7C,$00,$50,$B6,$88
B62B DEFB $7C,$00,$50,$B6,$BC,$7C,$00,$60
B633 DEFB $B6,$C4,$7C,$00,$58,$B6,$06,$7D
B63B DEFB $00,$60,$B6,$0C,$7D,$00,$50,$B6
B643 DEFB $0E,$7D,$00,$50,$B6,$36,$7D,$00
B64B DEFB $58,$B6,$3A,$7D,$00,$68,$B6,$02
B653 DEFB $02,$98,$B6,$00,$00,$88,$B6,$01
B65B DEFB $01,$98,$B6,$00,$00,$90,$B6,$01
B663 DEFB $01,$98,$B6,$00,$00,$07,$1F,$3F
B66B DEFB $3F,$7F,$7F,$FF,$FF,$FF,$7F,$3F
B673 DEFB $3F,$1F,$0F,$07,$07,$E0,$F8,$FC
B67B DEFB $FC,$FE,$FE,$FF,$FF,$FF,$FE,$FC
B683 DEFB $FC,$F8,$F0,$E0,$E0,$00,$03,$07
B68B DEFB $0F,$0F,$1F,$1F,$DF,$00,$C0,$E0
B693 DEFB $F0,$F0,$F8,$F8,$FE,$07,$07,$07
B69B DEFB $07,$A0
Prev: B575 Up: Map Next: B69D