in a,($7e) ; Check line number add a,a ; Double it. This will make numbers below $80 alias to those above it; the game uses line interrupts from line $7f to $bf. ld ($de87),a ; Self-modify the following instruction to index the ath byte in a buffer at $c800. ld a,($c800) ; The previous line modifies the middle byte of this opcode: the LSB of the address. out ($bf),a ; Set the HScroll to that value ld a,$88 out ($bf),a pop af ; Clean up and return ei ret