GUI: Slight improvement to general->memdump window

This commit is contained in:
(Tim) Efthimis Kritikos 2024-01-29 13:21:56 +00:00
parent 9b679d8f82
commit 651e875c9b

9
gui.c
View File

@ -288,14 +288,23 @@ int update_general_memdump(struct simdata_t *simdata){
uint32_t ADDRESS=(simdata->PC-n*usable_height/2)&0x00FFFFFF;
for(int h=0;h<usable_height;h++){
wmove(general_memdump,h+2,2+(width-12)%2);
wattroff(general_memdump,A_BOLD);
wprintw(general_memdump,"%06x ",ADDRESS);
uint32_t temp_address=ADDRESS;
for (int i=0;i<n;i++){
if(ADDRESS>=simdata->PC&&ADDRESS<=simdata->PC+4)
wattron(general_memdump,A_BOLD);
else
wattroff(general_memdump,A_BOLD);
wprintw(general_memdump,"%02x ",simdata->RAM[ADDRESS]);
ADDRESS=(ADDRESS+1)&0xFFFFFF;
}
ADDRESS=temp_address;
for (int i=0;i<n;i++){
if(ADDRESS>=simdata->PC&&ADDRESS<=simdata->PC+4)
wattron(general_memdump,A_BOLD);
else
wattroff(general_memdump,A_BOLD);
wprintw(general_memdump,"%c",(simdata->RAM[ADDRESS]>=0x20&&simdata->RAM[ADDRESS]<0x7F)?simdata->RAM[ADDRESS]:'.');
ADDRESS=(ADDRESS+1)&0xFFFFFF;
}