Added logic to sync memory last pass values at startup.

This commit is contained in:
Matthew Budd 2020-05-29 17:19:44 -04:00
parent 7500446b2c
commit a92874a5b6
1 changed files with 14 additions and 6 deletions

View File

@ -280,6 +280,8 @@ struct memViewWin_t
void showMemViewResults (int reset); void showMemViewResults (int reset);
int calcVisibleRange( int *start_out, int *end_out, int *center_out ); int calcVisibleRange( int *start_out, int *end_out, int *center_out );
int getAddrFromCursor( int CursorTextOffset = -1 ); int getAddrFromCursor( int CursorTextOffset = -1 );
int checkMemActivity(void);
void initMem(void);
}; };
@ -298,16 +300,22 @@ static int conv2xchar( int i )
return c; return c;
} }
static void initMem( struct memByte_t *c, int size ) void memViewWin_t::initMem(void)
{ {
for (int i=0; i<size; i++)
for (int i=0; i<mbuf_size; i++)
{ {
c[i].data = (i%2) ? 0xA5 : 0x5A; mbuf[i].data = memAccessFunc(i);
c[i].color = 0; mbuf[i].color = 0;
c[i].actv = 0; mbuf[i].actv = 0;
} }
} }
int memViewWin_t::checkMemActivity(void)
{
return 0;
}
int memViewWin_t::getAddrFromCursor( int CursorTextOffset ) int memViewWin_t::getAddrFromCursor( int CursorTextOffset )
{ {
int line, offs, byte0, byte, bcol, addr = -1; int line, offs, byte0, byte, bcol, addr = -1;
@ -403,7 +411,7 @@ void memViewWin_t::showMemViewResults (int reset)
if ( mbuf ) if ( mbuf )
{ {
mbuf_size = memSize; mbuf_size = memSize;
initMem( mbuf, memSize ); initMem();
} }
else else
{ {