freemyipod r40 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r39‎ | r40 | r41 >
Date:07:32, 6 August 2010
Author:cmwslw
Status:new
Tags:
Comment:
Copied lcdconsole.c changes from r14. Fixes an annoying bug.
Modified paths:
  • /embios/branches/4g_compat/lcdconsole.c (modified) (history)

Diff [purge]

Index: embios/branches/4g_compat/lcdconsole.c
@@ -23,6 +23,7 @@
2424
2525 #include "global.h"
2626 #include "lcdconsole.h"
 27+#include "drawing.h"
2728 #include "util.h"
2829
2930
@@ -49,11 +50,7 @@
5051
5152 void lcdconsole_putc(char string, int fgcolor, int bgcolor)
5253 {
53 - if (string == '\r')
54 - {
55 - current_col = 0;
56 - return;
57 - }
 54+ if (string == '\r') return;
5855 current_col++;
5956 if (string == '\n')
6057 {
@@ -74,12 +71,13 @@
7572 if (current_row >= LCDCONSOLE_ROWS)
7673 {
7774 int offset = current_row - LCDCONSOLE_ROWS + 1;
78 - memcpy(framebuf, &framebuf[ROWBYTES * offset], ROWBYTES * offset);
79 - memset(&framebuf[sizeof(framebuf) - ROWBYTES * offset],
 75+ memcpy(&framebuf[LINEBYTES * OFFSETY], &framebuf[LINEBYTES * OFFSETY + ROWBYTES * offset],
 76+ ROWBYTES * (LCDCONSOLE_ROWS - offset));
 77+ memset(&framebuf[LINEBYTES * OFFSETY + ROWBYTES * (LCDCONSOLE_ROWS - offset)],
8078 -1, ROWBYTES * offset);
 79+ current_row = LCDCONSOLE_ROWS - 1;
8180 }
82 - renderchar(&framebuf[OFFSETBYTES + ROWBYTES * current_row
83 - + COLBYTES * current_col],
 81+ renderchar(&framebuf[OFFSETBYTES + ROWBYTES * current_row + COLBYTES * current_col],
8482 fgcolor, bgcolor, string, LINEBYTES);
8583 }
8684

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r14Implement preemptive multitasking kerneltheseven20:43, 31 July 2010