Prev: 9C46 Up: Map Next: 9C7E
9C4B: Process normal duration and frequency
Used by the routine at process_abs_rel_jump.
L9C4B 9C4B LD (IX+$05),A Set countdown to duration
9C4E LD A,(HL) Get tune byte (frequency)
9C4F INC HL Next tune address
9C50 LD (IX+$00),A Set tone/mute to tune byte
9C53 LD (IX+$01),L Set tune address LSB
9C56 LD (IX+$02),H Set tune address MSB
9C59 CP $FF Is it mute?
9C5B JR Z,next_tune_data_buffer Then next tune data buffer
9C5D AND $3F Isolate bits 0-5 for table lookup
9C5F LD E,A DE = A
9C60 LD D,$00 ...
9C62 LD HL,frequency_table Table base address
9C65 ADD HL,DE Add offset
9C66 LD A,(HL) Get table byte
9C67 LD (IX+$03),A Set as frequency LSB
9C6A LD A,(IX+$00) Get saved tune byte
9C6D AND $C0 Isolate bits 6-7
9C6F RLCA Shift into bits 0-1
9C70 RLCA ...
9C71 LD E,A Save in E
9C72 LD A,(tune_index) Get tune playing
9C75 CP $06 Is it 6?
9C77 LD A,E Get value back in A
9C78 JR NZ,L9C7E Jump if tune not 6
9C7A OR $A0 Apply special attenuation for tune 6
9C7C JR L9C7E_0 Skip reset countdown (?) and skip fetch attenuation
Prev: 9C46 Up: Map Next: 9C7E