コミットメタ情報

リビジョン5075e0cf6afb384fdc84600a44d261a31dcf6935 (tree)
日時2015-06-06 18:26:23
作者naruko <naruko@24ea...>
コミッターnaruko

ログメッセージ

flash programming is supported

git-svn-id: svn+ssh://svn.osdn.net/svnroot/unagi@419 24ea1065-a21e-4ca1-99c9-f5125deb0858

変更サマリ

差分

--- a/client/trunk/anago/Makefile.windows
+++ b/client/trunk/anago/Makefile.windows
@@ -1,7 +1,7 @@
11 APP_CUI = anago.exe
22 APP_GUI = anago_wx.exe
33 LIBUSB = ../libusb-win32-bin-1.2.6.0
4-SQUIRREL = ../SQUIRREL224
4+SQUIRREL = ../SQUIRREL225
55 KAZZO = ../../kazzo/include
66 WX_CONFIG = /d/dev/wxWidgets/build_unicode_sound3/wx-config
77 CPPFLAGS = -D_UNICODE
--- a/client/trunk/anago/anago_cui.c
+++ b/client/trunk/anago/anago_cui.c
@@ -14,6 +14,7 @@
1414 #include "script_dump.h"
1515 #include "flash_device.h"
1616 #include "script_program.h"
17+#include "crc32.h"
1718
1819 #ifdef _UNICODE
1920 #define PUTS _putws
@@ -249,14 +250,16 @@ static void vram_scan(int c, wgChar **v, const struct reader_driver *r)
249250 r->control.close(h);
250251 }
251252
252-#include "crc32.h"
253253 static void crc32_dump(const wgChar *name, const wgChar *str, struct memory *m)
254254 {
255- const long banksize = STRTOUL(str, NULL, 0x10);
255+ long banksize = STRTOUL(str, NULL, 0x10);
256256 if(banksize < 0x400 || (banksize & 0xff) != 0){
257257 PUTS(wgT("banksize requires over 0x400"));
258258 return;
259259 }
260+ if(banksize > m->size){
261+ banksize = m->size;
262+ }
260263 int i, j;
261264 PRINTF(wgT("%s 0x%x byte\n"), name, m->size);
262265 for(i = 0, j = 0; i < m->size; i += banksize, j++){
@@ -291,7 +294,7 @@ static void usage(const wgChar *v)
291294 PUTS(wgT("fF- flash program with kazzo"));
292295 PUTS(wgT("r - workram read with kazzo"));
293296 PUTS(wgT("w - workram write with kazzo"));
294- PUTS(wgT("V - VRAM A10 scan"));
297+ PUTS(wgT("v - VRAM A10 scan with kazzo"));
295298 PUTS(wgT("b - display each CRC32s by required size"));
296299 if(DEBUG == 1){
297300 PUTS(wgT("z - ROM dump for test"));
--- a/client/trunk/anago/anago_gui.cpp
+++ b/client/trunk/anago/anago_gui.cpp
@@ -1,4 +1,4 @@
1-///////////////////////////////////////////////////////////////////////////
1+//////////////////////////////////////////
22 // C++ code generated with wxFormBuilder (version Sep 8 2010)
33 // http://www.wxformbuilder.org/
44 //
@@ -54,7 +54,7 @@ panel_version::panel_version( wxWindow* parent, wxWindowID id, const wxPoint& po
5454
5555 bSizer30->Add( m_version_title, 0, wxALL, 2 );
5656
57- m_version_copyright = new wxStaticText( this, wxID_ANY, wxT("(C) unagi development team 2010"), wxDefaultPosition, wxDefaultSize, 0 );
57+ m_version_copyright = new wxStaticText( this, wxID_ANY, wxT("(C) unagi development team 2010-2014"), wxDefaultPosition, wxDefaultSize, 0 );
5858 m_version_copyright->Wrap( -1 );
5959 bSizer30->Add( m_version_copyright, 0, wxALL, 2 );
6060
--- a/client/trunk/anago/bandai_fcg1.ad
+++ b/client/trunk/anago/bandai_fcg1.ad
@@ -29,4 +29,4 @@ board <- {
2929 };
3030
3131 const register_offset = 0x6000;
32-dofile("fcg3.ai");
32+dofile("lz93d50.ai");
--- a/client/trunk/anago/namcot_19.ai
+++ b/client/trunk/anago/namcot_19.ai
@@ -12,13 +12,15 @@ I have never seen labeled IC with '106'.
1212 */
1313 function cpu_dump(d, pagesize, banksize)
1414 {
15- for(local i = 0; i < pagesize - 2; i += 2){
15+ for(local i = 0; i < pagesize - 1 ; i += 1){
1616 cpu_write(d, 0xe000, i);
17- cpu_write(d, 0xe800, i | 1);
18- cpu_read(d, 0x8000, banksize * 2);
17+ cpu_read(d, 0x8000, banksize);
1918 }
20- cpu_write(d, 0xf000, 0x3e);
21- cpu_read(d, 0xc000, banksize * 2);
19+/*
20+note: databus conficts on $c800-$dfff. ($c800-$dfff & $7fff) are internal RAM port....
21+Unfortunately kazzo generates incomple read wave form. do not use $c800-$dfff.
22+*/
23+ cpu_read(d, 0xe000, banksize);
2224 }
2325
2426 function ppu_dump(d, pagesize, banksize)
--- a/client/trunk/anago/script_dump.c
+++ b/client/trunk/anago/script_dump.c
@@ -348,10 +348,11 @@ static SQInteger memory_size_set(HSQUIRRELVM v)
348348 r = qr_argument_get(v, 2, &d->cpu.memory.size, &d->ppu.memory.size);
349349 return r;
350350 }
351-
351+//sq_pushroottable(v); //push the root table(were the globals of the script will are stored)
352352 static bool script_execute(HSQUIRRELVM v, struct dump_config *d)
353353 {
354354 bool ret = true;
355+// sq_pushroottable(v);
355356 if(SQ_FAILED(sqstd_dofile(v, wgT("dumpcore.nut"), SQFalse, SQTrue))){
356357 d->log.append(d->log.object, wgT("dump core script error\n"));
357358 ret = false;
@@ -403,6 +404,7 @@ bool script_dump_execute(struct dump_config *d)
403404 return false;
404405 }
405406 qr_close(v);
407+ v = NULL;
406408 }
407409
408410 d->handle = d->control->open(d->except, &d->log);
@@ -410,13 +412,9 @@ bool script_dump_execute(struct dump_config *d)
410412 d->log.append(d->log.object, wgT("reader open error\n"));
411413 return false;
412414 }
413-/* d->control->init(d->handle);
414- if(connection_check(d->handle, &d->log, d->cpu.access, d->ppu.access) == false){
415- d->control->close(d->handle);
416- return false;
417- }*/
415+ //d->log.append(d->log.object, wgT("haohao\n"));
418416 {
419- HSQUIRRELVM v = qr_open(&d->log);
417+ volatile HSQUIRRELVM v = qr_open(&d->log);
420418 qr_function_register_global(v, wgT("memory_new"), memory_new);
421419 qr_function_register_global(v, wgT("nesfile_save"), nesfile_save);
422420 qr_function_register_global(v, wgT("cpu_write"), cpu_write);
@@ -425,6 +423,7 @@ bool script_dump_execute(struct dump_config *d)
425423 qr_function_register_global(v, wgT("ppu_ramfind"), ppu_ramfind);
426424 script_execute(v, d);
427425 qr_close(v);
426+ v = NULL;
428427 }
429428 d->control->close(d->handle);
430429 d->handle = NULL;
--- a/client/trunk/anago/squirrel_wrap.c
+++ b/client/trunk/anago/squirrel_wrap.c
@@ -42,9 +42,9 @@ HSQUIRRELVM qr_open(const struct textcontrol *p)
4242 sq_setprintfunc(v, print_other);
4343 }
4444 sq_pushroottable(v);
45- sqstd_seterrorhandlers(v);
4645 sqstd_register_iolib(v);
4746 sqstd_register_stringlib(v);
47+ sqstd_seterrorhandlers(v);
4848 return v;
4949 }
5050
--- a/client/trunk/anago/sunsoft_fme.ad
+++ b/client/trunk/anago/sunsoft_fme.ag
@@ -18,8 +18,8 @@ SUNSOFT-5A, SUNSOFT-5B, FME-7
1818 $6000-$7fff 7:0 RAM data (if RAM is enabled)
1919 $8000-$9fff 3:0 memory register address
2020 $a000-$bfff 7:0 memory register data
21-$c000-$dfff 3:0 audio register address
22-$e000-$ffff 7:0 audio register data
21+$c000-$dfff 3:0 audio register address (SUNSOFT-5B only)
22+$e000-$ffff 7:0 audio register data (SUNSOFT-5B only)
2323
2424 [CPU readmap]
2525 $6000-$7fff 7:0 Program ROM bank #0 or RAM
@@ -39,7 +39,7 @@ adr bit assignments
3939 -------------------------
4040 0-7 7:0 Charcter ROM bank #0 to #7
4141 8 7 RAM enable bit 0:disable 1:enable
42- 6 memory select at $6000-$7fff 0:ROM 1:RAM
42+ 6 memory select on $6000-$7fff 0:ROM 1:RAM
4343 4:0 CPU ROM page for bank #0
4444 9-b 4:0 CPU ROM page for bank #1 to #3
4545 c 1:0 PPU area VRAM control
@@ -55,7 +55,7 @@ address 8, bit7:6 behave on FME-7
5555 11 enabled RAM
5656
5757 audio register
58-(not analysed yet)
58+(not analyzed yet)
5959
6060 */
6161 function sunsoft5_write(d, register_address, data)
@@ -66,16 +66,16 @@ function sunsoft5_write(d, register_address, data)
6666
6767 function cpu_dump(d, pagesize, banksize)
6868 {
69+ local regaddress = 9
70+ local cpuaddress = 0x8000
6971 /*
70- //dump ROM data via $6000-$7fff
71- for(local i = 0; i < pagesize; i++){
72- sunsoft5_write(d, 8, i);
73- cpu_read(d, 0x6000, banksize);
74- }
72+ //*debug* dump ROM data via $6000-$7fff
73+ regaddress = 8
74+ cpuaddress = 0x6000
7575 */
7676 for(local i = 0; i < pagesize - 1; i++){
77- sunsoft5_write(d, 9, i);
78- cpu_read(d, 0x8000, banksize);
77+ sunsoft5_write(d, regaddress, i);
78+ cpu_read(d, cpuaddress, banksize);
7979 }
8080 cpu_read(d, 0xe000, banksize);
8181 }
@@ -103,28 +103,32 @@ CPU memory bank
103103 cpu address|rom address |page|task
104104 $8000-$9fff|0x02000-0x03fff|1 |write 0x2aaa
105105 $a000-$bfff|0x04000-0x05fff|2 |write 0x5555
106-$c000-$dfff|n * 0x2000 |n |program area
106+$c000-$dfff|n * 0x2000 |n |programming area
107107 $e000-$ffff|0x3c000-0x3ffff|fix |program last page
108108
109109 PPU memory bank
110110 ppu address |rom address |page|task
111-0x0000-0x03ff|0x02800-0x02fff|0x0a|write 0x2aaa
112-0x0400-0x07ff|0x05000-0x057ff|0x14|write 0x5555
113-0x0800-0x0fff|未使用
114-0x1000-0x1fff|n * 0x1000 |n |program area
111+0x0000-0x0fff|n * 0x1000 |n |programming area
112+0x1000-0x13ff|0x02800-0x02fff|0x0a|write 0x2aaa
113+0x1400-0x17ff|0x05000-0x057ff|0x15|write 0x5555
114+0x1800-0x1fff|未使用
115115 */
116116 function program_initalize(d, cpu_banksize, ppu_banksize)
117117 {
118- sunsoft5_write(d, 8, 0x40); //disable W-RAM
118+ sunsoft5_write(d, 8, 1 << 6); //disable W-RAM
119119
120- cpu_command(d, 0x2aaa, 0xe000, cpu_banksize);
121- cpu_command(d, 0x5555, 0xe000, cpu_banksize);
120+ cpu_command(d, 0x2aaa, 0xa000, cpu_banksize);
121+ cpu_command(d, 0x5555, 0xc000, cpu_banksize);
122122 sunsoft5_write(d, 0xa,1);
123123 sunsoft5_write(d, 0xb,2);
124124
125125 ppu_command(d, 0x2aaa, 0x1000, ppu_banksize);
126126 ppu_command(d, 0x5555, 0x1400, ppu_banksize);
127127 ppu_command(d, 0x0000, 0x1800, ppu_banksize);
128+ //なぜかよくわからないが電源投入直後の erase に失敗する (2度は必ず成功する)
129+/* for(local j = 0; j < 0x80; j++){
130+ sunsoft5_write(d, j & 0x07, j);
131+ }*/
128132 sunsoft5_write(d, 4, 0x0a);
129133 sunsoft5_write(d, 5, 0x15);
130134 sunsoft5_write(d, 6, 0);
@@ -133,23 +137,21 @@ function program_initalize(d, cpu_banksize, ppu_banksize)
133137 function cpu_transfer(d, start, end, cpu_banksize)
134138 {
135139 for(local i = start; i < end - 1; i += 1){
136- sunsoft5_write(d, 0xb, 3);
140+ sunsoft5_write(d, 9, i);
137141 cpu_program(d, 0x8000, cpu_banksize);
138142 }
139- cpu_program(d, 0xe000, cpu_banksize);
143+ //$6000-$7fff への不正アクセスを避けるため $e000-$ffff は使用しない
144+ sunsoft5_write(d, 9, 0xff & 0x1f);
145+ cpu_program(d, 0x8000, cpu_banksize);
140146 }
141147
142148 function ppu_transfer(d, start, end, ppu_banksize)
143149 {
144-/* local mul = 1;
150+ local mul = 4
145151 for(local i = start; i < end; i += mul){
146152 for(local j = 0; j < mul; j++){
147153 sunsoft5_write(d, j, i + j);
148154 }
149155 ppu_program(d, 0x0000, ppu_banksize * mul);
150- }*/
151- for(local i = start; i < end; i += 1){
152- sunsoft5_write(d, 4, i);
153- ppu_program(d, 0x1000, ppu_banksize);
154156 }
155157 }
旧リポジトリブラウザで表示