From: Bernard Blackham Date: Wed, 6 Aug 2003 16:16:00 +0000 (+0000) Subject: Allow changes to individual characters X-Git-Tag: ROMW~100 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=067df52c32420b3165f2df104383da98d5b52626;p=uccvend-snackrom.git Allow changes to individual characters --- diff --git a/ROM2/display.c b/ROM2/display.c index 85582f3..af96921 100644 --- a/ROM2/display.c +++ b/ROM2/display.c @@ -21,7 +21,7 @@ void display_send_byte(char c); void display_reset(); void display_update(); -void set_msg(char* newmsg) { +void set_msg(char* newmsg, u8 wrap) { char* dest = current_message; /* equivalent of a string copy */ /* while (dest++ = newmsg++); */ @@ -30,13 +30,15 @@ void set_msg(char* newmsg) { dest++; newmsg++; } + wrap_mode = wrap; scroll_point = 0; display_update(); } -extern inline void set_wrap_mode(u8 new_wrap_mode) { - /* in theory it should be inlined anyway? */ - wrap_mode = new_wrap_mode; +void set_char(char c, u8 pos) { + /* sets a single character */ + display_buffer[pos] = c; + display_update(); } void display_send_byte(char c) { @@ -64,7 +66,7 @@ void display_reset() { } void display_update() { - int i; + u8 i; display_reset(); for (i=0; i < 10; i++) { diff --git a/ROM2/display.h b/ROM2/display.h index c9af212..384ef8d 100644 --- a/ROM2/display.h +++ b/ROM2/display.h @@ -4,14 +4,16 @@ #include "types.h" /* scrolling modes */ -#define WRAP_SCROLL_L 1 /* scroll to the left */ -#define WRAP_SCROLL_R 2 /* scroll to the right */ +#define WRAP_NONE 0 /* trailing chars get left off */ +#define WRAP_SCROLL_L 1 /* scroll to the left */ +#define WRAP_SCROLL_R 2 /* scroll to the right */ #define WRAP_ALTERNATE 3 /* alternate between text */ extern char current_message[256]; void display_init(); -void set_msg(char* newmsg); +void set_msg(char* newmsg, u8 wrap); +void set_char(char c, u8 pos); void set_wrap_mode(u8 new_wrap_mode); void display_refresh();