| 177 |
{ |
{ |
| 178 |
GtkCList *gregs, *winregs; |
GtkCList *gregs, *winregs; |
| 179 |
vector<unsigned long> regs; |
vector<unsigned long> regs; |
| 180 |
char *ptrs[66]={0}, buf[2][100], fmt[] = "%08X"; |
char *ptrs[65]={0}, buf[2][100], fmt[] = "%08X"; |
| 181 |
|
|
| 182 |
gregs = GTK_CLIST(lookup_widget( window_main, "clist_gregs")); |
gregs = GTK_CLIST(lookup_widget( window_main, "clist_gregs")); |
| 183 |
winregs = GTK_CLIST(lookup_widget( window_main, "clist_winregs")); |
winregs = GTK_CLIST(lookup_widget( window_main, "clist_winregs")); |
| 200 |
gtk_clist_append( winregs, ptrs ); |
gtk_clist_append( winregs, ptrs ); |
| 201 |
} |
} |
| 202 |
|
|
| 203 |
for( int i = 0 ; i < 66 ; i++ ) { |
for( int i = 0 ; i < 65 ; i++ ) { |
| 204 |
int k = (i == 0)? 64 : ((i == 65)? 1 : i); |
int k = (i == 0)? 64 : i; |
| 205 |
|
|
| 206 |
for( int j = 0 ; j < 8 ; j++ ) { |
for( int j = 0 ; j < 8 ; j++ ) { |
| 207 |
sprintf(buf[1], fmt, regs[k*8+j] ); |
sprintf(buf[1], fmt, regs[k*8+j] ); |
| 212 |
int cwp = vm.get_CWP(); |
int cwp = vm.get_CWP(); |
| 213 |
gtk_clist_moveto( winregs, 0, cwp*2 + 1, 0, 0.5 ); |
gtk_clist_moveto( winregs, 0, cwp*2 + 1, 0, 0.5 ); |
| 214 |
|
|
|
cwp = (cwp + 1) % 32; |
|
|
for( int j = 0 ; j < 3 ; j++ ){ |
|
|
char buf[50]; |
|
|
sprintf(buf, "%d", ( cwp == 0 && j == 0)? |
|
|
512 : (( cwp == 32 && j == 3 )? |
|
|
8 : cwp*16 + 8*j ) ); |
|
|
|
|
|
gtk_clist_set_column_title(winregs,cwp*2+j, |
|
|
buf ); |
|
|
gtk_clist_set_column_justification( winregs, |
|
|
cwp*2+j, GTK_JUSTIFY_CENTER ); |
|
|
} |
|
|
|
|
|
cwp = (cwp - 2) % 32; |
|
|
for( int j = 0 ; j < 3 ; j++ ){ |
|
|
char buf[50]; |
|
|
sprintf(buf, "%d", ( cwp == 0 && j == 0)? |
|
|
512 : (( cwp == 32 && j == 3 )? |
|
|
8 : cwp*16 + 8*j ) ); |
|
|
|
|
|
gtk_clist_set_column_title(winregs,cwp*2+j, |
|
|
buf ); |
|
|
gtk_clist_set_column_justification( winregs, |
|
|
cwp*2+j, GTK_JUSTIFY_CENTER ); |
|
|
} |
|
|
|
|
| 215 |
cwp = vm.get_CWP(); |
cwp = vm.get_CWP(); |
| 216 |
for( int j = 0 ; j < 3 ; j++ ){ |
for( int j = -3 ; j <= 3 ; j++ ){ |
| 217 |
char buf[50]; |
char buf[50]; |
|
sprintf(buf, "%d / %s", |
|
|
( cwp == 0 && j == 0)? |
|
|
512 : (( cwp == 32 && j == 3 )? |
|
|
8 : cwp*16 + 8*j ) , |
|
|
(j==0)?"%o":((j==1)?"%l":"%i") ); |
|
| 218 |
|
|
| 219 |
gtk_clist_set_column_title(winregs,cwp*2+j, |
sprintf(buf, "%d", 8 + ((j*8 + cwp*16)&(32*16 - 1)) ); |
| 220 |
buf ); |
|
| 221 |
|
if ( j >= -1 && j <= 1 ) |
| 222 |
|
sprintf(buf, "%s / %s", buf, |
| 223 |
|
(j == -1)?"%o":((j == 0)?"%l":"%i") ); |
| 224 |
|
|
| 225 |
|
int col = ((cwp*2 + j) & (64-1)) + 1; |
| 226 |
|
|
| 227 |
|
if (col == 64 ){ |
| 228 |
|
gtk_clist_set_column_title(winregs, 0, buf ); |
| 229 |
|
gtk_clist_set_column_justification( winregs, |
| 230 |
|
0, GTK_JUSTIFY_CENTER ); |
| 231 |
|
} |
| 232 |
|
|
| 233 |
|
gtk_clist_set_column_title(winregs, col, buf ); |
| 234 |
gtk_clist_set_column_justification( winregs, |
gtk_clist_set_column_justification( winregs, |
| 235 |
cwp*2+j, GTK_JUSTIFY_CENTER ); |
col, GTK_JUSTIFY_CENTER ); |
| 236 |
} |
} |
| 237 |
} else { |
} else { |
| 238 |
ptrs[0] = buf[0]; |
ptrs[0] = buf[0]; |
| 250 |
{ |
{ |
| 251 |
GtkLabel *lab; |
GtkLabel *lab; |
| 252 |
|
|
| 253 |
for( int i = 0 ; i < 66 ; i++ ){ |
for( int i = 0 ; i < 65 ; i++ ){ |
| 254 |
char buf[20]; |
char buf[20]; |
| 255 |
sprintf( buf, "label_winregs%02d", i ); |
sprintf( buf, "label_winregs%02d", i ); |
| 256 |
|
|
| 257 |
lab = GTK_LABEL(lookup_widget( window_main, buf)); |
lab = GTK_LABEL(lookup_widget( window_main, buf)); |
| 258 |
|
|
| 259 |
|
sprintf( buf, "%d", (i == 0) ? 512 : i*8 ); |
|
if ( i == 0 ) |
|
|
sprintf( buf, "%d", 512 ); |
|
|
else if ( i == 65 ) |
|
|
sprintf( buf, "%d", 8 ); |
|
|
else |
|
|
sprintf( buf, "%d", i*8 ); |
|
| 260 |
gtk_label_set_text(lab, buf ); |
gtk_label_set_text(lab, buf ); |
|
|
|
| 261 |
} |
} |
| 262 |
|
|
| 263 |
refresh_reglist(); |
refresh_reglist(); |
| 332 |
gtk_clist_set_background(codelist, vm.get_pPC()/4, &(colors[3]) ); |
gtk_clist_set_background(codelist, vm.get_pPC()/4, &(colors[3]) ); |
| 333 |
gtk_clist_set_background(codelist, vm.get_PC()/4, &(colors[2]) ); |
gtk_clist_set_background(codelist, vm.get_PC()/4, &(colors[2]) ); |
| 334 |
gtk_clist_set_background(codelist, vm.get_nPC()/4, &(colors[1]) ); |
gtk_clist_set_background(codelist, vm.get_nPC()/4, &(colors[1]) ); |
| 335 |
|
|
| 336 |
|
gtk_clist_moveto( codelist, vm.get_nPC()/4, 0, 0.8, 0); |
| 337 |
} |
} |
| 338 |
void refresh_memory( void ) |
void refresh_memory( void ) |
| 339 |
{ |
{ |