Reduced problem on char draw

This commit is contained in:
Daniele Verducci su MatissePenguin 2021-02-28 19:47:08 +01:00
parent 1d4c4f8d3f
commit ddb7c58640
2 changed files with 46 additions and 8 deletions

View File

@ -37,17 +37,18 @@ draw_char:
call update_mem_pointer call update_mem_pointer
; The drawing consist of FONT_HEIGHT cycles. Every glyph byte is placed on its own line ; The drawing consist of FONT_HEIGHT cycles. Every glyph byte is placed on its own line
; on screen. To do this, we place it LINE_COLUMNS bytes after the previous one. ; on screen. To do this, we place it LINE_COLUMNS bytes after the previous one.
ldi HIGH_ACCUM, FONT_HEIGHT clr HIGH_ACCUM
draw_char_loop: draw_char_loop:
; Load glyph line byte from program memory (and point to the next) ; Load glyph line byte from program memory (and point to the next)
lpm r1, Z+ lpm A, Z+
; Write glyph line to framebuffer at chunk cursor position (Y) ; Write glyph line to framebuffer at chunk cursor position (Y)
st Y, r1 st Y, A
; Increment chunk cursor position (Y) to next line of the same char column ; Increment chunk cursor position (Y) to next line of the same char column
adiw YH:YL,LINE_COLUMNS adiw YH:YL,LINE_COLUMNS
; Decrement loop counter and exit if reached 0 ; Decrement loop counter and exit if reached 0
dec HIGH_ACCUM inc HIGH_ACCUM
brne draw_char_loop cpi HIGH_ACCUM, FONT_HEIGHT
brlo draw_char_loop
; Char drawing is complete. Increment cursor position ; Char drawing is complete. Increment cursor position
inc POS_COLUMN inc POS_COLUMN

View File

@ -121,16 +121,53 @@ main:
; wait ; wait
ser r19 ser r19
dc_wait_loop_1: dc_wait_loop_1:
ldi r24, 64 ser r16
dc_wait_loop_2: dc_wait_loop_2:
dec r24 dec r16
brne dc_wait_loop_2 brne dc_wait_loop_2
dec r19 dec r19
brne dc_wait_loop_1 brne dc_wait_loop_1
; wait
; ser r19
; dc_wait_loop_a1:
; ser r16
; dc_wait_loop_a2:
; dec r16
; brne dc_wait_loop_a2
; dec r19
; brne dc_wait_loop_a1
; ; wait
; ser r19
; dc_wait_loop_s1:
; ser r16
; dc_wait_loop_s2:
; dec r16
; brne dc_wait_loop_s2
; dec r19
; brne dc_wait_loop_s1
; ; wait
; ser r19
; dc_wait_loop_d1:
; ser r16
; dc_wait_loop_d2:
; dec r16
; brne dc_wait_loop_d2
; dec r19
; brne dc_wait_loop_d1
; ; wait
; ser r19
; dc_wait_loop_f1:
; ser r16
; dc_wait_loop_f2:
; dec r16
; brne dc_wait_loop_f2
; dec r19
; brne dc_wait_loop_f1
inc r18 inc r18
cpi r18, 0x5B cpi r18, 0x5B
brne draw_chars brne draw_chars
; call draw_carriage_return call draw_carriage_return
jmp dctest jmp dctest