GUI: fixed a segfault

This commit is contained in:
(Tim) Efthimis Kritikos 2024-01-26 12:24:43 +00:00
parent ee6481e9de
commit 16c70777f2

7
gui.c
View File

@ -155,8 +155,11 @@ int update_general_memdump(struct simdata_t *simdata){
wmove(general_memdump,h+2,2+(width-12)%2);
wprintw(general_memdump,"%06x ",ADDRESS);
uint32_t temp_address=ADDRESS;
for (int i=0;i<n;i++)
wprintw(general_memdump,"%02x ",simdata->RAM[temp_address++]);
for (int i=0;i<n;i++){
wprintw(general_memdump,"%02x ",simdata->RAM[ADDRESS]);
ADDRESS=(ADDRESS+1)&0xFFFFFF;
}
ADDRESS=temp_address;
for (int i=0;i<n;i++){
wprintw(general_memdump,"%c",(simdata->RAM[ADDRESS]>=0x20&&simdata->RAM[ADDRESS]<0x7F)?simdata->RAM[ADDRESS]:'.');
ADDRESS=(ADDRESS+1)&0xFFFFFF;