aboutsummaryrefslogtreecommitdiff
path: root/sim/ft32/interp.c
diff options
context:
space:
mode:
authorJames Bowman <james.bowman@ftdichip.com>2015-09-22 22:43:56 -0400
committerMike Frysinger <vapier@gentoo.org>2015-09-22 22:43:56 -0400
commitbcd68f9e44a70c73bde08e612a28e413570dc039 (patch)
tree42dc4c5cb4d45cfd670734f25a54927af6affb67 /sim/ft32/interp.c
parentaf73b6a704bec1715511938a3514409af3810641 (diff)
downloadgdb-bcd68f9e44a70c73bde08e612a28e413570dc039.zip
gdb-bcd68f9e44a70c73bde08e612a28e413570dc039.tar.gz
gdb-bcd68f9e44a70c73bde08e612a28e413570dc039.tar.bz2
sim: ft32: add character input port
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.
Diffstat (limited to 'sim/ft32/interp.c')
-rw-r--r--sim/ft32/interp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c
index 404683d..a20907c 100644
--- a/sim/ft32/interp.c
+++ b/sim/ft32/interp.c
@@ -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;