Working carriage return

This commit is contained in:
Daniele Verducci su MatissePenguin 2021-02-22 20:01:19 +01:00
parent 2b3f9946d9
commit 0697bc3753
2 changed files with 14 additions and 12 deletions

View File

@ -74,18 +74,19 @@ cursor_pos_home:
; Draws a newline
; Moves cursor to start of following screen line
; Takes care of particular cases, i.e. end of screen (shifts all screen up by one line)
; draw_carriage_return:
; ; Move cursor to line start
; ldi POS_COLUMN, 0
; ; Move cursor to next line
; ldi HIGH_ACCUM, FONT_HEIGHT
; add POS_ROWP, HIGH_ACCUM
; ; Check if end of screen
; cpi POS_ROWP, SCREEN_HEIGHT
; brsh draw_carriage_return_eos
; ret
; draw_carriage_return_eos:
; call scroll_screen
draw_carriage_return:
; Move cursor to line start
ldi POS_COLUMN, 0
; Move cursor to next line
ldi HIGH_ACCUM, FONT_HEIGHT
add POS_ROWP, HIGH_ACCUM
; Check if end of screen
cpi POS_ROWP, SCREEN_HEIGHT
brsh draw_carriage_return_eos
ret
draw_carriage_return_eos:
call scroll_screen
ret
; Scrolls the screen by one line (=LINE_COLUMNS*FONT_HEIGHT bytes)
; and clears the last line (FRAMEBUFFER_END - LINE_COLUMNS*FONT_HEIGHT bytes)

View File

@ -144,6 +144,7 @@ main:
inc r18
cpi r18, 0x5B
brne draw_chars
call draw_carriage_return
jmp dctest