From 0697bc375338d1b026d23f27a818e075408e91ac Mon Sep 17 00:00:00 2001 From: Daniele Verducci su MatissePenguin Date: Mon, 22 Feb 2021 20:01:19 +0100 Subject: [PATCH] Working carriage return --- .../avr-assembly/character_generator.asm | 25 ++++++++++--------- .../software/avr-assembly/main.asm | 1 + 2 files changed, 14 insertions(+), 12 deletions(-) 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 cc32b95..6677960 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 @@ -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) 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 754332c..f1e3258 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 @@ -144,6 +144,7 @@ main: inc r18 cpi r18, 0x5B brne draw_chars + call draw_carriage_return jmp dctest