• R/O
  • SSH
  • HTTPS

unagi: コミット


コミットメタ情報

リビジョン415 (tree)
日時2014-03-03 09:56:06
作者naruko

ログメッセージ

vram mirroring の command line mode (v) を追加

変更サマリ

差分

--- client/trunk/anago/anago_cui.c (revision 414)
+++ client/trunk/anago/anago_cui.c (revision 415)
@@ -18,9 +18,11 @@
1818 #ifdef _UNICODE
1919 #define PUTS _putws
2020 #define PRINTF wprintf
21-#else
21+ #define STRTOUL wcstoul
22+ #else
2223 #define PUTS puts
2324 #define PRINTF printf
25+ #define STRTOUL strtoul
2426 #endif
2527
2628 static void text_append_va(void *obj, const wgChar *format, va_list list)
@@ -222,6 +224,31 @@
222224 cui_gauge_destory(&config.ppu.gauge);
223225 }
224226
227+static void vram_scan(int c, wgChar **v, const struct reader_driver *r)
228+{
229+ const struct reader_handle *h;
230+ struct textcontrol log;
231+ if(c == 3){
232+ PUTS(wgT("anago F [address] [data]..."));
233+ return;
234+ }
235+ log_set(&log);
236+ h = r->control.open(except, &log);
237+
238+ if(c == 2){
239+ PRINTF(wgT("%02x\n"), r->control.vram_connection(h));
240+ }else{
241+ const long address = STRTOUL(v[2], NULL, 0x10);
242+ int i;
243+ for(i = 3; i < c; i++){
244+ const uint8_t d = STRTOUL(v[i], NULL, 0x10);
245+ r->cpu.memory_write(h, address, 1, &d);
246+ PRINTF(wgT("$%04x = 0x%02x->0x%02x\n"), address, (int) d, r->control.vram_connection(h));
247+ }
248+ }
249+ r->control.close(h);
250+}
251+
225252 static void usage(const wgChar *v)
226253 {
227254 PUTS(wgT("famicom bus simluator 'anago'"));
@@ -230,6 +257,7 @@
230257 PUTS(wgT("fF- flash program with kazzo"));
231258 PUTS(wgT("r - workram read with kazzo"));
232259 PUTS(wgT("w - workram write with kazzo"));
260+ PUTS(wgT("V - VRAM A10 scan"));
233261 if(DEBUG == 1){
234262 PUTS(wgT("z - ROM dump for test"));
235263 PUTS(wgT("xX- flash program for test"));
@@ -267,8 +295,13 @@
267295 r = &DRIVER_DUMMY; //though down
268296 case wgT('d'): case wgT('D'):
269297 case wgT('r'): case wgT('w'):
270- dump(c,v, r);
298+ dump(c, v, r);
271299 break;
300+ case wgT('V'):
301+ r = &DRIVER_DUMMY;
302+ case wgT('v'):
303+ vram_scan(c, v, r);
304+ break;
272305 default:
273306 usage(v[0]);
274307 PUTS(wgT("mode are d, D, f, g"));
旧リポジトリブラウザで表示