GUI: Fixed the float interpretation of the registers in the gui registers window

This commit is contained in:
(Tim) Efthimis Kritikos 2024-02-06 20:55:39 +00:00
parent 3e5e8f56e8
commit e86bf547cb

6
gui.c
View File

@ -358,7 +358,11 @@ int update_general_registers(struct simdata_t *simdata){
while(y!=lines_used){
for(int i=0;i<per_line;i++){
if(n<8){
mvwprintw(general_registers,1+y+center_y_offset,1+i*35+center_x_offset,"R%d: %08X (%lf) ",n,simdata->registers->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++;
}
}