From cc9805f04497493f7b4a9a8057d365c3a349c21e Mon Sep 17 00:00:00 2001 From: Daniele Verducci su MatissePenguin Date: Tue, 16 Feb 2021 08:57:15 +0100 Subject: [PATCH] Minor fix --- .../software/avr-assembly/character_generator.asm | 9 ++++++--- .../software/avr-assembly/main.asm | 10 +++++++--- 2 files changed, 13 insertions(+), 6 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 ea247ab..828be1f 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 @@ -84,9 +84,9 @@ cursor_pos_home: ; Updates framebuffer pointer (Y) to point to current text cursor position (POS_COLUMN, POS_ROWP) ; Usage: -; ldi POS_COLUMN, 55 +; ldi POS_COLUMN, 10 ; ldi POS_ROWP, 13 -; call set_framebuffer_pointer_to_text_cursor ; (sets cursor to 4th character of second row in 13th row-pair = column 4, row 27 on screen) +; call set_framebuffer_pointer_to_text_cursor ; @modifies Y, R0, R1 set_framebuffer_pointer_to_text_cursor: ; Load framebuffer start position to Y @@ -109,12 +109,15 @@ draw_carriage_return: sub YL, POS_COLUMN sbci YH, 0 ; Set cursor to start of current line - subi POS_COLUMN, LINE_COLUMNS + clr POS_COLUMN ; Go to next line ldi HIGH_ACCUM, high(LINE_COLUMNS*FONT_HEIGHT) add YH, HIGH_ACCUM ldi HIGH_ACCUM, low(LINE_COLUMNS*FONT_HEIGHT) adc YL, HIGH_ACCUM + ; Update row pointer + ldi HIGH_ACCUM, FONT_HEIGHT + add POS_ROWP, HIGH_ACCUM ret ; Scrolls the screen by one line (=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 5fb8a34..fe8a610 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 @@ -26,8 +26,8 @@ ; *** reserved registers *** ; Cursor Position -; POS_COLUMN (0-103) represents the column on a pair of rows: 0 to 46 is the first row, 47 to 92 the second one -; POS_ROWP (0-128) represent the pair of rows. POS_ROWP = 5 means the 10th and 11th rows +; POS_COLUMN (0-46) represents the character/chunk column +; POS_ROWP (0-255) represent the chunk row. The caracter row is POS_ROWP/FONT_HEIGHT ; POS_FINE represents fine position (bit inside coarse-position-pointed chunk) in graphic mode. .def POS_COLUMN = r21 .def POS_ROWP = r20 @@ -110,6 +110,10 @@ main: ; test draw character routine + call draw_carriage_return + call draw_carriage_return + call draw_carriage_return + call cursor_pos_home ldi r18, 0x41 dctest: @@ -120,7 +124,7 @@ main: cpi r18, 0x5B brne dc_continue ldi r18, 0x41 - ;call draw_carriage_return + call draw_carriage_return dc_continue: ; wait ser r19