From ee6481e9de50fd16d2aa5695a506437ce1387002 Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Tue, 23 Jan 2024 23:56:40 +0000 Subject: [PATCH] GUI: small improvements to the hex dump window --- gui.c | 10 ++++++---- simdata.c | 2 ++ simdata.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gui.c b/gui.c index d6eca83..db0a006 100644 --- a/gui.c +++ b/gui.c @@ -147,9 +147,11 @@ int update_general_memdump(struct simdata_t *simdata){ if(width<16){ mvwprintw(general_memdump,1,1,"too small window"); }else{ - int n=(width-12)/4; - uint32_t ADDRESS=0; - for(int h=0;hPC-n*usable_height/2)&0x00FFFFFF; + for(int h=0;hRAM[temp_address++]); for (int i=0;iRAM[ADDRESS]>=0x20&&simdata->RAM[ADDRESS]<0x7F)?simdata->RAM[ADDRESS]:'.'); - ADDRESS++; + ADDRESS=(ADDRESS+1)&0xFFFFFF; } } } diff --git a/simdata.c b/simdata.c index 01f6f44..92e7b0f 100644 --- a/simdata.c +++ b/simdata.c @@ -36,6 +36,8 @@ struct simdata_t *init_simdata(){ return 0; } + ret->PC=0; + return ret; } diff --git a/simdata.h b/simdata.h index d4d7439..8761597 100644 --- a/simdata.h +++ b/simdata.h @@ -4,6 +4,7 @@ struct simdata_t{ long unsigned int current_clock; uint8_t *RAM; + uint32_t PC; }; struct simdata_t *init_simdata();