diff --git a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/character_generator.asm b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/character_generator.asm index 2f07e9c..7e27df4 100644 --- a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/character_generator.asm +++ b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/character_generator.asm @@ -75,10 +75,11 @@ cursor_pos_home: clr POS_ROWP clr POS_FINE ; Load framebuffer start position to Y - ldi YH, high(FRAMEBUFFER) - ldi YL, low(FRAMEBUFFER) - ; ldi YH, high(0x1000) - ; ldi YL, low(0x1000) + ; ldi YH, high(FRAMEBUFFER) + ; ldi YL, low(FRAMEBUFFER) + ; TODO: First 3 lines are not visible! Outside of screen! + ldi YH, high(0x780) + ldi YL, low(0x780) ret ; Updates framebuffer pointer (Y) to point to current text cursor position (POS_COLUMN, POS_ROWP) diff --git a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/communication.asm b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/communication.asm index b045eea..e7e8412 100644 --- a/pat80-io-devices/composite-pal-adapter/software/avr-assembly/communication.asm +++ b/pat80-io-devices/composite-pal-adapter/software/avr-assembly/communication.asm @@ -18,16 +18,20 @@ comm_init: call cursor_pos_home ; Set cursor to 0,0 comm_wait_byte: - in A, DATA_PORT_IN ; read PORTB + in HIGH_ACCUM, DATA_PORT_IN ; read PORTB ; Check continuously CLK until a LOW is found sbic PORTD, CLK_PIN jmp comm_wait_byte - ; CLK triggered: Copy PORTB to the next framebuffer byte - st Y+, A - ; if reached the last framebuffer byte, exit cycle - cpi r31, 0b00111110 - brne comm_wait_byte ; if not 0, repeat h_picture_loop - cpi r30, 0b11000000 - brne comm_wait_byte ; if not 0, repeat h_picture_loop - jmp comm_init ; filled all memory: reset framebuffer position + ; CLK triggered: Draw char + call draw_char + jmp comm_wait_byte + + ; ; CLK triggered: Copy PORTB to the next framebuffer byte + ; st Y+, A + ; ; if reached the last framebuffer byte, exit cycle + ; cpi r31, 0b00111110 + ; brne comm_wait_byte ; if not 0, repeat h_picture_loop + ; cpi r30, 0b11000000 + ; brne comm_wait_byte ; if not 0, repeat h_picture_loop + ; jmp comm_init ; filled all memory: reset framebuffer position 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 ad0d214..945c6f1 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 @@ -158,7 +158,7 @@ main: ; Timer setup completed. ; Wait for data (it never exits) - ;jmp comm_init + jmp comm_init forever: jmp forever