Prev: E8DA Up: Map Next: E965
E8EA: scroll the screen
Used by the routines at E6B6, E87C and E965.
E8EA A5 AC LDA $AC copy the tape buffer start pointer
E8EC 48 PHA save it
E8ED A5 AD LDA $AD copy the tape buffer start pointer
E8EF 48 PHA save it
E8F0 A5 AE LDA $AE copy the tape buffer end pointer
E8F2 48 PHA save it
E8F3 A5 AF LDA $AF copy the tape buffer end pointer
E8F5 48 PHA save it
E8F6 A2 FF LDX #$FF set to -1 for pre increment loop
E8F8 C6 D6 DEC $D6 decrement the cursor row
E8FA C6 C9 DEC $C9 decrement the input cursor row
E8FC CE A5 02 DEC $02A5 decrement the screen row marker
E8FF E8 INX increment the line number
E900 20 F0 E9 JSR $E9F0 fetch a screen address, set the start of line X
E903 E0 18 CPX #$18 compare with last line
E905 B0 0C BCS $E913 branch if >= $16
E907 BD F1 EC LDA $ECF1,X get the start of the next line pointer low byte
E90A 85 AC STA $AC save the next line pointer low byte
E90C B5 DA LDA $DA,X get the start of the next line pointer high byte
E90E 20 C8 E9 JSR $E9C8 shift the screen line up
E911 30 EC BMI $E8FF loop, branch always
E913 20 FF E9 JSR $E9FF clear screen line X
now shift up the start of logical line bits
E916 A2 00 LDX #$00 clear index
E918 B5 D9 LDA $D9,X get the start of line X pointer high byte
E91A 29 7F AND #$7F clear the line X start of logical line bit
E91C B4 DA LDY $DA,X get the start of the next line pointer high byte
E91E 10 02 BPL $E922 if next line is not a start of line skip the start set
E920 09 80 ORA #$80 set line X start of logical line bit
E922 95 D9 STA $D9,X set start of line X pointer high byte
E924 E8 INX increment line number
E925 E0 18 CPX #$18 compare with last line
E927 D0 EF BNE $E918 loop if not last line
E929 A5 F1 LDA $F1 get start of last line pointer high byte
E92B 09 80 ORA #$80 mark as start of logical line
E92D 85 F1 STA $F1 set start of last line pointer high byte
E92F A5 D9 LDA $D9 get start of first line pointer high byte
E931 10 C3 BPL $E8F6 if not start of logical line loop back and scroll the screen up another line
E933 E6 D6 INC $D6 increment the cursor row
E935 EE A5 02 INC $02A5 increment screen row marker
E938 A9 7F LDA #$7F set keyboard column c7
E93A 8D 00 DC STA $DC00 save VIA 1 DRA, keyboard column drive
E93D AD 01 DC LDA $DC01 read VIA 1 DRB, keyboard row port
E940 C9 FB CMP #$FB compare with row r2 active, [CTL]
E942 08 PHP save status
E943 A9 7F LDA #$7F set keyboard column c7
E945 8D 00 DC STA $DC00 save VIA 1 DRA, keyboard column drive
E948 28 PLP restore status
E949 D0 0B BNE $E956 skip delay if ??
first time round the inner loop X will be $16
E94B A0 00 LDY #$00 clear delay outer loop count, do this 256 times
E94D EA NOP waste cycles
E94E CA DEX decrement inner loop count
E94F D0 FC BNE $E94D loop if not all done
E951 88 DEY decrement outer loop count
E952 D0 F9 BNE $E94D loop if not all done
E954 84 C6 STY $C6 clear the keyboard buffer index
E956 A6 D6 LDX $D6 get the cursor row
This entry point is used by the routine at E965.
restore the tape buffer pointers and exit
E958 68 PLA pull tape buffer end pointer
E959 85 AF STA $AF restore it
E95B 68 PLA pull tape buffer end pointer
E95C 85 AE STA $AE restore it
E95E 68 PLA pull tape buffer pointer
E95F 85 AD STA $AD restore it
E961 68 PLA pull tape buffer pointer
E962 85 AC STA $AC restore it
E964 60 RTS
Prev: E8DA Up: Map Next: E965