From 44a7b8074dd40fbc6b9899f3d029883bd0e0818c Mon Sep 17 00:00:00 2001 From: Mark Tearle Date: Thu, 19 Mar 2015 22:31:21 +0800 Subject: [PATCH] Fix bug in ROM vis display of periods on the display --- ROM2/display_basic.c | 26 ++++++++++++++++++++++++++ ROM2/src2asm.pl | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ROM2/display_basic.c b/ROM2/display_basic.c index 2849696..1d69793 100644 --- a/ROM2/display_basic.c +++ b/ROM2/display_basic.c @@ -15,6 +15,8 @@ void display_reset(); void set_msg(char newmsg[11]) { int i; + int prevchar = 0; + //display_reset(); spi_enable(); for (i=0; i < 10; i++) { @@ -22,8 +24,32 @@ void set_msg(char newmsg[11]) { } display_send_byte(0xaf); // reset ptr to start for (i--; i >= 0; i--) { + if (prevchar && newmsg[i] == 0x2E) { + display_send_byte(newmsg[i]&0x7f); + continue; + } + + // check if next character is a period + if (newmsg[i] == 0x2E) { + prevchar = newmsg[i]; + continue; + } + + if (prevchar) { + display_send_byte(newmsg[i]&0x7f); + display_send_byte(prevchar&0x7f); + prevchar = 0; + continue; + } + + if (newmsg[i] == 0) break; + display_send_byte(newmsg[i]&0x7f); } + + if (prevchar) { + display_send_byte(prevchar&0x7f); + } spi_disable(); } diff --git a/ROM2/src2asm.pl b/ROM2/src2asm.pl index 0f41a71..2d108b2 100644 --- a/ROM2/src2asm.pl +++ b/ROM2/src2asm.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # keep the format of this next line the same to match regex in check-romsrc.pl -$origin = 0x9c80; +$origin = 0x9d00; $hole_start = 0xb600; $hole_size = 0x0200; -- 2.20.1