SCP: Extend BITFIELDS to allow alternate descriptions for same fields

This commit is contained in:
Mark Pizzolato 2022-02-04 07:56:15 -08:00
parent 919f8b78bc
commit 54eda7a050
3 changed files with 6 additions and 1 deletions

Binary file not shown.

5
scp.c
View file

@ -13607,7 +13607,7 @@ static const char *debtab_nomatch = "DEBTAB_NOMATCH";
const char *some_match = NULL;
int32 offset = 0;
if (dptr->debflags == 0)
if (dptr->debflags == NULL)
return debtab_none;
dbits &= (dptr->dctrl | (uptr ? uptr->dctrl : 0));/* Look for just the bits that matched */
@ -13676,6 +13676,8 @@ uint32 value, beforevalue, mask;
for (fields=offset=0; bitdefs[fields].name; ++fields) {
if (bitdefs[fields].offset == 0xffffffff) /* fixup uninitialized offsets */
bitdefs[fields].offset = offset;
else
offset = bitdefs[fields].offset;
offset += bitdefs[fields].width;
}
for (i = fields-1; i >= 0; i--) { /* print xlation, transition */
@ -13731,6 +13733,7 @@ if (sim_deb && dptr && (dptr->dctrl & dbits)) {
sim_oline = saved_oline; /* restore original socket */
}
}
void sim_debug_bits(uint32 dbits, DEVICE* dptr, BITFIELD* bitdefs,
uint32 before, uint32 after, int terminate)
{

View file

@ -986,6 +986,7 @@ struct MEMFILE {
/* Hidden Blob of Data - Only used for SAVE/RESTORE */
#define SAVEDATA(nm,loc) \
_REGDATANF(#nm,&(loc),0,8,0,1,NULL,NULL,0,sizeof(loc),sizeof(loc),SAVEDATA),(REG_HRO)
#define STARTBIT {"", 0x00000000, 0, NULL, NULL} /* Start at beginning bit */
#define BIT(nm) {#nm, 0xffffffff, 1, NULL, NULL} /* Single Bit definition */
#define BITNC {"", 0xffffffff, 1, NULL, NULL} /* Don't care Bit definition */
#define BITF(nm,sz) {#nm, 0xffffffff, sz, NULL, NULL} /* Bit Field definition */
@ -1073,6 +1074,7 @@ struct MEMFILE {
/* Hidden Blob of Data - Only used for SAVE/RESTORE */
#define SAVEDATA(nm,loc) \
_REGDATANF("nm",&(loc),0,8,0,1,NULL,NULL,0,sizeof(loc),sizeof(loc)),SAVEDATA),(REG_HRO)
#define STARTBIT {"", 0x00000000, 0, NULL, NULL} /* Start at beginning bit */
#define BIT(nm) {"nm", 0xffffffff, 1, NULL, NULL} /* Single Bit definition */
#define BITNC {"", 0xffffffff, 1, NULL, NULL} /* Don't care Bit definition */
#define BITF(nm,sz) {"nm", 0xffffffff, sz, NULL, NULL} /* Bit Field definition */