Skip to content

Commit

Permalink
Fixed memcpy implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinWieczorek committed Dec 11, 2017
1 parent 5dbd5af commit 44cae27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions drivers/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ void clear_screen() {

void scroll_up(int lines) {
for(int y = lines; y < MAX_ROWS; y++) {
memcpy((char*) get_screen_offset(y, 0) + VIDEO_ADDRESS,
(char*) get_screen_offset(y - lines, 0) + VIDEO_ADDRESS,
MAX_COLS * 2);
memcpy((char*) get_screen_offset(y - lines, 0) + VIDEO_ADDRESS,
(char*) get_screen_offset(y, 0) + VIDEO_ADDRESS, MAX_COLS * 2);
}

unsigned char *vidmem = (unsigned char *) VIDEO_ADDRESS;
Expand Down
2 changes: 1 addition & 1 deletion libc/string/memcpy.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <string.h>

void *memcpy (void *src, const void *dst, size_t no_bytes) {
void *memcpy(void *dst, const void *src, size_t no_bytes) {
char *dest = (void*) dst;
char *source = src;

Expand Down

0 comments on commit 44cae27

Please sign in to comment.