Fix bug in ROM vis display of periods on the display
authorMark Tearle <[email protected]>
Thu, 19 Mar 2015 14:31:21 +0000 (22:31 +0800)
committerMark Tearle <[email protected]>
Thu, 19 Mar 2015 15:30:20 +0000 (23:30 +0800)
ROM2/display_basic.c
ROM2/src2asm.pl

index 2849696..1d69793 100644 (file)
@@ -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();
 }
 
index 0f41a71..2d108b2 100644 (file)
@@ -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;
 

UCC git Repository :: git.ucc.asn.au