Scrambled image due to inverted bit order in every of the 52 line byte chunks

This commit is contained in:
Daniele Verducci su MatissePenguin
2021-01-08 10:08:03 +01:00
parent a86dbed7f7
commit 62e98d7fe4
3 changed files with 1333 additions and 1332 deletions

View File

@@ -4,7 +4,6 @@
; This also displays byte's MSB pixel "for free", as the video pin is PD7 (last bit of PORTD).
.include "atmega1284definition.asm"
.include "cat2.asm"
; define constant
.equ SYNC_PIN = PC0 ; Sync pin (pin 22)
@@ -34,11 +33,12 @@ main:
;*** Load data into ram ***
; Set X to 0x0100
ldi r27, 0x01
clr r26
ldi r27, high(FRAMEBUFFER<<1)
ldi r26, low(FRAMEBUFFER<<1)
; Set Z to 0x1000 (cat image)
ldi r31, 0x10
clr r30
ldi r31, high(CAT_IMAGE<<1)
ldi r30, low(CAT_IMAGE<<1)
load_mem_loop:
lpm r17, Z+
@@ -82,7 +82,7 @@ v_refresh_loop:
; debug
; ***************** DRAW FIRST LINE *********************
; **** start line sync: 4uS, 96 cycles @ 24Mhz
cbi PORTD, VIDEO_PIN ; video pin goes low before sync ; 2 cycles
cbi PORTC, SYNC_PIN ; sync goes low (0v) ; 2 cycle
@@ -107,7 +107,7 @@ v_refresh_loop:
; ***************** DRAW SECOND LINE *********************
; **** start line sync: 4uS, 96 cycles @ 24Mhz
cbi PORTD, VIDEO_PIN ; video pin goes low before sync ; 2 cycles
cbi PORTC, SYNC_PIN ; sync goes low (0v) ; 2 cycle
@@ -1506,4 +1506,7 @@ draw_line:
lsl r19 ; 1 cycle
out PORTD, r19 ; 1 cycle
ret
ret
.include "cat.asm"