From ae495b671454eabb0bd5a1a17f61a72aae9444a1 Mon Sep 17 00:00:00 2001 From: Daniele Verducci su MatissePenguin Date: Fri, 8 Jan 2021 16:12:46 +0100 Subject: [PATCH] Polish --- .../software/avr-assembly/.gitignore | 2 ++ .../software/avr-assembly/main.asm | 26 ++++++++++++------ .../software/avr-assembly/main.hex | 4 --- .../software/avr-assembly/main.obj | Bin 205 -> 0 bytes 4 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 pat80-io-devices/composite-pal-adapter/software/avr-assembly/.gitignore delete mode 100644 pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.hex delete mode 100644 pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.obj diff --git a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/.gitignore b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/.gitignore new file mode 100644 index 0000000..ba81b8b --- /dev/null +++ b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/.gitignore @@ -0,0 +1,2 @@ +main.hex +main.obj diff --git a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.asm b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.asm index a95fcc9..656ec55 100644 --- a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.asm +++ b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.asm @@ -2,12 +2,16 @@ ; Implemented following timings in http://blog.retroleum.co.uk/electronics-articles/pal-tv-timing-and-voltages/ ; Every line, for 52 times, it loads a byte from memory into PORTD register and then shifts the byte to the left to show another bit (do it 7 times) ; This also displays byte's MSB pixel "for free", as the video pin is PD7 (last bit of PORTD). +; +; PINS: +; Video pin: PD0 (pin 14) +; Sync pin: PC0 (pin 22) +; Debug hsync pin: PC1 (pin 23) .include "atmega1284definition.asm" ; define constant .equ SYNC_PIN = PC0 ; Sync pin (pin 22) -.equ VIDEO_PIN = PD7 ; Video pin (pin 21) .equ DEBUG_PIN = PC1 ; DEBUG: Single vertical sync pulse to trigger oscilloscope (pin 23) ; memory @@ -22,9 +26,7 @@ main: sbi DDRC, SYNC_PIN ; set pin as output sbi DDRC, DEBUG_PIN ; set pin as output ldi r16, 0xFF - out DDRD, r16 ; set port as output - - + out DDRD, r16 ; set port as output (contains video pin) @@ -84,7 +86,10 @@ v_refresh_loop: ; ***************** DRAW FIRST LINE ********************* ; **** start line sync: 4uS, 96 cycles @ 24Mhz - cbi PORTD, VIDEO_PIN ; video pin goes low before sync ; 2 cycles + ; video pin goes low before sync + clr r19 ; 1 cycle + out PORTD, r19 ; 1 cycle + cbi PORTC, SYNC_PIN ; sync goes low (0v) ; 2 cycle ldi r18, 31 ; 1 cycle l_sync_pulse_loop: ; requires 3 cpu cycles @@ -109,7 +114,10 @@ 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 + ; video pin goes low before sync + clr r19 ; 1 cycle + out PORTD, r19 ; 1 cycle + cbi PORTC, SYNC_PIN ; sync goes low (0v) ; 2 cycle ldi r18, 31 ; 1 cycle l_sync_pulse_loop2: ; requires 3 cpu cycles @@ -141,7 +149,9 @@ v_refresh_loop: brne h_picture_loop ; if not 0, repeat h_picture_loop ; 2 cycle if true, 1 if false ; end picture lines - cbi PORTD, VIDEO_PIN ; video pin goes low before sync ; 2 cycles + ; video pin goes low before sync + clr r19 ; 1 cycle + out PORTD, r19 ; 1 cycle ; start 6 short sync pulses call short_sync call short_sync @@ -1509,4 +1519,4 @@ draw_line: ret -.include "cat.asm" \ No newline at end of file +.include "cat2.asm" \ No newline at end of file diff --git a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.hex b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.hex deleted file mode 100644 index ea269f6..0000000 --- a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.hex +++ /dev/null @@ -1,4 +0,0 @@ -:020000020000FC -:1000000000C0579A4F995F984F9B5F9A40E230E447 -:1000100020E82A95F1F73A95D9F74A95C1F7F2CF3A -:00000001FF diff --git a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.obj b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/main.obj deleted file mode 100644 index d2d9bd44c3a94e6d6507e225692d5c3f655304d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 205 zcmZQzU|7Y#z#zrR