tepples wrote:
Try instead changing each 1 * mega to 2 * mega.
I thought that that might be the issue, and I tried that too, but to no avail. It's still giving me the following errors:
Code:
data range must be 0x000000 to 0x0000ff
CALLSTACK
*FUNCTION [vrc2a_ppubank_set()] vrc2gg.ad line [152]
*FUNCTION [ppu_dump()] vrc2gg.ad line [164]
*FUNCTION [dump()] dumpcore.nut line [45]
LOCALS
[a3] 3
[a2] 1
[a1] 1
[r1] 0
[r0] 1
[j] 129
[i] 128
[addr] 45056
[a3] USERPOINTER
[this] TABLE
[i] 128
[r1] 0
[r0] 1
[banksize] 1024
[pagesize] 256
[d] USERPOINTER
[this] TABLE
[ppu_dumpsize]262144
[cpu_dumpsize] 262144
[ppuarea_memory] 0
[vram] 0
[increase_ppu] 2
[increase_cpu] 1
[mappernum] 25
[script] "vrc2gg.ad"
[d] USERPOINTER
[this] TABLE
For reference, here's the code I've got so far:
Code:
/*
VRCII A0,A1 swap + charcter ROM address bus shiftx1
051744 jumper G?
VRC-CPU|databus
A0 - A1|A0: xxxx210x
A1 - A0|A1: xxxx6543
VRC-CHRCTER ROM
A11-A17 = A10-A16
*/
board <- {
mappernum = 25, vram_mirrorfind = false, ppu_ramfind = false,
cpu_rom = {
size_base = 2 * mega, size_max = 2 * mega,
banksize = 0x2000
},
ppu_rom = {
size_base = 2 * mega, size_max = 2 * mega,
banksize = 0x2000 / 8
}
};
function vrc4_cpu_dump(d, pagesize, banksize, r0, r1)
{
cpu_write(d, 0x90ff, 0);
for(local i = 0; i < pagesize; i += 2)
{
cpu_write(d, 0x8000, i);
cpu_write(d, 0xa000, i | 1);
cpu_read(d, 0x8000, banksize * 2);
}
}
function ppu_bank_set(d, addr, i, j, r0, r1)
{
local a1 = (1 << r0);
local a2 = (1 << r1);
local a3 = a1 | a2;
cpu_write(d, addr | a1, i >> 4);
cpu_write(d, addr, i & 0xf);
cpu_write(d, addr | a3, j >> 4);
cpu_write(d, addr | a2, j & 0xf);
}
function vrc4_ppu_dump(d, pagesize, banksize, r0, r1)
{
for(local i = 0; i < pagesize; i += 8)
{
ppu_bank_set(d, 0xb000, i | 0, i | 1, r0, r1);
ppu_bank_set(d, 0xc000, i | 2, i | 3, r0, r1);
ppu_bank_set(d, 0xd000, i | 4, i | 5, r0, r1);
ppu_bank_set(d, 0xe000, i | 6, i | 7, r0, r1);
ppu_read(d, 0x0000, banksize * 8);
}
}
function vrc4_program_initialize(d, cpu_banksize, ppu_banksize, r0, r1)
{
local a2 = 1 << r1;
cpu_write(d, 0x9000 | a2, 0);
cpu_write(d, 0x8000, 1);
cpu_write(d, 0xa000, 0);
cpu_command(d, 0, 0xa000, cpu_banksize);
cpu_command(d, 0x2aaa, 0x8000, cpu_banksize);
cpu_command(d, 0x5555, 0xc000, cpu_banksize);
ppu_bank_set(d, 0xb000, 0x0a, 0x15, r0, r1);
ppu_bank_set(d, 0xc000, 0x00, 0x00, r0, r1);
ppu_command(d, 0, 0x0800, ppu_banksize);
ppu_command(d, 0x2aaa, 0x0000, ppu_banksize);
ppu_command(d, 0x5555, 0x0400, ppu_banksize);
}
function cpu_transfer(d, start, end, cpu_banksize)
{
for(local i = start; i < end - 2; i++)
{
cpu_write(d, 0xa000, i);
cpu_program(d, 0xa000, cpu_banksize);
}
cpu_program(d, 0xc000, cpu_banksize * 2);
}
function vrc4_ppu_transfer(d, start, end, ppu_banksize, r0, r1)
{
for(local i = start; i < end; i += 4)
{
ppu_bank_set(d, 0xd000, i | 0, i | 1, r0, r1);
ppu_bank_set(d, 0xe000, i | 2, i | 3, r0, r1);
ppu_program(d, 0x1000, ppu_banksize * 4);
}
}
function cpu_dump(d, pagesize, banksize)
{
vrc4_cpu_dump(d, pagesize, banksize, 1, 0);
}
function vrc2a_ppubank_set(d, addr, i, j, r0, r1)
{
local a1 = 1 << r0;
local a2 = 1 << r1;
local a3 = a1|a2;
cpu_write(d, addr | a1, i >> 3);
cpu_write(d, addr, i << 1);
cpu_write(d, addr | a3, j >> 3);
cpu_write(d, addr | a2, j << 1);
}
function ppu_dump(d, pagesize, banksize)
{
local r0 = 1;
local r1 = 0;
for(local i = 0; i < pagesize; i += 8)
{
vrc2a_ppubank_set(d, 0xb000, i | 0, i | 1, r0, r1);
vrc2a_ppubank_set(d, 0xc000, i | 2, i | 3, r0, r1);
vrc2a_ppubank_set(d, 0xd000, i | 4, i | 5, r0, r1);
vrc2a_ppubank_set(d, 0xe000, i | 6, i | 7, r0, r1);
ppu_read(d, 0x0000, banksize * 8);
}
}