diff --git a/assets-fx/img/opt_switch_ctx.png b/assets-fx/img/opt_switch_ctx.png index 138baac..ad1e606 100644 Binary files a/assets-fx/img/opt_switch_ctx.png and b/assets-fx/img/opt_switch_ctx.png differ diff --git a/assets-fx/img/opt_switch_ctx_sh3.png b/assets-fx/img/opt_switch_ctx_sh3.png index 588b385..c8c7c6f 100644 Binary files a/assets-fx/img/opt_switch_ctx_sh3.png and b/assets-fx/img/opt_switch_ctx_sh3.png differ diff --git a/src/gint/switch.c b/src/gint/switch.c index 5c58ada..7300700 100644 --- a/src/gint/switch.c +++ b/src/gint/switch.c @@ -84,6 +84,24 @@ static void ctx_etmu(int start) show_etmu(2*i+1, i+start, t); } } +static void ctx_intc() +{ + uint16_t *IPR = driver_ctx("INTC"); + + if(isSH3()) + { + row_print(1,1, "A:%04x B:%04x C:%04x", IPR[0], IPR[1], IPR[2]); + row_print(2,1, "D:%04x E:%04x F:%04x", IPR[3], IPR[4], IPR[5]); + row_print(3,1, "G:%04x H:%04x", IPR[6], IPR[7]); + } + else + { + row_print(1,1, "A:%04x B:%04x C:%04x", IPR[0], IPR[1], IPR[2]); + row_print(2,1, "D:%04x E:%04x F:%04x", IPR[3], IPR[4], IPR[5]); + row_print(3,1, "G:%04x H:%04x I:%04x", IPR[6], IPR[7], IPR[8]); + row_print(4,1, "J:%04x K:%04x L:%04x", IPR[9],IPR[10],IPR[11]); + } +} #endif /* FX9860G */ #ifdef FXCG50 @@ -177,6 +195,7 @@ static void system_contexts(void) #ifdef FX9860G if(tab == 3) ctx_etmu(0); if(tab == 4) ctx_etmu(3); + if(tab == 5) ctx_intc(); #endif #ifdef FXCG50 @@ -190,6 +209,7 @@ static void system_contexts(void) if(key == KEY_F2) tab = 1; if(key == KEY_F3) tab = 2; if(key == KEY_F4) tab = 3; + if(key == KEY_F6) tab = 5; #ifdef FX9860G if(key == KEY_F5 && isSH3()) tab = 4; diff --git a/src/regs/regs.c b/src/regs/regs.c index 48feb89..2f74e91 100644 --- a/src/regs/regs.c +++ b/src/regs/regs.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -7,26 +8,39 @@ void gintctl_regs(void) { - if(isSH3()) return; - - #ifdef FX9860G - #warning gintctl_regs not implemented on SH3 - #endif - - #define IPR(X) SH7305_INTC._->IPR##X.word - #define IMR(X) SH7305_INTC.MSK->IMR##X - dclear(C_WHITE); row_title("Register browser"); - row_print(2, 1, "A:%04x B:%04x C:%04x", IPR(A), IPR(B), IPR(C)); - row_print(3, 1, "D:%04x E:%04x F:%04x", IPR(D), IPR(E), IPR(F)); - row_print(4, 1, "G:%04x H:%04x I:%04x", IPR(G), IPR(H), IPR(I)); - row_print(5, 1, "J:%04x K:%04x L:%04x", IPR(J), IPR(K), IPR(L)); + if(isSH3()) + { + #define IPR(X) (*SH7705_INTC._.IPR##X).word + row_print(2,1, "A:%04x B:%04x C:%04x", IPR(A), IPR(B), IPR(C)); + row_print(3,1, "D:%04x E:%04x F:%04x", IPR(D), IPR(E), IPR(F)); + row_print(4,1, "G:%04x H:%04x", IPR(G), IPR(H)); + + row_print(6, 1, "RCR1:%02x RCR2:%02x", + SH7705_RTC.RCR1.byte, + SH7705_RTC.RCR2.byte + ); + #undef IPR + } + else + { + #define IPR(X) SH7305_INTC._->IPR##X.word + row_print(2,1, "A:%04x B:%04x C:%04x", IPR(A), IPR(B), IPR(C)); + row_print(3,1, "D:%04x E:%04x F:%04x", IPR(D), IPR(E), IPR(F)); + row_print(4,1, "G:%04x H:%04x I:%04x", IPR(G), IPR(H), IPR(I)); + row_print(5,1, "J:%04x K:%04x L:%04x", IPR(J), IPR(K), IPR(L)); + #undef IPR + } dupdate(); getkey(); + if(isSH3()) return; + + #define IMR(X) SH7305_INTC.MSK->IMR##X + dclear(C_WHITE); row_title("Register browser");