From f3ce016a06750a7e59da3aab0376886857232776 Mon Sep 17 00:00:00 2001 From: giomba Date: Sun, 27 Jun 2021 22:37:11 +0200 Subject: [PATCH] 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 --- const.h | 2 +- main.S | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/const.h b/const.h index 179fd25..41e6bd0 100644 --- a/const.h +++ b/const.h @@ -1,4 +1,4 @@ #pragma once #define VERTICAL_OFFSET 30 - +#define HORIZONTAL_OFFSET_CYCLE 50 diff --git a/main.S b/main.S index 96a0f8c..f763f54 100644 --- a/main.S +++ b/main.S @@ -58,30 +58,43 @@ int_horizontal_sync: in r31, IO(SREG) ; status register push r31 -#if 0 lds r31, vertical_offset cpi r31, 0 - breq enter1 + breq enter dec r31 sts vertical_offset, r31 jmp int_horizontal_sync_end -enter1: +enter: lds r31, line cpi r31, 0 breq int_horizontal_sync_end inc r31 sts line, r31 + ldi r31, HORIZONTAL_OFFSET_CYCLE ; skip back porch +1: + dec r31 + brne 1b + + ; do things lds r31, frame - lsr r31 - lsr r31 + cpi r31, 0 breq 2f 1: dec r31 brne 1b -#endif +2: + sbi IO(PORTB), 4 + nop + nop + nop + nop + nop + cbi IO(PORTB), 4 + +#if 0 ldi r31, 140 1: dec r31 @@ -99,6 +112,7 @@ enter1: nop nop cbi IO(PORTB), 4 +#endif int_horizontal_sync_end: pop r31