]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: ft32: add character input port
authorJames Bowman <james.bowman@ftdichip.com>
Wed, 23 Sep 2015 02:43:56 +0000 (22:43 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 23 Sep 2015 02:43:56 +0000 (22:43 -0400)
The FT32 simulator has character output, of course. This patch
adds character input, which lets the simulator run interactive
FT32 applications, e.g. language interpreters.

sim/ft32/ChangeLog
sim/ft32/interp.c

index 988413fe8de1a9fc4f1e22413dec6b90d827014c..29f661fca23bed7b972b7720d25e07cfbff06edf 100644 (file)
@@ -1,3 +1,7 @@
+2015-09-22  James Bowman  <james.bowman@ftdichip.com>
+
+       * ft32/interp.c (cpu_mem_read): Call getchar when ea is 0x10000.
+
 2015-06-23  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index 404683da77889bddb87b2e8c42bf9dfc2e14a616..a20907c5c86aee28df4601854bd46fdce44166c4 100644 (file)
@@ -169,6 +169,8 @@ static uint32_t cpu_mem_read (SIM_DESC sd, uint32_t dw, uint32_t ea)
       /* Simulate some IO devices */
       switch (ea)
        {
+       case 0x10000:
+         return getchar ();
        case 0x1fff4:
          /* Read the simulator cycle timer.  */
          return cpu->state.cycles / 100;