リビジョン | 56950a14ccf1ffae74c36e0cab352f16f1341629 (tree) |
---|---|
日時 | 2014-03-03 09:55:44 |
作者 | naruko <naruko@24ea...> |
コミッター | naruko |
script file の追加
git-svn-id: svn+ssh://svn.osdn.net/svnroot/unagi@414 24ea1065-a21e-4ca1-99c9-f5125deb0858
@@ -28,7 +28,7 @@ board <- { | ||
28 | 28 | size_base = 2 * mega, size_max = 2 * mega, |
29 | 29 | banksize = 0x0400 |
30 | 30 | }, |
31 | - ppu_ramfind = true, | |
31 | + ppu_ramfind = false, | |
32 | 32 | vram_mirrorfind = false |
33 | 33 | }; |
34 | 34 |
@@ -0,0 +1,46 @@ | ||
1 | +/* | |
2 | +Karaoke Studio by Bandai | |
3 | +*/ | |
4 | +board <- { | |
5 | + mappernum = 188, vram_mirrorfind = false, ppu_ramfind = false, | |
6 | + cpu_rom = { | |
7 | + size_base = 1 * mega, size_max = 4 * mega, | |
8 | + banksize = 0x4000 | |
9 | + }, | |
10 | + ppu_rom = { | |
11 | + size_base = 0, size_max = 0, | |
12 | + banksize = 0x2000 | |
13 | + } | |
14 | +}; | |
15 | + | |
16 | +function dump_mainrom(d, banksize) | |
17 | +{ | |
18 | + for(local i = 0; i < 8 - 1; i += 1){ | |
19 | + local dd = i + 0x10; | |
20 | + cpu_write(d, 0xf000 + dd, dd); | |
21 | + cpu_read(d, 0x8000, banksize); | |
22 | + } | |
23 | + cpu_read(d, 0xc000, banksize); | |
24 | +} | |
25 | +/* | |
26 | +page map | |
27 | +0x00 to 0x0f: subcartridge ROM | |
28 | +0x10 to 0x17: main PCB ROM data (mirror) | |
29 | +0x18 to 0x1f: main PCB ROM data | |
30 | +*/ | |
31 | +function cpu_dump(d, pagesize, banksize) | |
32 | +{ | |
33 | + if(pagesize == 8){ | |
34 | + dump_mainrom(d, banksize); | |
35 | + }else{ | |
36 | +/* | |
37 | +結合型 nes file は先頭から順に main ROM, sub ROM を配置する。 | |
38 | +write register の順番から見ると変。 | |
39 | +*/ | |
40 | + dump_mainrom(d, banksize); | |
41 | + for(local i = 0; i < (pagesize / 2); i += 1){ | |
42 | + cpu_write(d, 0xc000 + i, i); | |
43 | + cpu_read(d, 0x8000, banksize); | |
44 | + } | |
45 | + } | |
46 | +} |
@@ -1,13 +1,13 @@ | ||
1 | 1 | /* |
2 | 2 | IREM G-101 based cartridge |
3 | 3 | |
4 | -$8000-$9fff bank#0, switchable or last - 2 | |
4 | +$8000-$9fff bank#0, switchable or last - 1 | |
5 | 5 | $a000-$bfff bank#1, switchable |
6 | -$c000-$dfff bank#2, last - 2 or switchable | |
6 | +$c000-$dfff bank#2, last - 1 or switchable | |
7 | 7 | $e000-$ffff |
8 | 8 | note: |
9 | 9 | Major League PCB maybe ignore write operation to $9000-$9fff |
10 | -$9000-$9fff write register are fixed to bank #2 = last -2 and VRAM A10 = high | |
10 | +$9000-$9fff write register are fixed to bank #2 = last -1 | |
11 | 11 | */ |
12 | 12 | |
13 | 13 | board <- { |
@@ -26,7 +26,7 @@ board <- { | ||
26 | 26 | |
27 | 27 | function cpu_dump(d, pagesize, banksize) |
28 | 28 | { |
29 | - if(1){ | |
29 | + if(false){ | |
30 | 30 | cpu_write(d, 0x9000, 0); |
31 | 31 | for(local i = 0; i < pagesize - 2; i += 2){ |
32 | 32 | cpu_write(d, 0x8000, i); |
@@ -57,3 +57,32 @@ function ppu_dump(d, pagesize, banksize) | ||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | +function program_initalize(d, cpu_banksize, ppu_banksize) | |
61 | +{ | |
62 | + cpu_write(d, 0x9000, 0); | |
63 | + cpu_write(d, 0x8000, 0); | |
64 | + cpu_command(d, 0, 0x8000, cpu_banksize); | |
65 | + cpu_command(d, 0x02aa, 0xc000, cpu_banksize); | |
66 | + cpu_command(d, 0x0555, 0xc000, cpu_banksize); | |
67 | + cpu_write(d, 0xb000, [0xa, 0x15, 0]); | |
68 | + cpu_command(d, 0x2aaa, 0x0000, ppu_banksize); | |
69 | + cpu_command(d, 0x5555, 0x0400, ppu_banksize); | |
70 | + cpu_command(d, 0, 0x0800, ppu_banksize); | |
71 | +} | |
72 | + | |
73 | +function cpu_transfer(d, start, end, cpu_banksize) | |
74 | +{ | |
75 | + for(local i = start; i < end - 1; i += 1){ | |
76 | + cpu_write(d, 0x8000, i); | |
77 | + cpu_program(d, 0x8000, cpu_banksize); | |
78 | + } | |
79 | + cpu_program(d, 0xc000, cpu_banksize); | |
80 | +} | |
81 | + | |
82 | +function ppu_transfer(d, start, end, ppu_banksize) | |
83 | +{ | |
84 | + for(local i = start; i < end; i +=4){ | |
85 | + cpu_write(d, 0xb004, [i, i+1, i+2, i+3]); | |
86 | + ppu_program(d, 0x1000, ppu_banksize * 4); | |
87 | + } | |
88 | +} |