back porch skipping, wasting clock cycles, basically
This commit is contained in:
parent
1f3f3f36f2
commit
48da25958e
2
const.h
2
const.h
@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERTICAL_OFFSET 30
|
#define VERTICAL_OFFSET 30
|
||||||
#define HORIZONTAL_OFFSET_CYCLE 50
|
#define HORIZONTAL_OFFSET_CYCLE 56
|
||||||
|
31
main.S
31
main.S
@ -36,24 +36,27 @@ main:
|
|||||||
rjmp 1b
|
rjmp 1b
|
||||||
|
|
||||||
.global int_horizontal_sync
|
.global int_horizontal_sync
|
||||||
int_horizontal_sync:
|
int_horizontal_sync: ; +3
|
||||||
push r31
|
push r31 ; +5
|
||||||
in r31, IO(SREG) ; status register
|
in r31, IO(SREG) ; +6, status register
|
||||||
push r31
|
push r31 ; +8
|
||||||
push r30
|
push r30 ; +10
|
||||||
|
|
||||||
; if (line >= VERTICAL_OFFSET), then enter
|
; if (line >= VERTICAL_OFFSET), then enter
|
||||||
lds r30, line
|
lds r30, line ; +12
|
||||||
lds r31, line + 1
|
lds r31, line + 1 ; +14
|
||||||
adiw z, 1
|
adiw z, 1 ; +16
|
||||||
sts line, r30
|
sts line, r30 ; +18
|
||||||
sts line + 1, r31
|
sts line + 1, r31 ; +20
|
||||||
cpi r31, 0
|
cpi r31, 0 ; +21
|
||||||
brne enter
|
brne enter ; +22, +23
|
||||||
cpi r30, VERTICAL_OFFSET
|
cpi r30, VERTICAL_OFFSET ; +23
|
||||||
brlo int_horizontal_sync_end
|
brlo int_horizontal_sync_end ; +24
|
||||||
|
|
||||||
enter:
|
enter:
|
||||||
|
; here, +23 or +24 cycles have passed since horizontal sync
|
||||||
|
; so, there are still ~168 cycles before first useful data
|
||||||
|
; or 56 3-cycle instructions (HORIZONTAL_OFFSET_CYCLE)
|
||||||
ldi r31, HORIZONTAL_OFFSET_CYCLE ; skip back porch
|
ldi r31, HORIZONTAL_OFFSET_CYCLE ; skip back porch
|
||||||
1:
|
1:
|
||||||
dec r31
|
dec r31
|
||||||
|
Loading…
Reference in New Issue
Block a user