From e86bf547cb56e97178e323d3f8e749e5b1a46675 Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Tue, 6 Feb 2024 20:55:39 +0000 Subject: [PATCH] GUI: Fixed the float interpretation of the registers in the gui registers window --- gui.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui.c b/gui.c index 4620b29..624fcbc 100644 --- a/gui.c +++ b/gui.c @@ -358,7 +358,11 @@ int update_general_registers(struct simdata_t *simdata){ while(y!=lines_used){ for(int i=0;iregisters->GPR[n],(double)simdata->registers->GPR[n]); + float float_equiv=*(float*)(simdata->registers->GPR+n); + if(float_equiv<9999999999&&float_equiv>-9999999999) + mvwprintw(general_registers,1+y+center_y_offset,1+i*35+center_x_offset,"R%d: %08X (%08f) ",n,simdata->registers->GPR[n],float_equiv); + else + mvwprintw(general_registers,1+y+center_y_offset,1+i*35+center_x_offset,"R%d: %08X (%cinf) ",n,simdata->registers->GPR[n],(float_equiv>0)?'+':'-'); n++; } }