vertical line, scrolling from left to right

sufficiently handles the back/front porch without disrupting the sync
signal
todo improvement: compute a sensible amount of cycles to waste during
the porch
This commit is contained in:
giomba 2021-06-27 22:37:11 +02:00
parent 14fd0412d4
commit f3ce016a06
2 changed files with 21 additions and 7 deletions

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#define VERTICAL_OFFSET 30 #define VERTICAL_OFFSET 30
#define HORIZONTAL_OFFSET_CYCLE 50

26
main.S
View File

@ -58,30 +58,43 @@ int_horizontal_sync:
in r31, IO(SREG) ; status register in r31, IO(SREG) ; status register
push r31 push r31
#if 0
lds r31, vertical_offset lds r31, vertical_offset
cpi r31, 0 cpi r31, 0
breq enter1 breq enter
dec r31 dec r31
sts vertical_offset, r31 sts vertical_offset, r31
jmp int_horizontal_sync_end jmp int_horizontal_sync_end
enter1: enter:
lds r31, line lds r31, line
cpi r31, 0 cpi r31, 0
breq int_horizontal_sync_end breq int_horizontal_sync_end
inc r31 inc r31
sts line, r31 sts line, r31
ldi r31, HORIZONTAL_OFFSET_CYCLE ; skip back porch
1:
dec r31
brne 1b
; do things
lds r31, frame lds r31, frame
lsr r31 cpi r31, 0
lsr r31
breq 2f breq 2f
1: 1:
dec r31 dec r31
brne 1b brne 1b
#endif 2:
sbi IO(PORTB), 4
nop
nop
nop
nop
nop
cbi IO(PORTB), 4
#if 0
ldi r31, 140 ldi r31, 140
1: 1:
dec r31 dec r31
@ -99,6 +112,7 @@ enter1:
nop nop
nop nop
cbi IO(PORTB), 4 cbi IO(PORTB), 4
#endif
int_horizontal_sync_end: int_horizontal_sync_end:
pop r31 pop r31